[clang-tools-extra] 9d11e67 - [clangd] Use string[] for allCommitCharacters
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 26 08:08:35 PDT 2020
Author: Kirill Bobyrev
Date: 2020-08-26T17:08:19+02:00
New Revision: 9d11e6789c477ce6104e29745ca70e13c9fafeb0
URL: https://github.com/llvm/llvm-project/commit/9d11e6789c477ce6104e29745ca70e13c9fafeb0
DIFF: https://github.com/llvm/llvm-project/commit/9d11e6789c477ce6104e29745ca70e13c9fafeb0.diff
LOG: [clangd] Use string[] for allCommitCharacters
As per LSP specification, allCommitCharacters should be string[] instead of
string:
https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D86604
Added:
Modified:
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/test/initialize-params.test
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index 0408b0498488..15ef89cb34fa 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -592,7 +592,10 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
{"codeActionProvider", std::move(CodeActionProvider)},
{"completionProvider",
llvm::json::Object{
- {"allCommitCharacters", " \t()[]{}<>:;,+-/*%^&#?.=\"'|"},
+ {"allCommitCharacters",
+ {" ", "\t", "(", ")", "[", "]", "{", "}", "<",
+ ">", ":", ";", ",", "+", "-", "/", "*", "%",
+ "^", "&", "#", "?", ".", "=", "\"", "'", "|"}},
{"resolveProvider", false},
// We do extra checks, e.g. that > is part of ->.
{"triggerCharacters", {".", "<", ">", ":", "\"", "/"}},
diff --git a/clang-tools-extra/clangd/test/initialize-params.test b/clang-tools-extra/clangd/test/initialize-params.test
index f0a0f791c2f6..4125c27e4e35 100644
--- a/clang-tools-extra/clangd/test/initialize-params.test
+++ b/clang-tools-extra/clangd/test/initialize-params.test
@@ -7,7 +7,35 @@
# CHECK-NEXT: "capabilities": {
# CHECK-NEXT: "codeActionProvider": true,
# CHECK-NEXT: "completionProvider": {
-# CHECK-NEXT: "allCommitCharacters": " \t()[]{}<>:;,+-/*%^&#?.=\"'|",
+# CHECK-NEXT: "allCommitCharacters": [
+# CHECK-NEXT: " ",
+# CHECK-NEXT: "\t",
+# CHECK-NEXT: "(",
+# CHECK-NEXT: ")",
+# CHECK-NEXT: "[",
+# CHECK-NEXT: "]",
+# CHECK-NEXT: "{",
+# CHECK-NEXT: "}",
+# CHECK-NEXT: "<",
+# CHECK-NEXT: ">",
+# CHECK-NEXT: ":",
+# CHECK-NEXT: ";",
+# CHECK-NEXT: ",",
+# CHECK-NEXT: "+",
+# CHECK-NEXT: "-",
+# CHECK-NEXT: "/",
+# CHECK-NEXT: "*",
+# CHECK-NEXT: "%",
+# CHECK-NEXT: "^",
+# CHECK-NEXT: "&",
+# CHECK-NEXT: "#",
+# CHECK-NEXT: "?",
+# CHECK-NEXT: ".",
+# CHECK-NEXT: "=",
+# CHECK-NEXT: "\"",
+# CHECK-NEXT: "'",
+# CHECK-NEXT: "|"
+# CHECK-NEXT: ],
# CHECK-NEXT: "resolveProvider": false,
# CHECK-NEXT: "triggerCharacters": [
# CHECK-NEXT: ".",
More information about the cfe-commits
mailing list