ilya-biryukov added inline comments.
================ Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:169 private: - void addTokenForTypedef(SourceLocation Loc, const TypedefNameDecl *TD) { - auto *TSI = TD->getTypeSourceInfo(); - if (!TSI) - return; - // Try to highlight as underlying type. - if (addType(Loc, TSI->getType().getTypePtrOrNull())) - return; - // Fallback to the typedef highlighting kind. - addToken(Loc, HighlightingKind::Typedef); - } - - bool addType(SourceLocation Loc, const Type *TP) { + llvm::Optional<HighlightingKind> kindForType(const Type *TP) { if (!TP) ---------------- hokein wrote: > how about moving out this method (and `kindForDecl`) of the class, they seem > to not depend on any fields of the class? Makes sense. Done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67341/new/ https://reviews.llvm.org/D67341 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits