Details
- Reviewers
sammccall jvikstrom - Commits
- rGb7ec41556b9c: [clangd] Add a hidden tweak to annotate all highlighting tokens of the file.
rL365130: [clangd] Add a hidden tweak to annotate all highlighting tokens of the file.
rCTE365130: [clangd] Add a hidden tweak to annotate all highlighting tokens of the file.
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp | ||
---|---|---|
15 ↗ | (On Diff #207801) | it would be nice to use the textmate class name rather than an arbitrary string here, it saves a level of indirection when verifying/debugging behavior |
48 ↗ | (On Diff #207801) | These operations are contextual, it would be nice to root at the selected node. You should be able to do (approximately) this by walking up to the next decl and using it as the traversal scope - don't forget to reset it afterwards! (This is a bit hacky and invalidates the parent map, but it's a debug tweak so it should be OK) |
address comments:
- emit textmate scope names
- rescope to the selected node rather than TU decl.
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp | ||
---|---|---|
16 ↗ | (On Diff #207996) | can we move this to SemanticHighlighting.h, and define getTextMateScopeLookupTable() in terms of it? It seems much more fundamental. |
53 ↗ | (On Diff #207996) | This needs a comment |
59 ↗ | (On Diff #207996) | nit: can you give the overridden traversal scope as narrow a scope as possible? (put it in a block, or just reset explicitly immediately afterwards?) I'm a little paranoid about this scope being reused. |