Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

lightmelodies (WangWei)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 22 2020, 2:16 AM (148 w, 2 d)

Recent Activity

Nov 21 2022

lightmelodies added a comment to D131295: [clangd] Implement textDocument/codeLens.
Nov 21 2022, 6:19 PM · Restricted Project, Restricted Project

Nov 17 2022

lightmelodies added a comment to D131295: [clangd] Implement textDocument/codeLens.

Thanks, it seems to fix the base case, but I still see multiple lenses when I add

template <int V>
int Foo<V>::foo()
{
    return 0;
}
Nov 17 2022, 6:40 PM · Restricted Project, Restricted Project
lightmelodies added a comment to D131295: [clangd] Implement textDocument/codeLens.

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

Nov 17 2022, 4:45 AM · Restricted Project, Restricted Project

Feb 18 2021

lightmelodies added a comment to D96751: [clangd] Populate detail field in document symbols.

Fantastic, thank you!

Feb 18 2021, 7:37 AM · Restricted Project, Restricted Project
lightmelodies added a comment to D96751: [clangd] Populate detail field in document symbols.

Nice! This looks good to land as-is, I just have some suggestions where we may want to mark behavior to revisit later, and some places where we could trim the tests a bit.

Do you have commit access, or want me to land this for you? (I'd need an address for the commit)

Feb 18 2021, 7:31 AM · Restricted Project, Restricted Project
lightmelodies updated the diff for D96751: [clangd] Populate detail field in document symbols.

Better printing for C++ constructor and destructor. Remove unnecessary test cases.

Feb 18 2021, 7:27 AM · Restricted Project, Restricted Project
lightmelodies updated the diff for D96751: [clangd] Populate detail field in document symbols.
Feb 18 2021, 4:39 AM · Restricted Project, Restricted Project
lightmelodies updated the diff for D96751: [clangd] Populate detail field in document symbols.

Change behavior of template and add unit tests.

Feb 18 2021, 3:19 AM · Restricted Project, Restricted Project

Feb 16 2021

lightmelodies added a comment to D96751: [clangd] Populate detail field in document symbols.

Thanks for your response. Yes decl is too verbose in many cases. In fact I have tried another concise version, but I can not decide which one is better. Unit test in FindSymbolsTests.cpp is also done, but I would like upload them after we reach an agreement on what behavior is prefered.

Feb 16 2021, 5:58 PM · Restricted Project, Restricted Project
lightmelodies updated the diff for D96751: [clangd] Populate detail field in document symbols.
Feb 16 2021, 5:57 PM · Restricted Project, Restricted Project

Feb 15 2021

lightmelodies requested review of D96751: [clangd] Populate detail field in document symbols.
Feb 15 2021, 10:17 PM · Restricted Project, Restricted Project

Nov 26 2020

lightmelodies added a comment to D91930: [clangd] Implement textDocument/codeLens.

I have also considered these problems, and here is some points of my view.
Latency
Consider llvm-project itself, textDocument/codeLens can be done in <500ms generally and <100ms if collect hierarchy is disabled in my notebook. Latency is significant in some rare case like Type.h which has too complex hierarchy relations. Meanwhile, vscode is smart to remember previous codelens's positions so the text rendering will not look too weird during long-time request. In fact, the biggest performance issue I find is that building AST when open a new file costs too much time, which makes textDocument/codeLens quite slow, as well as other action such as textDocument/documentSymbols. That's why I modified ClangdLSPServer.cpp to keep AST for recent closed files.

fileline countcostcost (without hierarchy)
ASTVector.h4114ms1ms
APValue.h69316 ms8ms
Decl.h4599213 ms40 ms
Expr.h6383447 ms61 ms
Type.h72223765 ms47 ms
Nov 26 2020, 7:42 AM · Restricted Project, Restricted Project

Nov 23 2020

lightmelodies updated the summary of D91930: [clangd] Implement textDocument/codeLens.
Nov 23 2020, 10:29 PM · Restricted Project, Restricted Project
lightmelodies added a comment to D91930: [clangd] Implement textDocument/codeLens.

Thanks a lot for working on improving clangd!

Can you also give a high-level overview of what kind of functionality you are providing here? Looks like there's a lot going on here, and it would be nice to know what you are attempting to do, rather than inferring that from the code. It would also help future travellers, as they can just read the description rather than going through the whole patch.

Nov 23 2020, 10:27 PM · Restricted Project, Restricted Project
lightmelodies updated the summary of D91930: [clangd] Implement textDocument/codeLens.
Nov 23 2020, 10:25 PM · Restricted Project, Restricted Project

Nov 22 2020

lightmelodies set the repository for D91930: [clangd] Implement textDocument/codeLens to rG LLVM Github Monorepo.
Nov 22 2020, 7:11 AM · Restricted Project, Restricted Project
lightmelodies updated the diff for D91930: [clangd] Implement textDocument/codeLens.
Nov 22 2020, 7:06 AM · Restricted Project, Restricted Project
lightmelodies set the repository for D91930: [clangd] Implement textDocument/codeLens to rG LLVM Github Monorepo.
Nov 22 2020, 6:34 AM · Restricted Project, Restricted Project
lightmelodies updated the diff for D91930: [clangd] Implement textDocument/codeLens.
Nov 22 2020, 6:19 AM · Restricted Project, Restricted Project
lightmelodies updated the summary of D91930: [clangd] Implement textDocument/codeLens.
Nov 22 2020, 6:09 AM · Restricted Project, Restricted Project
lightmelodies updated the summary of D91930: [clangd] Implement textDocument/codeLens.
Nov 22 2020, 5:43 AM · Restricted Project, Restricted Project
lightmelodies requested review of D91930: [clangd] Implement textDocument/codeLens.
Nov 22 2020, 5:32 AM · Restricted Project, Restricted Project