[PATCH] D38048: [clangd] Add textDocument/signatureHelp

Raoul Wols via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 14:40:51 PDT 2017


rwols marked an inline comment as done.
rwols added a comment.

Thinking ahead, it's probably best if we change the behavior of `SnippetCompletionItemCollector` as follows:

1. If it finds a callable, provide the name of the callable, followed by an opening parenthesis, followed by `$0`, followed by a closing parenthesis.
2. If it finds a code pattern, use the old behavior.

The point of (1) is that it should trigger textDocument/signatureHelp in the client immediately upon insertion of the completion. For example, if we have this function:

  int foo(int x, int y);

Then the `insertText` would be `foo($0)`. This causes the cursor to end up in-between the parentheses. Then it'll trigger textDocument/signatureHelp and that'll provide the parameter info.

The point of (2) is that we don't want to apply (1) for things like for-loop completions, or if-else constructs.


https://reviews.llvm.org/D38048





More information about the cfe-commits mailing list