[PATCH] D150635: [clangd] Implement end-definition-comment inlay hints
Qingyuan Zheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 25 20:00:47 PDT 2023
daiyousei-qz marked an inline comment as done.
daiyousei-qz added a comment.
Addressed the remaining comments. Thanks everyone for helping review and improve this patch!
================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:802
+ Position HintStart = sourceLocToPosition(SM, RBraceLoc);
+ Position HintEnd = {HintStart.line,
+ HintStart.character +
----------------
sammccall wrote:
> I'd prefer `sourceLocToPosition(SM, RBraceLoc.getLocationWithOffset(HintRangeText.size()))` which would avoids such low-level conversion between coordinate systems, and seems to perform just fine (we're going to hit SourceManager's caches).
>
> Will leave this up to you though.
Yeah, this is definitely clearer. Updated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150635/new/
https://reviews.llvm.org/D150635
More information about the cfe-commits
mailing list