Commit 150bc11e authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

Definition: improve parsing VariantObject

parent 069474b6
Pipeline #135211 passed with stages
in 9 minutes and 46 seconds
......@@ -17,6 +17,5 @@
*/
public class GVls.TextDocumentIdentifierInfo : Object, VariantObject, TextDocumentIdentifier {
[Description (nick="uri")]
public string uri { get; set; }
}
......@@ -20,6 +20,7 @@ public interface GVls.TextDocumentIdentifier : Object, VariantObject {
/**
* The text document's URI.
*/
[Description (nick="uri")]
public abstract string uri { get; set; }
}
......@@ -19,7 +19,9 @@
* Implementation of {@link TextDocumentPositionParams}
*/
public class GVls.TextDocumentPositionParamsInfo : Object, VariantObject, TextDocumentPositionParams {
[Description (nick="textDocument")]
public TextDocumentIdentifier text_document { get; set; }
[Description (nick="position")]
public Position position { get; set; }
construct {
......
......@@ -607,10 +607,14 @@ public interface GVlsp.ServerJsonrpc : Jsonrpc.Server, GVls.Server
Variant res = null;
message ("Request: %s", @params.print (true));
var c = new TextDocumentPositionParamsInfo ();
c.parse_variant (@params);
message ("Parsed: %s", c.to_variant ().print (true));
c.parse_variant (@params);
var k = new ContainerKeyStringHolder ();
k.key = c.text_document.uri;
var sv = server.server.servers.find (k) as GVls.ValaServer;
......@@ -625,6 +629,7 @@ public interface GVlsp.ServerJsonrpc : Jsonrpc.Server, GVls.Server
} else {
res = new GVls.SourceLocation ().to_variant ();
}
message ("Response: %s", res.print (true));
try { client.reply (id, res); } catch (Error e) { warning ("Go to definition response error: %s", e.message); }
server.did_document_symbols ();
}
......
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