Previously TranslationUnitDecl would never be selected.
This means root() and commonAncestor() are now never null, and therefore changed
them to references.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/Selection.h | ||
---|---|---|
100 ↗ | (On Diff #211138) | I think it would be nice to mention "what means no selection" (TUDecl with partial)? And it seems that we are missing some documentation describing the selection tree behavior on the preprocessor elements e.g. #incl^ude, header guard. |
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp | ||
47 ↗ | (On Diff #211138) | we'll get a TUDecl if the whole file is selected, however this tweak doesn't want to traversal the whole TU (otherwise we will generate highlighting tokens for #included files), we only interested in the top level decls of the main file. |
clang-tools-extra/clangd/refactor/tweaks/DumpAST.cpp | ||
38 ↗ | (On Diff #211138) | Is the N->Parent intended? this seems like we'd exclude the TUDecl? |
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp | ||
---|---|---|
47 ↗ | (On Diff #211138) | Right! We discussed this further offline, and came to the conclusions that:
|
clang-tools-extra/clangd/refactor/tweaks/DumpAST.cpp | ||
38 ↗ | (On Diff #211138) | This is obsolete now, but was useful to flag: it's exactly the type of question that tweaks shouldn't have to worry about by default. |