[PATCH] D75479: [clangd] go-to-def on names in comments etc that are used nearby.

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 16:58:38 PST 2020


nridge added a comment.

Here's a test case that gives a less desirable result with this approach than D72874 <https://reviews.llvm.org/D72874>:

  struct Foo {
    void uniqueMethodName();
  };
  struct Bar {
    void uniqueMethodName();
  };
  
  // Will call u^niqueMethodName() on t.
  template <typename T>
  void f(T t);

This method only returns `Bar::uniqueMethodName()` because it's closer in terms of distance, whereas D72874 <https://reviews.llvm.org/D72874> returns both methods.

Is that perhaps a reason to adjust the order in which we try the approaches (i.e. use this one as a fallback if index lookup fails)? Or should we try to allow multiple results with this approach as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75479





More information about the cfe-commits mailing list