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

x/tools/gopls: migrate gopls.mod functionality to go.work #44696

Closed
stamblerre opened this issue Feb 28, 2021 · 7 comments
Closed

x/tools/gopls: migrate gopls.mod functionality to go.work #44696

stamblerre opened this issue Feb 28, 2021 · 7 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. release-blocker Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@stamblerre
Copy link
Contributor

If we intend for people to check these files in, the paths should be relative.

@stamblerre stamblerre added this to the gopls/workspace-module milestone Feb 28, 2021
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 28, 2021
@stamblerre stamblerre added this to To Do in gopls on-deck Feb 28, 2021
@findleyr
Copy link
Contributor

This is going to be deprecated by the go.work proposal. Renaming appropriately.

@findleyr findleyr changed the title x/tools/gopls: use relative paths in on-disk gopls.mod file x/tools/gopls: migrate gopls.mod functionality to go.work Jun 28, 2021
@findleyr findleyr self-assigned this Jan 31, 2022
@gopherbot
Copy link

Change https://golang.org/cl/382078 mentions this issue: internal/lsp/cache: replace old go.work parser with x/mod

@gopherbot
Copy link

Change https://golang.org/cl/382114 mentions this issue: internal/lsp/cache: simplify workspace construction

@gopherbot
Copy link

Change https://golang.org/cl/382115 mentions this issue: internal/lsp/cache: fixes for workspace invalidation

@gopherbot
Copy link

Change https://golang.org/cl/382235 mentions this issue: gopls: remove the workspace_metadata command

@gopherbot
Copy link

Change https://golang.org/cl/382241 mentions this issue: internal/lsp/cache: use -workfile on 1.18

gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2022
Gopls was using an old version of workfile support in x/mod that did not
support the 'use' syntax.

Upgrade to x/mod@master, and update tests accordingly.

For golang/go#44696

Change-Id: I87841cd1322d7b1aa0fbc929838746ea600bee77
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382078
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2022
Remove some duplication in the construction of cache.workspace
instances.

For golang/go#44696

Change-Id: Ic955fa3f9a574781f627c550694f0b87ad2013e1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382114
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2022
This CL fixes a several bugs in workspace invalidation:
 - When invalidating the workspace due to a change in gopls.mod or
   go.work files, we should not update the workspace if the change does
   not parse. There was a comment to this effect, but it was not
   properly implemented.
 - Check go.work before gopls.mod, consistent with our intitial
   workspace load.
 - If we get an 'unchanged' change (such as a save) to go.work, don't
   continue looking for gopls.mod.

A regression test that inadvertently relied on our mishandling of broken
go.work files is updated to have the correct syntax. A new regtest
expectation is added to assert on a clean workspace.

For golang/go#44696

Change-Id: I2b7e739573e225cadfbf8cc892a0b5daf0191e40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382115
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2022
Remove the workspace_metadata command, as VS Code no longer needs this
to run workspace commands (it can use go.work instead).

Updates golang/go#44696

Change-Id: Ife579a15e64969c4301e4508e18b7c8a8b633b9f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382235
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2022
When using go 1.18 with go.work files, don't fake workspaces by creating
a workspace module: just run from the workspace root and pass -workfile.

For golang/go#44696

Change-Id: Iaa1979d26b1ce67c6e18e0bf26546a504069da8c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382241
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@findleyr
Copy link
Contributor

findleyr commented Feb 4, 2022

This is essentially done now. We have other issues for go.work support.

@findleyr findleyr closed this as completed Feb 4, 2022
gopls on-deck automation moved this from To Do to Done Feb 4, 2022
@findleyr findleyr modified the milestones: gopls/on-deck, gopls/v0.8.0 Feb 8, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. release-blocker Tools This label describes issues relating to any tools in the x/tools repository.
Projects
No open projects
Development

No branches or pull requests

3 participants