ilya-biryukov added a comment.

This looks like a useful change even without prior changes to VSCode.

Maybe add a command-line flag to clangd(`--enable-snippets`) and commit that?
When snippets are disabled, we could simply do `insertText =  /*<item name>*/` 
after `ProcessChunks`, we will deprecate and remove that flag eventually when 
all the clients support it.



================
Comment at: clangd/ClangdUnit.cpp:337
+    // Fill in the kind field of the CompletionItem.
+    Item.kind = getKind(Result.CursorKind);
+
----------------
Could we also set `Item.filterText` to completion item name?
So that various pieces of function signature would not match on user input.


================
Comment at: clangd/ClangdUnit.cpp:419
+        assert(item.detail.empty() && "Unexpected extraneous CK_ResultType");
+        Item.detail = Chunk.Text;
+        break;
----------------
Won't that assertion fail with function return types? Let's add a test for that.

```
int (*foo(int a))(float);
```


https://reviews.llvm.org/D37101



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to