Skip to content

Commit 048cf06

Browse files
committed
Merge pull request godotengine#114533 from HolonProduction/rm-lsp-unused-endpoints
LSP: Remove boilerplate for some unimplemented methods
2 parents 6fde054 + 6b67863 commit 048cf06

5 files changed

Lines changed: 0 additions & 95 deletions

File tree

modules/gdscript/doc_classes/GDScriptTextDocument.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
<tutorials>
1010
</tutorials>
1111
<methods>
12-
<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.">
13-
<return type="Array" />
14-
<param index="0" name="params" type="Dictionary" />
15-
<description>
16-
</description>
17-
</method>
18-
<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.">
19-
<return type="Array" />
20-
<param index="0" name="params" type="Dictionary" />
21-
<description>
22-
</description>
23-
</method>
2412
<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.">
2513
<return type="Array" />
2614
<param index="0" name="params" type="Dictionary" />
@@ -75,12 +63,6 @@
7563
<description>
7664
</description>
7765
</method>
78-
<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.">
79-
<return type="Array" />
80-
<param index="0" name="params" type="Dictionary" />
81-
<description>
82-
</description>
83-
</method>
8466
<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.">
8567
<return type="Variant" />
8668
<param index="0" name="params" type="Dictionary" />

modules/gdscript/language_server/gdscript_language_protocol.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,7 @@ GDScriptLanguageProtocol::GDScriptLanguageProtocol() {
674674
SET_DOCUMENT_METHOD(rename);
675675
SET_DOCUMENT_METHOD(prepareRename);
676676
SET_DOCUMENT_METHOD(references);
677-
SET_DOCUMENT_METHOD(foldingRange);
678-
SET_DOCUMENT_METHOD(codeLens);
679677
SET_DOCUMENT_METHOD(documentLink);
680-
SET_DOCUMENT_METHOD(colorPresentation);
681678
SET_DOCUMENT_METHOD(hover);
682679
SET_DOCUMENT_METHOD(definition);
683680
SET_DOCUMENT_METHOD(declaration);

modules/gdscript/language_server/gdscript_text_document.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ void GDScriptTextDocument::_bind_methods() {
5757
ClassDB::bind_method(D_METHOD("rename", "params"), &GDScriptTextDocument::rename);
5858
ClassDB::bind_method(D_METHOD("prepareRename", "params"), &GDScriptTextDocument::prepareRename);
5959
ClassDB::bind_method(D_METHOD("references", "params"), &GDScriptTextDocument::references);
60-
ClassDB::bind_method(D_METHOD("foldingRange", "params"), &GDScriptTextDocument::foldingRange);
61-
ClassDB::bind_method(D_METHOD("codeLens", "params"), &GDScriptTextDocument::codeLens);
6260
ClassDB::bind_method(D_METHOD("documentLink", "params"), &GDScriptTextDocument::documentLink);
63-
ClassDB::bind_method(D_METHOD("colorPresentation", "params"), &GDScriptTextDocument::colorPresentation);
6461
ClassDB::bind_method(D_METHOD("hover", "params"), &GDScriptTextDocument::hover);
6562
ClassDB::bind_method(D_METHOD("definition", "params"), &GDScriptTextDocument::definition);
6663
ClassDB::bind_method(D_METHOD("declaration", "params"), &GDScriptTextDocument::declaration);
@@ -267,14 +264,6 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
267264
return item.to_json(true);
268265
}
269266

270-
Array GDScriptTextDocument::foldingRange(const Dictionary &p_params) {
271-
return Array();
272-
}
273-
274-
Array GDScriptTextDocument::codeLens(const Dictionary &p_params) {
275-
return Array();
276-
}
277-
278267
Array GDScriptTextDocument::documentLink(const Dictionary &p_params) {
279268
Array ret;
280269

@@ -289,10 +278,6 @@ Array GDScriptTextDocument::documentLink(const Dictionary &p_params) {
289278
return ret;
290279
}
291280

292-
Array GDScriptTextDocument::colorPresentation(const Dictionary &p_params) {
293-
return Array();
294-
}
295-
296281
Variant GDScriptTextDocument::hover(const Dictionary &p_params) {
297282
LSP::TextDocumentPositionParams params;
298283
params.load(p_params);

modules/gdscript/language_server/gdscript_text_document.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ class GDScriptTextDocument : public RefCounted {
6666
Dictionary rename(const Dictionary &p_params);
6767
Variant prepareRename(const Dictionary &p_params);
6868
Array references(const Dictionary &p_params);
69-
Array foldingRange(const Dictionary &p_params);
70-
Array codeLens(const Dictionary &p_params);
7169
Array documentLink(const Dictionary &p_params);
72-
Array colorPresentation(const Dictionary &p_params);
7370
Variant hover(const Dictionary &p_params);
7471
Array definition(const Dictionary &p_params);
7572
Variant declaration(const Dictionary &p_params);

modules/gdscript/language_server/godot_lsp.h

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -513,22 +513,6 @@ struct SignatureHelpOptions {
513513
}
514514
};
515515

516-
/**
517-
* Code Lens options.
518-
*/
519-
struct CodeLensOptions {
520-
/**
521-
* Code lens has a resolve provider as well.
522-
*/
523-
bool resolveProvider = false;
524-
525-
Dictionary to_json() {
526-
Dictionary dict;
527-
dict["resolveProvider"] = resolveProvider;
528-
return dict;
529-
}
530-
};
531-
532516
/**
533517
* Rename options
534518
*/
@@ -593,24 +577,6 @@ struct SaveOptions {
593577
}
594578
};
595579

596-
/**
597-
* Color provider options.
598-
*/
599-
struct ColorProviderOptions {
600-
Dictionary to_json() {
601-
return Dictionary();
602-
}
603-
};
604-
605-
/**
606-
* Folding range provider options.
607-
*/
608-
struct FoldingRangeProviderOptions {
609-
Dictionary to_json() {
610-
return Dictionary();
611-
}
612-
};
613-
614580
struct TextDocumentSyncOptions {
615581
/**
616582
* Open and close notifications are sent to the server. If omitted open close notification should not
@@ -1782,11 +1748,6 @@ struct ServerCapabilities {
17821748
*/
17831749
bool codeActionProvider = false;
17841750

1785-
/**
1786-
* The server provides code lens.
1787-
*/
1788-
CodeLensOptions codeLensProvider;
1789-
17901751
/**
17911752
* The server provides document formatting.
17921753
*/
@@ -1814,20 +1775,6 @@ struct ServerCapabilities {
18141775
*/
18151776
DocumentLinkOptions documentLinkProvider;
18161777

1817-
/**
1818-
* The server provides color provider support.
1819-
*
1820-
* Since 3.6.0
1821-
*/
1822-
ColorProviderOptions colorProvider;
1823-
1824-
/**
1825-
* The server provides folding provider support.
1826-
*
1827-
* Since 3.10.0
1828-
*/
1829-
FoldingRangeProviderOptions foldingRangeProvider;
1830-
18311778
/**
18321779
* The server provides go to declaration support.
18331780
*
@@ -1847,12 +1794,9 @@ struct ServerCapabilities {
18471794
signatureHelpProvider.triggerCharacters.push_back(",");
18481795
signatureHelpProvider.triggerCharacters.push_back("(");
18491796
dict["signatureHelpProvider"] = signatureHelpProvider.to_json();
1850-
//dict["codeLensProvider"] = codeLensProvider.to_json();
18511797
dict["documentOnTypeFormattingProvider"] = documentOnTypeFormattingProvider.to_json();
18521798
dict["renameProvider"] = renameProvider.to_json();
18531799
dict["documentLinkProvider"] = documentLinkProvider.to_json();
1854-
dict["colorProvider"] = false; // colorProvider.to_json();
1855-
dict["foldingRangeProvider"] = false; //foldingRangeProvider.to_json();
18561800
dict["executeCommandProvider"] = executeCommandProvider.to_json();
18571801
dict["hoverProvider"] = hoverProvider;
18581802
dict["definitionProvider"] = definitionProvider;

0 commit comments

Comments
 (0)