roojspacker/Packer.vala
authorAlan <alan@roojs.com>
Fri, 16 Feb 2024 05:22:22 +0000 (13:22 +0800)
committerAlan <alan@roojs.com>
Fri, 16 Feb 2024 05:22:22 +0000 (13:22 +0800)
roojspacker/Packer.vala

index 782e40c..78a84da 100644 (file)
@@ -150,18 +150,27 @@ namespace JSDOC
                
 //#if HAVE_JSON_GLIB
                
+               // loosely based on diagnostics in LSP
+               // key/value  key = filename / value = LSP.Diagnostic
+               
                public Json.Object result;   // output - what's the complication result
+               
 
-               public void  logError(ResultType type, string filename, int line, string message) {
+               public void  logError(ResultType type, string filename, int line, string message)
+               {
+                       if (!this.result.has_member(type.to_string())) {
+                               this.result.set_object_member(filename, new Json.Array());
+                       }
+                       var fa = this.result.get_array_member( filename);
+                       var diag = new Json.Object();
+                       diag.set_string_member( "message", message );
+                       diag.set_int_member( "severity", type.to_lsp() );
+                       diag.set_int_member( "line", line );
+                        /**
+                               
                         
-                        if (!this.result.has_member(type.to_string()+"-TOTAL")) {
-                                this.result.set_int_member(type.to_string()+"-TOTAL", 1);
-                        } else {
-                               this.result.set_int_member(type.to_string()+"-TOTAL", 
-                                       this.result.get_int_member(type.to_string()+"-TOTAL") +1 
-                               );
-                        }
                         
+                        */
                         
                         if (!this.result.has_member(type.to_string())) {
                                 this.result.set_object_member(type.to_string(), new Json.Object());