-
Notifications
You must be signed in to change notification settings - Fork 760
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
tools: replace go-outline
with gopls
#1020
Comments
Any update on this one? Can we drop go-outline already if we use |
Would be great to see this one fixed. go-outline doesn't seem to be actively maintained and VS Code has a hard time installing it in some cases: ramya-rao-a/go-outline#15 |
Gopls issue golang/go#40514 was closed but instead of implementing a variation of |
Change https://go.dev/cl/384574 mentions this issue: |
This change replaces the use of go-outline with gopls when available. This is done by fixing up the results from gopls to resemble those returned by go-outline to avoid having to handle these document symbols differently in various places. Also sets the testing gopls version to pre release. Updates #1020 Change-Id: Ib3ce4fe04c3ffe9428f6701ffaa24dd8444781c0 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/384574 Trust: Suzy Mueller <suzmue@golang.org> Run-TryBot: Suzy Mueller <suzmue@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://go.dev/cl/386218 mentions this issue: |
In order to get the correct location of the package declaration we can use a regexp as a close heuristic. Updates #1020 Change-Id: I12a6fe296cf72ec5a331d7e2b70a5050d0882e63 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/386218 Trust: Suzy Mueller <suzmue@golang.org> Run-TryBot: Suzy Mueller <suzmue@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://go.dev/cl/387962 mentions this issue: |
This change makes goImport and goOutline to inspect goLanguageServer's serverInfo and see if the necessary commands are available in gopls. If not, fall back to the legacy providers. For #1020 Change-Id: I061be2bf5479273141968d80a63b1f1f3019e9c4 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/387962 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Suzy Mueller <suzmue@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
@suzmue Are we ready to close this? |
@hyangah I think we can close this. There is more work we can do to clean up the code when we remove the go-outline code path, but that can be a separate issue. |
Hello all, first thanks for your work. Can we now expect gopls to fullfill the role of Go-outline? |
Change https://go.dev/cl/389716 mentions this issue: |
Change https://go.dev/cl/389994 mentions this issue: |
In the next release we will attempt to use gopls if available, but will still recommend installing go-outline as a fallback. |
…nt symbol Gopls's document symbol provider classifies methods correctly, while `go-outline`-based document symbol provider marks them as "function". The difference caused regression after change for #1020. Fixes #2091 Change-Id: I1b92753132be26b528f994ae42af32c723dd7ce2 GitHub-Last-Rev: 6483108 GitHub-Pull-Request: #2090 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/389994 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Suzy Mueller <suzmue@golang.org>
Change https://go.dev/cl/398155 mentions this issue: |
Providers and commands are not registered until language server configuration is done. For #1020 For #1878 Change-Id: I2f20dee6f2b4d73ff0adc841a540bb0cf9e99b7c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/398155 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change https://go.dev/cl/400360 mentions this issue: |
go-outline
is no longer used for outline view when language server is enabled.However, it's still being used by
GoDocumentSymbolProvider
that is used forThey can be replaced with gopls's implementation
LanguageClient.getFeatures("textDocument/documentSymbol")
or with a direct invocation ofvscode.commands.executeCommand('vscode.executeDocumentSymbolProvider', ...)
.One difference between the gopls's document symbol provider and
GoDocumentSymbolProvider
isgopls
version doesn't provide the file's package name info, so we need a different way to find the package name if the info is necessary. See golang/go#40514.The text was updated successfully, but these errors were encountered: