[PATCH] D131295: [clangd] Implement textDocument/codeLens

WangWei via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 17 04:45:31 PST 2022


lightmelodies added a comment.

In D131295#3933381 <https://reviews.llvm.org/D131295#3933381>, @Trass3r wrote:

> One remaining issue is multiple lenses for template code like
>
>   template <int V>
>   int i = 0;
>   
>   template int i<0>;
>   template int i<1>;
>   template int i<2>;
>   
>   template <int V>
>   struct Foo {
>       int foo(); // I see 3 codelenses here
>   };
>   
>   template struct Foo<0>;
>   template struct Foo<1>;
>   
>   int main()
>   {
>       // return Foo<0>().foo() + Foo<1>().foo();
>       // return i<0> + i<1> + i<2>;
>   }

Well, multiple lenses occured due to https://github.com/lightmelodies/llvm-project/blob/codelens/clang-tools-extra/clangd/FindSymbols.cpp#L500
And can be fixed by https://github.com/lightmelodies/llvm-project/blob/codelens/clang-tools-extra/clangd/CodeLens.cpp#L69


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131295



More information about the cfe-commits mailing list