Selection now includes the virtual and access modifier as part of their range for cxx base specifiers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Update FindTargets to fix symbol renaming on a CXXBaseSpecifier.
Add test to ensure rename wont trigger on a CXXBaseSpecifier.
clang-tools-extra/clangd/unittests/SelectionTests.cpp | ||
---|---|---|
272–283 | Is this good behaviour, or should Foo selection resolve as a RecordTypeLoc, That is the behaviour previously observed for these 2 cases. And instead have CXXBaseSpecifier as its parent selection? |
clang-tools-extra/clangd/Selection.cpp | ||
---|---|---|
496 | can we not use traverseNode here, rather than repeating? | |
clang-tools-extra/clangd/unittests/SelectionTests.cpp | ||
272–283 | Yes, this should be a typeloc with the CXXBaseSpecifier as its parent, unless there's a really compelling reason to make an exception. Two main reasons:
| |
clang/lib/AST/ASTTypeTraits.cpp | ||
196 | nice, thanks! |
clang-tools-extra/clangd/Selection.cpp | ||
---|---|---|
496 | Yeah, especially now I'm changing it to actually traverse :) | |
clang-tools-extra/clangd/unittests/SelectionTests.cpp | ||
272–283 | OK, funnily enough that change to find target was to fix renaming when the recordtypeloc was removed from the selection. That change will be redundant if i fix that, but do you still want it in here? | |
clang/lib/AST/ASTTypeTraits.cpp | ||
196 | Not really trivial as there is no matcher for cxxBaseSpecifier. Annoyingly its my fault there isn't one. |
(I don't see a new snapshot but LG with the traverseNode change)
clang-tools-extra/clangd/unittests/SelectionTests.cpp | ||
---|---|---|
272–283 | Up to you, but I'd lean towards keeping it and adding a FindTarget test for struct S : ^private T or so, which is the visible change. | |
clang/lib/AST/ASTTypeTraits.cpp | ||
196 | Oh, I've been down this rabbithole recently... clangd support for attrs -> DynTypedNode support for Attr -> matchers for use in tests -> matchers get complicated... Let's not block on this (and I need to revive my attr patch that got too big...) |
clang-tools-extra/clangd/unittests/SelectionTests.cpp | ||
---|---|---|
272–283 | I think I should remove it, then add it back in a follow up. It was needed to fix a issue in here that was then resolved in here. |
Remove FindTarget to instead add in a follow up patch.
Side note, Think I'll wait til after tomorrow to land this, unsure if the changes will break anything elsewhere.
can we not use traverseNode here, rather than repeating?