[PATCH] D70727: [clangd] Keep go-to-definition working at the end of an identifier (fixes #194)

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 05:04:16 PST 2019


hokein added a comment.

In D70727#1760485 <https://reviews.llvm.org/D70727#1760485>, @nridge wrote:

> By the way, may I get permissions to assign issues to myself (and make other such metadata changes to issues) on github?


sure, we just sent you an invitation to the clangd org.



================
Comment at: clang-tools-extra/clangd/XRefs.cpp:153
+  // allowing go-to-definition to work at the end of an identifier.
+  if (Result.empty() && Offset > 0) {
+    Result = getDeclAtOffset(AST, Offset - 1, Relations);
----------------
this looks a hacky workaround, I assume it may introduce other regression issues. 

I think https://reviews.llvm.org/D70773 and https://reviews.llvm.org/D70807 should fix most annoying cases (function call). 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70727/new/

https://reviews.llvm.org/D70727





More information about the cfe-commits mailing list