Commit d94544c2 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

ServerJsonrpc: added Vala keywords for workspace/symbol request

parent 87bbaef5
Pipeline #142176 passed with stages
in 53 minutes and 57 seconds
......@@ -419,11 +419,16 @@ public interface GVlsp.ServerJsonrpc : Jsonrpc.Server, GVls.Server
var p = new WorkspaceSymbolParamsInfo ();
p.parse_variant (@params);
var s = server.server.get_symbol (p.query);
var c = new GVls.ContainerHashList.for_type (typeof (SymbolInformationInfo));
if (s != null) {
var si = new SymbolInformationInfo.from_symbol (s);
c.add (si);
GVls.SymbolInformationInfo isy = keyword (p.query);
if (isy != null) {
c.add (isy);
} else {
var s = server.server.get_symbol (p.query);
if (s != null) {
var si = new SymbolInformationInfo.from_symbol (s);
c.add (si);
}
}
var res = c.to_variant ();
......@@ -436,6 +441,223 @@ public interface GVlsp.ServerJsonrpc : Jsonrpc.Server, GVls.Server
server.did_workspace_symbol ();
}
internal static GVls.SymbolInformationInfo? keyword (string key) {
GVls.SymbolInformationInfo sym = new GVls.SymbolInformationInfo ();
sym.kind = GVls.SymbolKind.KEY;
switch (key) {
case "abstract":
sym.name = "abstract";
break;
case "as":
sym.name = "as";
break;
case "async":
sym.name = "async";
break;
case "base":
sym.name = "base";
break;
case "break":
sym.name = "break";
break;
case "case":
sym.name = "case";
break;
case "catch":
sym.name = "catch";
break;
case "class":
sym.name = "class";
break;
case "const":
sym.name = "const";
break;
case "construct":
sym.name = "construct";
break;
case "continue":
sym.name = "continue";
break;
case "default":
sym.name = "default";
break;
case "delegate":
sym.name = "delegate";
break;
case "delete":
sym.name = "delete";
break;
case "do":
sym.name = "do";
break;
case "dynamic":
sym.name = "dynamic";
break;
case "else":
sym.name = "else";
break;
case "enum":
sym.name = "enum";
break;
case "ensures":
sym.name = "ensures";
break;
case "errordomain":
sym.name = "errordomain";
break;
case "extern":
sym.name = "extern";
break;
case "false":
sym.name = "false";
sym.kind = GVls.SymbolKind.CONSTANT;
break;
case "finaly":
sym.name = "finaly";
break;
case "for":
sym.name = "for";
break;
case "foreach":
sym.name = "foreach";
break;
case "get":
sym.name = "get";
break;
case "if":
sym.name = "if";
break;
case "in":
sym.name = "in";
break;
case "inline":
sym.name = "inline";
break;
case "interface":
sym.name = "interface";
break;
case "internal":
sym.name = "internal";
break;
case "is":
sym.name = "is";
break;
case "lock":
sym.name = "lock";
break;
case "namespace":
sym.name = "namespace";
break;
case "new":
sym.name = "new";
break;
case "null":
sym.name = "null";
sym.kind = GVls.SymbolKind.NULL;
break;
case "out":
sym.name = "out";
break;
case "override":
sym.name = "override";
break;
case "owned":
sym.name = "owned";
break;
case "params":
sym.name = "params";
break;
case "private":
sym.name = "private";
break;
case "protected":
sym.name = "protected";
break;
case "public":
sym.name = "public";
break;
case "ref":
sym.name = "ref";
break;
case "requires":
sym.name = "requires";
break;
case "return":
sym.name = "return";
break;
case "sealed":
sym.name = "sealed";
break;
case "set":
sym.name = "set";
break;
case "signal":
sym.name = "signal";
break;
case "sizeof":
sym.name = "sizeof";
break;
case "static":
sym.name = "static";
break;
case "struct":
sym.name = "struct";
break;
case "switch":
sym.name = "switch";
break;
case "this":
sym.name = "this";
break;
case "throw":
sym.name = "throw";
break;
case "throws":
sym.name = "throws";
break;
case "true":
sym.name = "true";
break;
case "try":
sym.name = "try";
break;
case "typeof":
sym.name = "typeof";
break;
case "unowned":
sym.name = "unowned";
break;
case "using":
sym.name = "using";
break;
case "var":
sym.name = "var";
break;
case "virtual":
sym.name = "virtual";
break;
case "void":
sym.name = "void";
break;
case "volatile":
sym.name = "volatile";
break;
case "weak":
sym.name = "weak";
break;
case "while":
sym.name = "while";
break;
case "yield":
sym.name = "yield";
break;
default:
return null;
}
return sym;
}
internal class PositionWords : Object {
public string cname { get; set; }
public string word { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment