[clangd] Show lambda signature for lambda autocompletions
authorKirill Bobyrev <kbobyrev@google.com>
Fri, 22 Nov 2019 11:48:06 +0000 (12:48 +0100)
committerKirill Bobyrev <kbobyrev@google.com>
Fri, 22 Nov 2019 11:48:06 +0000 (12:48 +0100)
commit7f0dcf665dd22be296805bc7a1c71a36243c4e09
treee7587448ef2ab88b426493594a12b50051d8097a
parent0b0dca9f6fe34333abdb437bd1d3d92c8362a2e6
[clangd] Show lambda signature for lambda autocompletions

The original bug report can be found
[here](https://github.com/clangd/clangd/issues/85)

Given the following code:

```c++
void function() {
  auto Lambda = [](int a, double &b) {return 1.f;};
  La^
}
```

Triggering the completion at `^` would show `(lambda)` before this patch
and would show signature `(int a, double &b) const`, build a snippet etc
with this patch.

Reviewers: sammccall

Reviewed by: sammccall

Differential revision: https://reviews.llvm.org/D70445
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang/lib/Sema/SemaCodeComplete.cpp
clang/test/CodeCompletion/function-templates.cpp
clang/test/CodeCompletion/lambdas.cpp