From: Alan Date: Wed, 27 Mar 2024 10:01:42 +0000 (+0800) Subject: src/Palete/LanguageClientVala.vala X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=12fb867e3be814b47fa95b07f6790337606e82cf;p=roobuilder src/Palete/LanguageClientVala.vala --- diff --git a/src/Palete/LanguageClientVala.vala b/src/Palete/LanguageClientVala.vala index 1a10a45e6..03c16345e 100644 --- a/src/Palete/LanguageClientVala.vala +++ b/src/Palete/LanguageClientVala.vala @@ -743,7 +743,7 @@ namespace Palete { return ret; } if (this.getting_symbols) { - return; + return ret; } @@ -756,22 +756,27 @@ namespace Palete { this.getting_symbols = true; Variant? return_value; - yield this.jsonrpc_client.call_async ( - "textDocument/documentSymbol", - this.buildDict ( - - textDocument : this.buildDict ( ///TextDocumentItem; - uri: new GLib.Variant.string (file.to_url()), - version : new GLib.Variant.uint64 ( (uint64) file.version) - ) - - ), - null, - out return_value - ); + try { + yield this.jsonrpc_client.call_async ( + "textDocument/documentSymbol", + this.buildDict ( + + textDocument : this.buildDict ( ///TextDocumentItem; + uri: new GLib.Variant.string (file.to_url()), + version : new GLib.Variant.uint64 ( (uint64) file.version) + ) + + ), + null, + out return_value + ); + } catch(Error e) { + this.getting_symbols = false; + throw e; + } this.getting_symbols = false; - GLib.debug ("LS replied with %s", Json.to_string (Json.gvariant_serialize (return_value), true)); + GLib.debug ("LS replied with %s", Json.to_string (Json.gvariant_serialize (return_value), true)); var json = Json.gvariant_serialize (return_value);