-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gopls/internal/lsp: add selection range request #416
Conversation
This PR (HEAD: 7832f03) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/452315 to see it. Tip: You can toggle comments from me using the |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Alan Donovan: Patch Set 1: Code-Review+1 (7 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 1: (7 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
This PR (HEAD: dbbc1ca) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/452315 to see it. Tip: You can toggle comments from me using the |
Message from Robin Neatherway: Patch Set 1: (15 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Alan Donovan: Patch Set 3: Code-Review+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 3: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 3: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from kokoro: Patch Set 3: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Gopher Robot: Patch Set 3: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from kokoro: Patch Set 3: gopls-CI-1 Kokoro presubmit build finished with status: FAILURE Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
The previous commit misunderstood the interface defined by the LSP protocol. The input is now treated as an array of positions, and for each input position a hierarchy of ranges up to the AST root are returned.
This change follows from the previous commit.
dbbc1ca
to
0a11741
Compare
This PR (HEAD: 0a11741) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/452315 to see it. Tip: You can toggle comments from me using the |
Message from Robin Neatherway: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Robert Findley: Patch Set 4: Code-Review+2 Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from kokoro: Patch Set 4: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from kokoro: Patch Set 4: gopls-CI+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
Message from Gopher Robot: Patch Set 4: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/452315. |
selectionRange defines the textDocument/selectionRange feature, which, given a list of positions within a file, reports a linked list of enclosing syntactic blocks, innermost first. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_selectionRange. This feature can be used by a client to implement "expand selection" in a language-aware fashion. Multiple input positions are supported to allow for multiple cursors, and the entire path up to the whole document is returned for each cursor to avoid multiple round-trips when the user is likely to issue this command multiple times in quick succession. Fixes golang/go#36679 Change-Id: I4852db4b40be24b3dc13e4d9d9238c1a9ac5f824 GitHub-Last-Rev: 0a11741 GitHub-Pull-Request: #416 Reviewed-on: https://go-review.googlesource.com/c/tools/+/452315 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com>
This PR is being closed because golang.org/cl/452315 has been merged. |
selectionRange defines the textDocument/selectionRange feature,
which, given a list of positions within a file,
reports a linked list of enclosing syntactic blocks, innermost first.
See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_selectionRange.
This feature can be used by a client to implement "expand selection" in a
language-aware fashion. Multiple input positions are supported to allow
for multiple cursors, and the entire path up to the whole document is
returned for each cursor to avoid multiple round-trips when the user is
likely to issue this command multiple times in quick succession.
Fixes golang/go#36679