[PATCH] D37101: [clangd] Add support for snippet completions

Raoul Wols via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 08:03:13 PDT 2017


rwols marked an inline comment as done.
rwols added inline comments.


================
Comment at: clangd/tool/ClangdMain.cpp:33
+                                   "present plaintext completions."),
+                    llvm::cl::init(false));
+
----------------
ilya-biryukov wrote:
> After putting some thought into it, let's disable snippets by default. Sorry for driving this in a wrong direction in my previous comments.
> Instead of using flag, LSP servers should look at initial `initialize` request and a value of `TextDocumentClientCapabilities.completion.completionItem.snippetSupport`.
> (see https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#initialize-request).
> And it seems bad from clangd side to break clients that don't support snippets **by default**. It's probably ok if user passed custom command-line arguments, overriding the defaults.
> 
> The problem is that we don't parse the `ClientCapabilities` now. It's not hard to add parsing of it, but that should probably be done in a separate commit and I can do this work if you want.
> I think it's fine to commit this as is, **defaulting to not return snippets**, and add parsing of `ClientCapabilities` with a follow-up commit.
Yes, I agree snippets should be enabled/disabled by reading the client's capabilities. This command line flag should be a temporary solution.


https://reviews.llvm.org/D37101





More information about the cfe-commits mailing list