forked from OSchip/llvm-project
[clangd] Add add commit characters to the server capabilities
Summary: Make it more convinient for the clients to select completion items by providing a set of default characters (punctuation). Related issue: https://github.com/clangd/clangd/issues/284 Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74606
This commit is contained in:
parent
0dbc4658d8
commit
2a095ff6f5
|
@ -559,6 +559,7 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
|
|||
{"codeActionProvider", std::move(CodeActionProvider)},
|
||||
{"completionProvider",
|
||||
llvm::json::Object{
|
||||
{"allCommitCharacters", " \t()[]{}<>:;,+-/*%^&#?.=\"'|"},
|
||||
{"resolveProvider", false},
|
||||
// We do extra checks for '>' and ':' in completion to only
|
||||
// trigger on '->' and '::'.
|
||||
|
|
|
@ -1101,6 +1101,8 @@ struct CompletionItem {
|
|||
/// the client side.
|
||||
float score = 0.f;
|
||||
|
||||
// TODO: Add custom commitCharacters for some of the completion items. For
|
||||
// example, it makes sense to use () only for the functions.
|
||||
// TODO(krasimir): The following optional fields defined by the language
|
||||
// server protocol are unsupported:
|
||||
//
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# CHECK-NEXT: "capabilities": {
|
||||
# CHECK-NEXT: "codeActionProvider": true,
|
||||
# CHECK-NEXT: "completionProvider": {
|
||||
# CHECK-NEXT: "allCommitCharacters": " \t()[]{}<>:;,+-/*%^&#?.=\"",
|
||||
# CHECK-NEXT: "resolveProvider": false,
|
||||
# CHECK-NEXT: "triggerCharacters": [
|
||||
# CHECK-NEXT: ".",
|
||||
|
|
Loading…
Reference in New Issue