Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Great! Needs some tests though :-)
clang-tools-extra/clangd/FindTarget.cpp | ||
---|---|---|
651 | Can you move these into some logical order? | |
651 | Can you add tests for these changes? | |
clang-tools-extra/clangd/SemanticHighlighting.cpp | ||
146 | nit: the quality is of the categorization (the "highlighting"), not the token. I'd suggest something like enum HighlightPriority { Dependent, Resolved } so that < does the obvious thing. | |
148 | nit: move the enum inside this function and return unsigned? No need to worry about names then, and represents that this is only used for prioritization. | |
157 | why a limit of 2, vs a loop? | |
208–209 | can we move this case into resolveConflict? | |
210 | out of curiosity, *why* is the same token being highlighted as dependentname and resolved? Is it being traversed twice? |
Address review comments
clang-tools-extra/clangd/SemanticHighlighting.cpp | ||
---|---|---|
157 | I'm not aware of a scenario where we'd get more than two conflicting highlightings, except when macros are involved in which case we don't have a good way to disambiguate anyways. | |
210 | It's for the reason you described in this comment: the resolved highlighting comes from findExplicitReferences(), and the dependent one form CollectExtraHighlightings. |
clang-tools-extra/clangd/SemanticHighlighting.cpp | ||
---|---|---|
210 | Oh yeah :-) |
clang-tools-extra/clangd/SemanticHighlighting.cpp | ||
---|---|---|
157 | I should've listened to you when you suggested a loop :) I overlooked the case where findExplicitReferences() contributes more than one candidate token because a dependent name is heuristically resolved to an overload set, in which case we get one target for each overload. Fixed in D121775. |
clang-tools-extra/clangd/SemanticHighlighting.cpp | ||
---|---|---|
157 | I think this is a good sign, my tendency is to borrow too many problems from the future anyway :-) |
clang-format-diff not found in user's PATH; not linting file.