src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Sat, 16 Mar 2024 09:26:23 +0000 (17:26 +0800)
committerAlan Knowles <alan@roojs.com>
Sat, 16 Mar 2024 09:26:23 +0000 (17:26 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index 931ddd9..c08f464 100644 (file)
                "\tvar lbl = (Gtk.Label) img.get_next_sibling();",
                "\t",
                "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
-               "\tvar node = (JsRender.Node) lr.get_item();",
-               "\tif (node == null || node.fqn() == \"\") {",
-               "\t\treturn;",
-               "\t}",
+               "\tvar sym = (Lsp.DocumentSymbol) lr.get_item();",
+               "\t",
                "   ",
-               "    expand.set_hide_expander( !node.hasChildren() );",
+               "    expand.set_hide_expander( sym.children.get_n_items()  < 1);",
                " \texpand.set_list_row(lr);",
                " \t",
-               " \tnode.bind_property(\"iconResourceName\",",
-               "                    img, \"resource\",",
-               "                   GLib.BindingFlags.SYNC_CREATE);",
+               " \t//node.bind_property(\"iconResourceName\",",
+               "     //               img, \"resource\",",
+               "     //              GLib.BindingFlags.SYNC_CREATE);",
                " \t",
-               " \tnode.bind_property(\"nodeTitleProp\",",
+               " \tsym.bind_property(\"name\",",
                "                    lbl, \"label\",",
                "                   GLib.BindingFlags.SYNC_CREATE);",
-               " \tnode.bind_property(\"nodeTipProp\",",
+               " \t// should be better?- --line no?",
+               " \tsym.bind_property(\"detail\",",
                "                    lbl, \"tooltip_markup\",",
                "                   GLib.BindingFlags.SYNC_CREATE);",
                " \t// bind image...",
index 8c2dd68..cffa58f 100644 (file)
@@ -1869,22 +1869,21 @@ public class Editor : Object
                                var lbl = (Gtk.Label) img.get_next_sibling();
                                
                                var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
-                               var node = (JsRender.Node) lr.get_item();
-                               if (node == null || node.fqn() == "") {
-                                       return;
-                               }
+                               var sym = (Lsp.DocumentSymbol) lr.get_item();
+                               
                           
-                           expand.set_hide_expander( !node.hasChildren() );
+                           expand.set_hide_expander( sym.children.get_n_items()  < 1);
                                expand.set_list_row(lr);
                                
-                               node.bind_property("iconResourceName",
-                                           img, "resource",
-                                          GLib.BindingFlags.SYNC_CREATE);
+                               //node.bind_property("iconResourceName",
+                            //               img, "resource",
+                            //              GLib.BindingFlags.SYNC_CREATE);
                                
-                               node.bind_property("nodeTitleProp",
+                               sym.bind_property("name",
                                            lbl, "label",
                                           GLib.BindingFlags.SYNC_CREATE);
-                               node.bind_property("nodeTipProp",
+                               // should be better?- --line no?
+                               sym.bind_property("detail",
                                            lbl, "tooltip_markup",
                                           GLib.BindingFlags.SYNC_CREATE);
                                // bind image...