Merge pull request #114533 from HolonProduction/rm-lsp-unused-endpoints
LSP: Remove boilerplate for some unimplemented methods
This commit is contained in:
@@ -9,18 +9,6 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="codeLens" deprecated="Accessing LSP endpoints directly might lead to unwanted side effects. Connect to the server via TCP, like a regular language server client.">
|
||||
<return type="Array" />
|
||||
<param index="0" name="params" type="Dictionary" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="colorPresentation" deprecated="Accessing LSP endpoints directly might lead to unwanted side effects. Connect to the server via TCP, like a regular language server client.">
|
||||
<return type="Array" />
|
||||
<param index="0" name="params" type="Dictionary" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="completion" deprecated="Accessing LSP endpoints directly might lead to unwanted side effects. Connect to the server via TCP, like a regular language server client.">
|
||||
<return type="Array" />
|
||||
<param index="0" name="params" type="Dictionary" />
|
||||
@@ -75,12 +63,6 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="foldingRange" deprecated="Accessing LSP endpoints directly might lead to unwanted side effects. Connect to the server via TCP, like a regular language server client.">
|
||||
<return type="Array" />
|
||||
<param index="0" name="params" type="Dictionary" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="hover" deprecated="Accessing LSP endpoints directly might lead to unwanted side effects. Connect to the server via TCP, like a regular language server client.">
|
||||
<return type="Variant" />
|
||||
<param index="0" name="params" type="Dictionary" />
|
||||
|
||||
@@ -674,10 +674,7 @@ GDScriptLanguageProtocol::GDScriptLanguageProtocol() {
|
||||
SET_DOCUMENT_METHOD(rename);
|
||||
SET_DOCUMENT_METHOD(prepareRename);
|
||||
SET_DOCUMENT_METHOD(references);
|
||||
SET_DOCUMENT_METHOD(foldingRange);
|
||||
SET_DOCUMENT_METHOD(codeLens);
|
||||
SET_DOCUMENT_METHOD(documentLink);
|
||||
SET_DOCUMENT_METHOD(colorPresentation);
|
||||
SET_DOCUMENT_METHOD(hover);
|
||||
SET_DOCUMENT_METHOD(definition);
|
||||
SET_DOCUMENT_METHOD(declaration);
|
||||
|
||||
@@ -57,10 +57,7 @@ void GDScriptTextDocument::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("rename", "params"), &GDScriptTextDocument::rename);
|
||||
ClassDB::bind_method(D_METHOD("prepareRename", "params"), &GDScriptTextDocument::prepareRename);
|
||||
ClassDB::bind_method(D_METHOD("references", "params"), &GDScriptTextDocument::references);
|
||||
ClassDB::bind_method(D_METHOD("foldingRange", "params"), &GDScriptTextDocument::foldingRange);
|
||||
ClassDB::bind_method(D_METHOD("codeLens", "params"), &GDScriptTextDocument::codeLens);
|
||||
ClassDB::bind_method(D_METHOD("documentLink", "params"), &GDScriptTextDocument::documentLink);
|
||||
ClassDB::bind_method(D_METHOD("colorPresentation", "params"), &GDScriptTextDocument::colorPresentation);
|
||||
ClassDB::bind_method(D_METHOD("hover", "params"), &GDScriptTextDocument::hover);
|
||||
ClassDB::bind_method(D_METHOD("definition", "params"), &GDScriptTextDocument::definition);
|
||||
ClassDB::bind_method(D_METHOD("declaration", "params"), &GDScriptTextDocument::declaration);
|
||||
@@ -267,14 +264,6 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
|
||||
return item.to_json(true);
|
||||
}
|
||||
|
||||
Array GDScriptTextDocument::foldingRange(const Dictionary &p_params) {
|
||||
return Array();
|
||||
}
|
||||
|
||||
Array GDScriptTextDocument::codeLens(const Dictionary &p_params) {
|
||||
return Array();
|
||||
}
|
||||
|
||||
Array GDScriptTextDocument::documentLink(const Dictionary &p_params) {
|
||||
Array ret;
|
||||
|
||||
@@ -289,10 +278,6 @@ Array GDScriptTextDocument::documentLink(const Dictionary &p_params) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array GDScriptTextDocument::colorPresentation(const Dictionary &p_params) {
|
||||
return Array();
|
||||
}
|
||||
|
||||
Variant GDScriptTextDocument::hover(const Dictionary &p_params) {
|
||||
LSP::TextDocumentPositionParams params;
|
||||
params.load(p_params);
|
||||
|
||||
@@ -66,10 +66,7 @@ public:
|
||||
Dictionary rename(const Dictionary &p_params);
|
||||
Variant prepareRename(const Dictionary &p_params);
|
||||
Array references(const Dictionary &p_params);
|
||||
Array foldingRange(const Dictionary &p_params);
|
||||
Array codeLens(const Dictionary &p_params);
|
||||
Array documentLink(const Dictionary &p_params);
|
||||
Array colorPresentation(const Dictionary &p_params);
|
||||
Variant hover(const Dictionary &p_params);
|
||||
Array definition(const Dictionary &p_params);
|
||||
Variant declaration(const Dictionary &p_params);
|
||||
|
||||
@@ -513,22 +513,6 @@ struct SignatureHelpOptions {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Code Lens options.
|
||||
*/
|
||||
struct CodeLensOptions {
|
||||
/**
|
||||
* Code lens has a resolve provider as well.
|
||||
*/
|
||||
bool resolveProvider = false;
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary dict;
|
||||
dict["resolveProvider"] = resolveProvider;
|
||||
return dict;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Rename options
|
||||
*/
|
||||
@@ -593,24 +577,6 @@ struct SaveOptions {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Color provider options.
|
||||
*/
|
||||
struct ColorProviderOptions {
|
||||
Dictionary to_json() {
|
||||
return Dictionary();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Folding range provider options.
|
||||
*/
|
||||
struct FoldingRangeProviderOptions {
|
||||
Dictionary to_json() {
|
||||
return Dictionary();
|
||||
}
|
||||
};
|
||||
|
||||
struct TextDocumentSyncOptions {
|
||||
/**
|
||||
* Open and close notifications are sent to the server. If omitted open close notification should not
|
||||
@@ -1782,11 +1748,6 @@ struct ServerCapabilities {
|
||||
*/
|
||||
bool codeActionProvider = false;
|
||||
|
||||
/**
|
||||
* The server provides code lens.
|
||||
*/
|
||||
CodeLensOptions codeLensProvider;
|
||||
|
||||
/**
|
||||
* The server provides document formatting.
|
||||
*/
|
||||
@@ -1814,20 +1775,6 @@ struct ServerCapabilities {
|
||||
*/
|
||||
DocumentLinkOptions documentLinkProvider;
|
||||
|
||||
/**
|
||||
* The server provides color provider support.
|
||||
*
|
||||
* Since 3.6.0
|
||||
*/
|
||||
ColorProviderOptions colorProvider;
|
||||
|
||||
/**
|
||||
* The server provides folding provider support.
|
||||
*
|
||||
* Since 3.10.0
|
||||
*/
|
||||
FoldingRangeProviderOptions foldingRangeProvider;
|
||||
|
||||
/**
|
||||
* The server provides go to declaration support.
|
||||
*
|
||||
@@ -1847,12 +1794,9 @@ struct ServerCapabilities {
|
||||
signatureHelpProvider.triggerCharacters.push_back(",");
|
||||
signatureHelpProvider.triggerCharacters.push_back("(");
|
||||
dict["signatureHelpProvider"] = signatureHelpProvider.to_json();
|
||||
//dict["codeLensProvider"] = codeLensProvider.to_json();
|
||||
dict["documentOnTypeFormattingProvider"] = documentOnTypeFormattingProvider.to_json();
|
||||
dict["renameProvider"] = renameProvider.to_json();
|
||||
dict["documentLinkProvider"] = documentLinkProvider.to_json();
|
||||
dict["colorProvider"] = false; // colorProvider.to_json();
|
||||
dict["foldingRangeProvider"] = false; //foldingRangeProvider.to_json();
|
||||
dict["executeCommandProvider"] = executeCommandProvider.to_json();
|
||||
dict["hoverProvider"] = hoverProvider;
|
||||
dict["definitionProvider"] = definitionProvider;
|
||||
|
||||
Reference in New Issue
Block a user