The AST doesn't track their locations, and the default behavior of attributing
them to the lexically-enclosing node is sloppy and often inaccurate.
Also add a couple of passing test cases for declarators that weren't obvious.
Paths
| Differential D117185
[clangd] Ignore cvr-qualifiers in selection. ClosedPublic Authored by sammccall on Jan 12 2022, 11:03 PM.
Details
Summary The AST doesn't track their locations, and the default behavior of attributing Also add a couple of passing test cases for declarators that weren't obvious.
Diff Detail
Event TimelineHerald added subscribers: usaxena95, kadircet, arphaman. · View Herald TranscriptJan 12 2022, 11:03 PM This revision is now accepted and ready to land.Jan 13 2022, 5:35 AM Closed by commit rGfc7a9f36a923: [clangd] Ignore cvr-qualifiers in selection. (authored by sammccall). · Explain WhyJan 13 2022, 6:08 AM This revision was automatically updated to reflect the committed changes. sammccall marked an inline comment as done.
Revision Contents
Diff 399651 clang-tools-extra/clangd/Selection.cpp
clang-tools-extra/clangd/unittests/SelectionTests.cpp
|
Just a drive by comment. This looks like it should be refactored to a switch just to make it more readable. Or if syntax::Token supports isOneOf method like clang::Token.