[PATCH] D71345: [clangd] Fall back to selecting token-before-cursor if token-after-cursor fails.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 13 07:38:43 PST 2019


sammccall added a comment.

In D71345#1783579 <https://reviews.llvm.org/D71345#1783579>, @nridge wrote:

> In D71345#1783092 <https://reviews.llvm.org/D71345#1783092>, @sammccall wrote:
>
> > (though personally I'd find it frustrating to have no way to target `b` in `a+b+c`).
>
>
> (For completeness, there is a way to target `b` in `a+b+c`: by selecting `b` (such that your selection range has length 1 rather than 0). Then, neither `+` node will enclose the selection range, but the `b` node will.)


Indeed, sorry - I meant that if we incorporated it into an LSP server, there'd be no way to target it in methods that take a position rather than a selection (go to defn, hover etc).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71345





More information about the cfe-commits mailing list