diff options
| -rw-r--r-- | clang-tools-extra/clangd/ClangdLSPServer.cpp | 1 | ||||
| -rw-r--r-- | clang-tools-extra/clangd/Protocol.cpp | 2 | ||||
| -rw-r--r-- | clang-tools-extra/clangd/Protocol.h | 5 | 
3 files changed, 8 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index c8aaaea8d42..f6796e1e792 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -337,6 +337,7 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,    applyConfiguration(Params.initializationOptions.ConfigSettings);    CCOpts.EnableSnippets = Params.capabilities.CompletionSnippets; +  CCOpts.IncludeFixIts = Params.capabilities.CompletionFixes;    DiagOpts.EmbedFixesInDiagnostics = Params.capabilities.DiagnosticFixes;    DiagOpts.SendDiagnosticCategory = Params.capabilities.DiagnosticCategory;    DiagOpts.EmitRelatedLocations = diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp index bd8d0328a5b..17d070a3f7b 100644 --- a/clang-tools-extra/clangd/Protocol.cpp +++ b/clang-tools-extra/clangd/Protocol.cpp @@ -293,6 +293,8 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R) {              return false;          }        } +      if (auto EditsNearCursor = Completion->getBoolean("editsNearCursor")) +        R.CompletionFixes = *EditsNearCursor;      }      if (auto *CodeAction = TextDocument->getObject("codeAction")) {        if (CodeAction->getObject("codeActionLiteralSupport")) diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index 00846b7a333..60772e9cb4b 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -387,6 +387,11 @@ struct ClientCapabilities {    /// textDocument.completion.completionItem.snippetSupport    bool CompletionSnippets = false; +  /// Client supports completions with additionalTextEdit near the cursor. +  /// This is a clangd extension. (LSP says this is for unrelated text only). +  /// textDocument.completion.editsNearCursor +  bool CompletionFixes = false; +    /// Client supports hierarchical document symbols.    bool HierarchicalDocumentSymbol = false;  | 

