[PATCH] D106934: [clangd] Do not inlay hints pertaining to code in other files
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 30 06:48:35 PDT 2021
sammccall added inline comments.
================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:320
+ // file that was included after the preamble), do not show in that case.
+ if (AST.getSourceManager().getFileID(FileRange->getBegin()) != MainFileID)
+ return;
----------------
kadircet wrote:
> sammccall wrote:
> > nit: getSourceManager().isWrittenInMainFile(FileRange->getBegin())
> double nit: `isInsideMainFile(Loc, SM)`, I presume we would like to keep hints in preamble section as well (even though it is unlikely that we'll have any)
Yeah I did think about that too :-) I don't think we have any that can trigger there, and isInsideMainFile is more expensive.
I'm fine with either version though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106934/new/
https://reviews.llvm.org/D106934
More information about the cfe-commits
mailing list