Implement DocumentLink of GDScript LSP Server

This commit is contained in:
geequlim 2019-10-03 16:26:55 +08:00
parent d1a6964d39
commit 6a8303f82f
7 changed files with 99 additions and 4 deletions

View file

@ -271,8 +271,17 @@ Array GDScriptTextDocument::codeLens(const Dictionary &p_params) {
return arr;
}
Variant GDScriptTextDocument::documentLink(const Dictionary &p_params) {
Variant ret;
Array GDScriptTextDocument::documentLink(const Dictionary &p_params) {
Array ret;
lsp::DocumentLinkParams params;
params.load(p_params);
List<lsp::DocumentLink> links;
GDScriptLanguageProtocol::get_singleton()->get_workspace()->resolve_document_links(params.textDocument.uri, links);
for (const List<lsp::DocumentLink>::Element *E = links.front(); E; E = E->next()) {
ret.push_back(E->get().to_json());
}
return ret;
}