Skip to content

Commit 9a104c0

Browse files
committed
[clangd] Add languages as server capabilities
This change adds a list of supported langauges as part of the server capabilities. This is related to a PR to add HLSL support to the clangd VSCode plugin (clangd/vscode-clangd#392). The review there requested advertising HLSL support as a server capability. Adding a general "languages" capability seemed more appropriate.
1 parent b0623fa commit 9a104c0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
623623
{"clangdInlayHintsProvider", true},
624624
{"inlayHintProvider", true},
625625
{"foldingRangeProvider", true},
626+
{"languages",
627+
{"c", "cpp", "cuda-cpp", "objective-c", "objective-cpp", "hlsl"}},
626628
};
627629

628630
{

clang-tools-extra/clangd/test/initialize-params.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
# CHECK-NEXT: "implementationProvider": true,
4949
# CHECK-NEXT: "inactiveRegionsProvider": true,
5050
# CHECK-NEXT: "inlayHintProvider": true,
51+
# CHECK-NEXT: "languages": [
52+
# CHECK-NEXT: "c",
53+
# CHECK-NEXT: "cpp",
54+
# CHECK-NEXT: "cuda-cpp",
55+
# CHECK-NEXT: "objective-c",
56+
# CHECK-NEXT: "objective-cpp",
57+
# CHECK-NEXT: "hlsl"
58+
# CHECK-NEXT: ],
5159
# CHECK-NEXT: "memoryUsageProvider": true,
5260
# CHECK-NEXT: "referencesProvider": true,
5361
# CHECK-NEXT: "renameProvider": true,

0 commit comments

Comments
 (0)