Index: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp @@ -337,6 +337,7 @@ 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 = Index: clang-tools-extra/trunk/clangd/Protocol.h =================================================================== --- clang-tools-extra/trunk/clangd/Protocol.h +++ clang-tools-extra/trunk/clangd/Protocol.h @@ -387,6 +387,11 @@ /// 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; Index: clang-tools-extra/trunk/clangd/Protocol.cpp =================================================================== --- clang-tools-extra/trunk/clangd/Protocol.cpp +++ clang-tools-extra/trunk/clangd/Protocol.cpp @@ -293,6 +293,8 @@ return false; } } + if (auto EditsNearCursor = Completion->getBoolean("editsNearCursor")) + R.CompletionFixes = *EditsNearCursor; } if (auto *CodeAction = TextDocument->getObject("codeAction")) { if (CodeAction->getObject("codeActionLiteralSupport"))