[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-28 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361841: [clangd] Place cursor better after completing patterns (authored by ibiryukov, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: htt

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62389/new/ https://reviews.llvm.org/D62389 ___

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62389#1518030 , @hokein wrote: > How about adding one more test in CodeCompleteTests.cpp, we already have a > snippet test there, and it seems more straightforward. Done! Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 201517. ilya-biryukov added a comment. - Add a code completion test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62389/new/ https://reviews.llvm.org/D62389 Files: clang-tools-extra/clangd/CodeComplete

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D62389#1517907 , @ilya-biryukov wrote: > In D62389#1517844 , @hokein wrote: > > > I'm not sure the new behavior suits all cases, it seems to me that this > > will change a typical behavi

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/CodeCompletionStrings.h:41 /// *Signature = "(size_type) const" -/// *Snippet = "(${0:size_type})" +/// *Snippet = "(${1:size_type})" /// If set, Requ

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D62389#1517844 , @hokein wrote: > I'm not sure the new behavior suits all cases, it seems to me that this will > change a typical behavior (usually when users invoke function calls). > > Imaging a case: > > void foo(int

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I'm not sure the new behavior suits all cases, it seems to me that this will change a typical behavior (usually when users invoke function calls). Imaging a case: void foo(int a, int b); void call() { fo^ } - before, the final cursor is at the end of the

[PATCH] D62389: [clangd] Place cursor better after completing patterns

2019-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: hokein. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. By producing the $0 marker in the snippets at the last placeholder. This produces nicer results in most cases, e.g. for nam