This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Do not inlay hints pertaining to code in other files
ClosedPublic

Authored by nridge on Jul 27 2021, 11:00 PM.

Diff Detail

Event Timeline

nridge created this revision.Jul 27 2021, 11:00 PM
nridge requested review of this revision.Jul 27 2021, 11:00 PM
sammccall accepted this revision.Jul 30 2021, 5:11 AM
sammccall added inline comments.
clang-tools-extra/clangd/InlayHints.cpp
320

nit: getSourceManager().isWrittenInMainFile(FileRange->getBegin())

This revision is now accepted and ready to land.Jul 30 2021, 5:11 AM
kadircet added inline comments.Jul 30 2021, 5:28 AM
clang-tools-extra/clangd/InlayHints.cpp
320

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)

sammccall added inline comments.Jul 30 2021, 6:48 AM
clang-tools-extra/clangd/InlayHints.cpp
320

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.

nridge updated this revision to Diff 366552.Aug 15 2021, 10:57 PM

Address review comment

This revision was landed with ongoing or failed builds.Aug 15 2021, 10:58 PM
This revision was automatically updated to reflect the committed changes.