sync wip_alan_T7973_fix_completion_in_node_edit origin/wip_alan_T7973_fix_completion_in_node_edit
authorAlan <alan@roojs.com>
Fri, 19 Jan 2024 07:31:55 +0000 (15:31 +0800)
committerAlan <alan@roojs.com>
Fri, 19 Jan 2024 07:31:55 +0000 (15:31 +0800)
15 files changed:
.roobuilder.jcfg
src/Application.vala
src/Builder4/DialogFiles.bjs
src/Builder4/DialogFiles.vala
src/Builder4/Editor.bjs
src/Builder4/Editor.vala
src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala
src/Builder4/WindowState.vala
src/JsRender/Gtk.vala
src/JsRender/NodeToGlade.vala
src/Palete/CompileError.vala
src/Palete/ValaCompileRequest.vala
src/Palete/ValaSource.vala
src/Project/Gtk.vala

index 38a066e..0ebdbf7 100644 (file)
@@ -77,7 +77,6 @@
                 "src/Palete/Palete.vala",
                 "src/Palete/Roo.vala",
                 "src/Palete/ValaSourceCompiler.vala",
-                "src/Palete/ValaSource.vala",
                 "src/Palete/VapiParser.vala",
                 "src/Builder4/WindowLeftTree.bjs",
                 "src/Builder4/PopoverAddProp.bjs",
         "jsonrpc-glib-1.0",
         "gio-unix-2.0"
     ]
-}
\ No newline at end of file
+}
index 8a583c3..bf40278 100644 (file)
@@ -710,7 +710,7 @@ flutter-project  -  was try and read flutter data (but desnt work.)
                
                }
                
-               public void showSpinnerLspLog(Palete.LanguageClientAction action, string message) {
+               public static void showSpinnerLspLog(Palete.LanguageClientAction action, string message) {
                        
                        var msg = action.to_string() + " " + message;
                        switch(action) {
@@ -772,10 +772,10 @@ flutter-project  -  was try and read flutter data (but desnt work.)
                        
                        
                        // ?? restart = software-update-urgent - crash?
-                       
+
                        
                        foreach (var win in BuilderApplication.windows) {
-                               if (icon == "") {
+                               if (icon != "") {
                                        win.statusbar_compile_spinner.start(icon, tooltip);
                                }  else {
                                        win.statusbar_compile_spinner.stop();
index 4eaec2b..ec42b33 100644 (file)
     "() {",
     "     // clear list...",
     "    ",
-    "      ",
+    "       ",
     "     _this.is_loading = true;",
     "         ",
-    "     ",
+    "",
     "     Project.Project.loadAll();",
     "     _this.project_list.el.set_model(new Gtk.SingleSelection(null));",
     "     Project.Project.loadIntoStore(this.projectmodel.el);",
index 44fc611..8627246 100644 (file)
@@ -178,10 +178,10 @@ public class DialogFiles : Object
        public void load () {
             // clear list...
            
-             
+              
             _this.is_loading = true;
                 
-            
+       
             Project.Project.loadAll();
             _this.project_list.el.set_model(new Gtk.SingleSelection(null));
             Project.Project.loadIntoStore(this.projectmodel.el);
index 58f3fe4..b1a00f9 100644 (file)
           "         var  oldcode =_this.file.toSource();",
           "        _this.file.setSource(str);",
           "        _this.file.getLanguageServer().document_change(_this.file);",
-          "\t    BuilderApplication.showSpinner(true);",
+          "\t    BuilderApplication.showSpinner(\"appointment soon\",\"document change pending\");",
           "        _this.file.setSource(oldcode);",
           "        ",
           "\t\t ",
     "",
     "\tbuf.remove_source_marks (start, end, category);",
     " ",
-    "\tGLib.debug(\"highlight errors\");\t\t ",
+    "\t//GLib.debug(\"highlight errors\");\t\t ",
     "",
     "\t // we should highlight other types of errors..",
     "",
     "\t\t&&",
     "\t\t_this.window.windowstate.state != WindowState.State.CODE",
     "\t\t) {",
-    "\t\tGLib.debug(\"windowstate != CODEONLY?\");",
+    "\t\t//GLib.debug(\"windowstate != CODEONLY?\");",
     "\t\t",
     "\t\treturn;",
     "\t} ",
     "\t}",
     "\tvar ar = this.file.getErrors(category);",
     "\tif (ar == null || ar.get_n_items() < 1) {",
-    "\t\tGLib.debug(\"highlight %s :  %s has no errors\", this.file.relpath, category);",
+    "\t\t//GLib.debug(\"highlight %s :  %s has no errors\", this.file.relpath, category);",
     "\t\treturn;",
     "\t}",
     " ",
     "\tvar tlines = buf.get_line_count () +1;",
     "\t",
     "\tif (_this.prop != null) {",
-    "\t",
+    "\t\t// this still seems flaky...",
+    "\t\t",
     "\t\ttlines = _this.prop.end_line;",
     "\t\toffset = _this.prop.start_line;",
-    "\t\t",
-    "\t",
+    "\t\t ",
     "\t}",
     "\t ",
     "\tfor (var i = 0; i < ar.get_n_items();i++) {",
     "\t     Gtk.TextIter iter;",
     "//        print(\"get inter\\n\");",
     "\t    var eline = err.line - offset;",
-    "\t    GLib.debug(\"GOT ERROR on line %d -- converted to %d  (offset = %d)\",",
-    "\t    \terr.line ,eline, offset);",
+    "\t    //GLib.debug(\"GOT ERROR on line %d -- converted to %d  (offset = %d)\",",
+    "\t    //\terr.line ,eline, offset);",
     "\t    ",
     "\t    ",
     "\t    if (eline > tlines || eline < 0) {",
     "\t   ",
     "\t\tvar msg = \"Line: %d %s : %s\".printf(eline+1, err.category, err.msg);",
     "\t    buf.create_source_mark( msg, err.category, iter);",
-    "\t    GLib.debug(\"set line %d to %s\", eline, msg);",
+    "\t   // GLib.debug(\"set line %d to %s\", eline, msg);",
     "\t    //this.marks.set(eline, msg);",
     "\t}",
     "\treturn ;",
index 69e4995..845175e 100644 (file)
@@ -251,7 +251,7 @@ public class Editor : Object
        
                buf.remove_source_marks (start, end, category);
         
-               GLib.debug("highlight errors");          
+               //GLib.debug("highlight errors");                
        
                 // we should highlight other types of errors..
        
@@ -259,7 +259,7 @@ public class Editor : Object
                        &&
                        _this.window.windowstate.state != WindowState.State.CODE
                        ) {
-                       GLib.debug("windowstate != CODEONLY?");
+                       //GLib.debug("windowstate != CODEONLY?");
                        
                        return;
                } 
@@ -272,7 +272,7 @@ public class Editor : Object
                }
                var ar = this.file.getErrors(category);
                if (ar == null || ar.get_n_items() < 1) {
-                       GLib.debug("highlight %s :  %s has no errors", this.file.relpath, category);
+                       //GLib.debug("highlight %s :  %s has no errors", this.file.relpath, category);
                        return;
                }
         
@@ -285,11 +285,11 @@ public class Editor : Object
                var tlines = buf.get_line_count () +1;
                
                if (_this.prop != null) {
-               
+                       // this still seems flaky...
+                       
                        tlines = _this.prop.end_line;
                        offset = _this.prop.start_line;
-                       
-               
+                        
                }
                 
                for (var i = 0; i < ar.get_n_items();i++) {
@@ -298,8 +298,8 @@ public class Editor : Object
                     Gtk.TextIter iter;
        //        print("get inter\n");
                    var eline = err.line - offset;
-                   GLib.debug("GOT ERROR on line %d -- converted to %d  (offset = %d)",
-                       err.line ,eline, offset);
+                   //GLib.debug("GOT ERROR on line %d -- converted to %d  (offset = %d)",
+                   //  err.line ,eline, offset);
                    
                    
                    if (eline > tlines || eline < 0) {
@@ -312,7 +312,7 @@ public class Editor : Object
                   
                        var msg = "Line: %d %s : %s".printf(eline+1, err.category, err.msg);
                    buf.create_source_mark( msg, err.category, iter);
-                   GLib.debug("set line %d to %s", eline, msg);
+                  // GLib.debug("set line %d to %s", eline, msg);
                    //this.marks.set(eline, msg);
                }
                return ;
@@ -862,7 +862,7 @@ public class Editor : Object
                         var  oldcode =_this.file.toSource();
                        _this.file.setSource(str);
                        _this.file.getLanguageServer().document_change(_this.file);
-                           BuilderApplication.showSpinner(true);
+                           BuilderApplication.showSpinner("appointment soon","document change pending");
                        _this.file.setSource(oldcode);
                        
                                 
index dc52f92..705b18b 100644 (file)
           "\t  _this.statusbar_compile_icon.el.hide();",
           "  } else {",
           "\t  this.el.hide();",
+          "\t//  GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
           "\t  _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
           "\t  _this.statusbar_compile_icon.el.icon_name = icon;",
           "\t  _this.statusbar_compile_icon.el.show();\t  ",
index 3b7a1a3..71de0b2 100644 (file)
@@ -1524,6 +1524,7 @@ public class Xcls_MainWindow : Object
                          _this.statusbar_compile_icon.el.hide();
                  } else {
                          this.el.hide();
+                       //  GLib.debug("set status icon %s, %s", icon, tooltip);
                          _this.statusbar_compile_icon.el.tooltip_text = tooltip;
                          _this.statusbar_compile_icon.el.icon_name = icon;
                          _this.statusbar_compile_icon.el.show();         
index ad1a74e..3168035 100644 (file)
@@ -655,7 +655,7 @@ public class WindowState : Object
                BuilderApplication.updateWindows();
                
                file.getLanguageServer().document_open(file);
-               BuilderApplication.showSpinner(true);   
+               BuilderApplication.showSpinner("spinner", "document open sent");        
                        
                if (file.xtype == "PlainFile") {
                        this.win.codeeditviewbox.el.show();
index 8e209fc..3ae204c 100644 (file)
@@ -167,8 +167,9 @@ namespace JsRender {
                // this.saveJS(); - disabled at present.. project settings will probably enable this later..
        
                this.saveVala();
-               BuilderApplication.showSpinner(true);
+
                this.getLanguageServer().document_save(this);
+               BuilderApplication.showSpinner("spinner", "document save send");                
            }
                // ignore these calls.
            public override void saveHTML ( string html ) {}
index 669200c..785db38 100644 (file)
@@ -127,7 +127,7 @@ public class JsRender.NodeToGlade : Object {
                var pviter = props.map_iterator();
                while (!skip_props && pviter.next()) {
                        
-                       GLib.debug ("Check: " +cls + "::(" + pviter.get_value().propertyof + ")" + pviter.get_key() + " " );
+                       //GLib.debug ("Check: " +cls + "::(" + pviter.get_value().propertyof + ")" + pviter.get_key() + " " );
                        
                // skip items we have already handled..
                if  (!this.node.has(pviter.get_key())) {
index ef8fcea..e33935d 100644 (file)
@@ -28,7 +28,7 @@ namespace Palete {
                        this.msg = msg;
                        this.file = file;
                        this.category = category;
-                        
+
                
                }
 
@@ -39,7 +39,7 @@ namespace Palete {
                        this.line = (int) diag.range.start.line;
                        this.msg = diag.message;   
                        this.lines = new GLib.ListStore(typeof(CompileError));
-                       GLib.debug("new error %s : %d  %s %s", file.path, this.line, this.category, this.msg);
+                       //GLib.debug("new error %s : %d  %s %s", file.path, this.line, this.category, this.msg);
                        
                        
                        
index 4c6faef..798bf04 100644 (file)
@@ -198,10 +198,16 @@ namespace Palete {
                        this.compiler.isZombie();
                        GLib.debug("compile got %s", output);
                        if (output == "") {
-                               BuilderApplication.showSpinner(false);
+               BuilderApplication.showSpinner("face-sad", "compile failed - no error message?");
                                return;
                        }
-                       
+                       if (this.requestType == ValaCompileRequestType.RUN) {
+               BuilderApplication.showSpinner("");
+                               this.execResult();
+                               return;
+                       }
+                       
+                       // below is not used anymore - as we dont use this
                        try { 
                                //GLib.debug("GOT output %s", output);
                                
@@ -210,12 +216,12 @@ namespace Palete {
                                var node = pa.get_root();
 
                                if (node.get_node_type () != Json.NodeType.OBJECT) {
-                                       BuilderApplication.showSpinner(false);
+                                       BuilderApplication.showSpinner("");
                                        return;
                                }
                                var ret = node.get_object ();   
                                //CompileError.parseCompileResults(this,ret);
-                               BuilderApplication.showSpinner(false);
+                                       BuilderApplication.showSpinner("");
                                
                        
                                
@@ -223,13 +229,10 @@ namespace Palete {
                                
                        } catch (GLib.Error e) {
                                GLib.debug("parsing output got error %s", e.message);
-                               BuilderApplication.showSpinner(false);
+                               BuilderApplication.showSpinner("");
                                return;
                                
                        }
-                       if (this.requestType == ValaCompileRequestType.RUN) {
-                               this.execResult();
-                       }
                }
                 
                public void onOutput(string line)
@@ -273,7 +276,7 @@ namespace Palete {
                        Javascript.singleton().validate(contents, this.file );
                         
                         
-                       BuilderApplication.showSpinner(false);
+                       BuilderApplication.showSpinner("");
                        BuilderApplication.updateCompileResults();
                        
                        //this.queue.onCompileComplete(this);
index 92f9ac6..778cc5b 100644 (file)
@@ -10,6 +10,8 @@
  *  x = new ValaSource();
  *  x.connect.compiled(... do something with results... );
  *  
+ THIS IS NOT USED ?? - replaced with valacompilerequest
  * 
  */
 
@@ -168,12 +170,12 @@ namespace Palete {
                                return false;
                        }
                        this.compiler.complete.connect(spawnResult);
-               this.spinner(true);
+               BuilderApplication.showSpinner("spinner", "compiling file");
                        try {
                                this.compiler.run(); 
                        } catch (GLib.Error e) {
                                GLib.debug("Error %s",e.message);
-                               this.spinner(false);
+                       BuilderApplication.showSpinner("face-sad", "compile failed %s".printf(e.message));
                                this.compiler = null;
                                this.deleteTemp();
                                return false;
@@ -183,16 +185,7 @@ namespace Palete {
                         
                }
                
-               public void spinner(bool state)
-               {
-                       foreach (var win in BuilderApplication.windows) {
-                               if (state) {
-                                       win.statusbar_compile_spinner.start();
-                               }  else {
-                                       win.statusbar_compile_spinner.stop();
-                               }
-                       }
-               }
+                
                
                
                public bool checkFileSpawn(JsRender.JsRender file )
index 698d824..1c0a8f6 100644 (file)
@@ -222,7 +222,10 @@ namespace Project
                        switch( lang ) {
                                case "vala":
                                        var ls = new Palete.LanguageClientVala(this);
-                                       ls.log.connect(BuilderApplication.showSpinnerLspLog);
+                                       ls.log.connect((act, msg) => {
+                                               //GLib.debug("log %s: %s", act.to_string(), msg);
+                                               BuilderApplication.showSpinnerLspLog(act,msg);
+                                       });
                                        this.language_servers.set(lang, ls);
                                        break;
                                default :