[PATCH] D55994: [clangd] Check preceding char when completion triggers on ':' or '>'

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 01:43:25 PST 2019


ilya-biryukov added a comment.

In D55994#1343669 <https://reviews.llvm.org/D55994#1343669>, @jkorous wrote:

> This looks like a work around LSP imperfection indeed.


Totally.

> Are you going to push for change in LSP? Something like `CompletionOptions/triggerCharacters` -> `CompletionOptions/triggerStrings`?

This would workaround this particular problem, but I don't expect the `triggerStrings` to cover all the use-cases we care about in the long-term.
A few examples that need semantic knowledge:

- Auto-completions inside a comment

  int test() {
    std::^ // <-- should trigger here
    // std::^ <-- this is inside a comment, should shouldn't trigger here as clang won't provide any useful results anyway.
  }

- Trailing return types

  auto foo() ->^ int {}// <-- should not trigger here


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55994/new/

https://reviews.llvm.org/D55994





More information about the cfe-commits mailing list