sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land.
Thanks! ================ Comment at: clang-tools-extra/clangd/Selection.cpp:530 SourceRange S = N.getSourceRange(); + if (auto *TL = N.get<TypeLoc>()) { + // DecltypeTypeLoc only contains the SourceRange for `decltype` keyword. ---------------- Alternately, we could just always return false if it's a DecltypeTypeLoc. ================ Comment at: clang-tools-extra/clangd/Selection.cpp:531 + if (auto *TL = N.get<TypeLoc>()) { + // DecltypeTypeLoc only contains the SourceRange for `decltype` keyword. + // We are extending the SourceRange up until the end of the expression ---------------- I think this comment could be a little clearer on the three ranges, and that the AST one is just incorrect. e.g. ``` // DeclTypeTypeLoc::getSourceRange() is incomplete, which would lead to failing // to descend into the child expression. // decltype(2+2); // XXXXXXXXXXXXX <-- correct range // XXXXXXXX <-- range reported by getSourceRange() // XXXXXXXXXXXX <-- range with this hack ``` ================ Comment at: clang-tools-extra/clangd/Selection.cpp:534 + // inside decltype. Note that this will not include the closing + // parenthese. + // FIXME: Alter DecltypeTypeLoc to contain parentheses locations and get ---------------- nit: parenthesis Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72594/new/ https://reviews.llvm.org/D72594 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits