var file = cur_project.getByRelPath(BuilderApplication.opt_language_server);
if (file == null) {
// then compile them all, and compare them...
- GLib.error("missing file %s in project %s", BuilderApplication.opt_language_server, cur_project.name);
+
+ if (!GLib.FileUtils.test(BuilderApplication.opt_language_server, FileTest.EXISTS)) {
+ GLib.error("missing file %s in project %s", BuilderApplication.opt_language_server, cur_project.name);
+
+ }
+ // in theory we can test a vapi?
+ file = new JsRender.PlainFile(cur_project,BuilderApplication.opt_language_server);
}
var ls = file.getLanguageServer();
//Posix.sleep( 30 );
var loop = new MainLoop();
GLib.Timeout.add_seconds(1, () => {
-
- GLib.debug("Sending document_open");
+ if (!ls.isReady()) {
+ GLib.debug("LS not ready - try again");
+
+ return true;
+ }
+ //GLib.debug("Sending document_open");
// it's ready..
- ls.document_open(file);
- ls.document_save.begin( file, (o,res) => {
- ls.document_save.end(res);
- });
+ //ls.document_open(file);
+ //ls.document_save.begin( file, (o,res) => {
+ // ls.document_save.end(res);
+ //});
//ls.syntax.begin(file, (obj,res) => {
// ls.syntax.end(res);
- //});
+ //});
+ GLib.debug("Sending docSybmols");
+ ls.documentSymbols.begin(file, (o,res) => {
+ GLib.debug("Got doc symbols return");
+ ls.documentSymbols.end(res);
+ });
return false;
"| void show" : [
"(Gee.ArrayList<Lsp.DocumentSymbol> syms) {",
"\t",
- "\tif (!_this.navigation_holder.el.visible) {",
+ "\tif (!_this.navigation_holder.el.visible && syms.size > 0) {",
"\t\t_this.navigation_holder.el.show();",
"\t\t_this.paned.el.position = ",
"\t\t\t_this.paned.el.get_width() - 200;",
}
public void show (Gee.ArrayList<Lsp.DocumentSymbol> syms) {
- if (!_this.navigation_holder.el.visible) {
+ if (!_this.navigation_holder.el.visible && syms.size > 0) {
_this.navigation_holder.el.show();
_this.paned.el.position =
_this.paned.el.get_width() - 200;
public override string language_id()
{
+
+ GLib.debug("file ext: %s", this.file_ext);
switch(this.file_ext) {
case "js": return "javascript";
case "vala": return "vala";
+ case "vapi": return "vala";
+ case "c": return "c";
case "php": return "php";
case "css": return "css";
case "sql": return "sql";
public abstract void initialize_server();
-
+ public abstract bool isReady () ;
public abstract void document_open (JsRender.JsRender file) ;
public abstract async void document_save (JsRender.JsRender file);
public abstract void document_close (JsRender.JsRender file);
public override void initialize_server() {
GLib.debug("initialize dummy server");
}
+ public override bool isReady () { return true; }
public override void document_open (JsRender.JsRender file) {}
public override async void document_save (JsRender.JsRender file) {}
public override void document_change (JsRender.JsRender file ) {}
public override void initialize_server() {
GLib.debug("initialize javascript server");
}
-
+ public override bool isReady () { return true; }
public override void document_open (JsRender.JsRender file)
{
this.initialize_server ();
}
-
}
}
- public bool isReady()
+ public override bool isReady()
{
if (this.closed) {
this.log(LanguageClientAction.RESTART,"closed is set - restarting");
var ret = new Gee.ArrayList<Lsp.DocumentSymbol>();
//ret = null;
if (!this.isReady()) {
+ GLib.debug("docsymbols not ready");
return ret;
}
if (this.getting_symbols) {
+ GLib.debug("docsymbols currently getting symbols");
return ret;
}
doc_symbol_queue_call_count++;
var call_id = yield this.queuer(doc_symbol_queue_call_count);
if (call_id != doc_symbol_queue_call_count) {
-
+ GLib.debug("docsymbols call id does not match %d %d" ,call_id , doc_symbol_queue_call_count);
return ret;
}
this.getting_symbols = true;
if (this.language_servers.has_key(lang)) {
return this.language_servers.get(lang);
}
+
+ GLib.debug("Get language Server %s", lang);
switch( lang ) {
case "vala":
+ case "c": // not really... but we like it..
var ls = new Palete.LanguageClientVala(this);
ls.log.connect((act, msg) => {
//GLib.debug("log %s: %s", act.to_string(), msg);