src/Palete/LanguageClientVala.vala
authorAlan <alan@roojs.com>
Wed, 27 Mar 2024 08:42:49 +0000 (16:42 +0800)
committerAlan <alan@roojs.com>
Wed, 27 Mar 2024 08:42:49 +0000 (16:42 +0800)
src/Palete/LanguageClientVala.vala

index 6cf07db..ef5bd01 100644 (file)
@@ -664,17 +664,17 @@ namespace Palete {
                    if (!this.isReady()) {
                                return ret;
                        }
-                       
+                       var  callback = hover.callback;
                        // try and block multiple calls - better than a big timeout loop?
                        hover_call_count++;
                        var call_id = hover_call_count;
                        GLib.debug("get hover call=%d   count=%d", call_id, hover_call_count);
-                       var loop = new MainLoop();
+
                        GLib.Timeout.add(1000, () => {
-                                loop.quit(); 
+                                GLib.Idle.add(callback);
                                 return false;
                        });
-                       loop.run();
+                       yield;
                        GLib.debug("end hover call=%d   count=%d", call_id, hover_call_count);                  
                        if (call_id != hover_call_count) {
                                GLib.debug("get hover CANCELLED %s %d %d", file.relpath, (int)line, (int)offset);