[clangd] Add parantheses while auto-completing functions.
authorKadir Cetinkaya <kadircet@google.com>
Fri, 17 Aug 2018 15:42:54 +0000 (15:42 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Fri, 17 Aug 2018 15:42:54 +0000 (15:42 +0000)
commit6c9f15c533811937b51be1e1f8975fc54e18f40b
treeebae8c1be65d7b13314cc5c847f0bc63f09aedf4
parent2532ac880a3fec0b3282d18a00d54d27b1d5cb5a
[clangd] Add parantheses while auto-completing functions.

Summary:
Currently we only add parantheses to the functions if snippets are
enabled, which also inserts snippets for parameters into parantheses. Adding a
new option to put only parantheses. Also it moves the cursor within parantheses
or at the end of them by looking at whether completion item has any parameters
or not. Still requires snippets support on the client side.

Reviewers: ioeric, ilya-biryukov, hokein

Reviewed By: ioeric

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D50835

llvm-svn: 340040
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/CodeComplete.h
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp