projects
/
roobuilder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
264a887
)
src/Palete/LanguageClientVala.vala
author
Alan
<alan@roojs.com>
Wed, 27 Mar 2024 08:45:48 +0000
(16:45 +0800)
committer
Alan
<alan@roojs.com>
Wed, 27 Mar 2024 08:45:48 +0000
(16:45 +0800)
src/Palete/LanguageClientVala.vala
patch
|
blob
|
history
diff --git
a/src/Palete/LanguageClientVala.vala
b/src/Palete/LanguageClientVala.vala
index
ef5bd01
..
66df263
100644
(file)
--- a/
src/Palete/LanguageClientVala.vala
+++ b/
src/Palete/LanguageClientVala.vala
@@
-650,6
+650,20
@@
namespace Palete {
}
}
+ async int hover_queue()
+ {
+ var cb = hover_queue.callback;
+ hover_call_count++;
+ var call_id = hover_call_count;
+
+ GLib.Timeout.add(1000, () => {
+ GLib.Idle.add(cb);
+ return false;
+ });
+
+ yield;
+ return call_id;
+ }
static int hover_call_count = 1;
static int hover_call_count = 1;
@@
-664,17
+678,8
@@
namespace Palete {
if (!this.isReady()) {
return ret;
}
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);
-
- GLib.Timeout.add(1000, () => {
- GLib.Idle.add(callback);
- return false;
- });
- yield;
+ var call_id = hover_queue();
+
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);
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);