Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

rneatherway
Copy link
Contributor

@rneatherway rneatherway commented Nov 20, 2022

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

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Robert Findley:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Robert Findley:

Patch Set 1:

(7 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Robin Neatherway:

Patch Set 1:

(15 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Robert Findley:

Patch Set 3: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 3:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/bd1f705e-5dc1-4b73-b16d-dec87e0c3ca9


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 3: gopls-CI-1

Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/bd1f705e-5dc1-4b73-b16d-dec87e0c3ca9


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Robert Findley:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

rneatherway and others added 4 commits December 13, 2022 10:19
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.
@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Robin Neatherway:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 4:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/44281323-421e-4dd1-a0aa-543a54f0d024


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 4: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/44281323-421e-4dd1-a0aa-543a54f0d024


Please don’t reply on this GitHub thread. Visit golang.org/cl/452315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Dec 13, 2022
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>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/452315 has been merged.

@gopherbot gopherbot closed this Dec 13, 2022
@rneatherway rneatherway deleted the selectionrange branch January 27, 2023 11:07
xieyuschen added a commit to xieyuschen/tools that referenced this pull request Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/tools/gopls: support selection range request
2 participants