fix #7968 - language server support for syntax check and completion
[roobuilder] / src / JsRender / PlainFile.vala
index b5b05be..29f8284 100644 (file)
@@ -21,15 +21,19 @@ namespace JsRender {
 
         public PlainFile(Project.Project project, string path) {
         
-            aconstruct( project, path);
+            base( project, path);
             this.xtype = "PlainFile";
+            this.content_type = "text/plain";
             
             // if the file does not exist...
             if (GLib.FileUtils.test(path, GLib.FileTest.EXISTS)) {
                        var f = File.new_for_path (path) ;
-                       var info = f.query_info ("standard::*", 0);
-                       var ct = info.get_content_type();
-                   this.content_type = ct;
+                       try {
+                                   var info = f.query_info ("standard::*", 0);
+                                   var ct = info.get_content_type();
+                               this.content_type = ct;
+                       } catch (GLib.Error e) {}
+                      
             } else {
                        this.content_type = "text/plain"; // hopefully..
 //                     var ar = path.split(".");
@@ -139,10 +143,7 @@ namespace JsRender {
          */ 
          
    
-        string getHelpUrl(string cls)
-        {
-            return ""; 
-        }
+        
         public override void  findTransStrings(Node? node )
                {
                        // not yet..
@@ -152,8 +153,23 @@ namespace JsRender {
                {
                        return "Roo files do not convert to glade";
                }
-         
+           public override string targetName()
+           {
+               return this.path;
+       }
+
 
+               public   override string language_id() 
+               {
+                       switch(this.file_ext) {
+                               case "js": return "javascript";
+                               case "vala": return "vala";
+                               case "php": return "php";
+                               case "css": return "css";
+                               case "sql": return "sql";
+                               default: return "???";
+                       }
+               }
                
 
        }