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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 02:36:20 PDT 2019

ilya-biryukov added a comment.

In D62389#1517844 <https://reviews.llvm.org/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 a, int b);
>   void call() {
>     fo^
>   }
> - before, the final cursor is at the end of the snippet
> - after, the final cursor is at the last parameter of `foo`.
>   I think the previous cursor location is more convenient (user can continue typing `;`).

Agree! The new behavior does not apply to function calls, they are not considered 'patterns' in the completion results.
I.e. in your examples we're still getting `foo(${1:int a}, ${2:int b})` and the cursor is placed at the end.

This is definitely worth a comment, I'll try to find a good place for it.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list