From: Alan Knowles Date: Wed, 20 Mar 2024 15:29:13 +0000 (+0800) Subject: src/Builder4/Editor.bjs X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=a36c75b665bcbb8743fb95a37a9b4bec17033683;p=roobuilder src/Builder4/Editor.bjs src/Builder4/Editor.vala --- diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index e32f43e65..bf3f55592 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -1522,8 +1522,15 @@ "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)", "{", " this.reset();", + " if (this.file != null) {", + " \tthis.file.navigation_tree_updated.disconnect(", + " \t\t_this.navigation.show", + " \t);", + " }", " this.file = file; ", - " ", + " this.file.navigation_tree_updated.connect(", + "\t\t_this.navigation.show", + "\t);", " if (file.xtype != \"PlainFile\") {", " \tthis.prop = prop;", " this.node = node;", @@ -1541,8 +1548,9 @@ " this.updateErrorMarks();", " this.close_btn.el.hide();", " var ls = file.getLanguageServer();", - " ls.documentSymbols.begin(file, (a,o) => {", - " \t_this.navigation.show(ls.documentSymbols.end(o)); ", + " ls.queueDocumentSymbols(file);", + " ////ls.documentSymbols.begin(file, (a,o) => {", + " //\t_this.navigation.show(ls.documentSymbols.end(o)); ", " });", " //documentSymbols", " ", diff --git a/src/Builder4/Editor.vala b/src/Builder4/Editor.vala index 11f3fbf64..9225fe59e 100644 --- a/src/Builder4/Editor.vala +++ b/src/Builder4/Editor.vala @@ -138,8 +138,15 @@ public class Editor : Object public void show (JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop) { this.reset(); + if (this.file != null) { + this.file.navigation_tree_updated.disconnect( + _this.navigation.show + ); + } this.file = file; - + this.file.navigation_tree_updated.connect( + _this.navigation.show + ); if (file.xtype != "PlainFile") { this.prop = prop; this.node = node; @@ -157,8 +164,9 @@ public class Editor : Object this.updateErrorMarks(); this.close_btn.el.hide(); var ls = file.getLanguageServer(); - ls.documentSymbols.begin(file, (a,o) => { - _this.navigation.show(ls.documentSymbols.end(o)); + ls.queueDocumentSymbols(file); + ////ls.documentSymbols.begin(file, (a,o) => { + // _this.navigation.show(ls.documentSymbols.end(o)); }); //documentSymbols