-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: remove the experimentalWorkspaceModule setting #55331
Comments
Change https://go.dev/cl/448116 mentions this issue: |
Hey there! Is there an alternative @findleyr? I really need this feature for working on monorepos and everything worked just fine over the last months of me using it. |
@ma-hartma yes, as the error message hopefully suggests, the alternative is to upgrade to Go 1.18 or later, and use a More info on go.work files here: |
…pendent This test is flaky, likely due to some race in the experimentalWorkspaceModule logic. Since we're about to delete support for that experimental feature, simply skip the test to stop the flakes. Leave the test as an artifact, as it will be deleted as part of the clean up of experimentalWorkspaceModule. No need to delete it before then. Updates golang/go#55331 Fixes golang/go#55923 Change-Id: Ic17485e42e335459df462af00a2088812ecfb5f4 Reviewed-on: https://go-review.googlesource.com/c/tools/+/448116 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Robert Findley <rfindley@google.com>
recommendation is to use go.work: golang/go#55331 (comment)
Change https://go.dev/cl/459635 mentions this issue: |
A View is defined by a Go environment along with a go.work file, go.mod file, or directory in GOPATH. When the environment changes via didChangeConfiguration, we recreate the View. Before this CL we didn't do the same when a view-defining go.mod or go.work was added or removed. Instead, we relied on workspace and snapshot invalidation to get us to the correct state. But since we reinitialize the view on these changes anyway there is little value in preserving any existing view state, and in fact doing so may lead to latent bugs. For example, deleting a go.work file caused the workspace to fall back to 'file system' mode, which may not be the same state that would result from restarting gopls. This change also moves us toward a model where we can have a dynamic set of views covering the full set of open files, not 1:1 with workspace folders. Also: - move the dirURI helper function to span.Dir, which is more discoverable - fix a bug where the wrong filter function was used to define the workspace - remove Session.optionsOverride, which was unused For golang/go#55331 Change-Id: Id108e848cdd942c34eda0a339d2c8a517c89c7de Reviewed-on: https://go-review.googlesource.com/c/tools/+/459635 TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Change https://go.dev/cl/459785 mentions this issue: |
Now that experimental workspace mode is deprecated, re-express tests that depended on this mode in terms of go.work files. For golang/go#55331 Change-Id: I90a876319321fd99982d13d258b7653c337f035a Reviewed-on: https://go-review.googlesource.com/c/tools/+/459785 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Change https://go.dev/cl/459789 mentions this issue: |
Change https://go.dev/cl/458116 mentions this issue: |
Tracking of workspace information in the View contained several inconsistencies and redundancies. Clean this up, with the following changes: - eliminate the View.rootURI, opting to derive it instead - eliminate the View.explicitGowork field, instead using the view.gowork field and checking if it is outside of the workspace. - eliminate many places where directory filters were interpreted relative to the rootURI. This is wrong: directory filters are expressed relative to the workspace folder. - remove special handling of GOMODCACHE, now that we're on Go 1.16+ - rewrite the locateTemplateFiles function to use view.filterFunc and filepath.WalkDir (now that we're on Go 1.16+). - don't request goimports env vars when loading environment variables for the view. They weren't being propagated to goimports anyway, and goimports will load them as needed. For golang/go#55331 Change-Id: I5e7f7e77e86d9ae425d2feaff31030278fed8240 Reviewed-on: https://go-review.googlesource.com/c/tools/+/459789 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
The experimental support for workspace module has been removed from gopls (as per golang/go#55331). This change removes the setting from govim as preparation before updating gopls to a version that doesn't support workspace module.
The experimental support for workspace module has been removed from gopls (as per golang/go#55331). This change removes the setting from govim as preparation before updating gopls to a version that doesn't support workspace module.
Tracking of workspace information in the View contained several inconsistencies and redundancies. Clean this up, with the following changes: - eliminate the View.rootURI, opting to derive it instead - eliminate the View.explicitGowork field, instead using the view.gowork field and checking if it is outside of the workspace. - eliminate many places where directory filters were interpreted relative to the rootURI. This is wrong: directory filters are expressed relative to the workspace folder. - remove special handling of GOMODCACHE, now that we're on Go 1.16+ - rewrite the locateTemplateFiles function to use view.filterFunc and filepath.WalkDir (now that we're on Go 1.16+). - don't request goimports env vars when loading environment variables for the view. They weren't being propagated to goimports anyway, and goimports will load them as needed. For golang/go#55331 Change-Id: I5e7f7e77e86d9ae425d2feaff31030278fed8240 Reviewed-on: https://go-review.googlesource.com/c/tools/+/459789 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
I am using the 1.20.2 version, still getting the suggestion- |
@harshitoshi the alternative is currently to use a go.work file https://go.dev/ref/mod#go-work-file. Shortly, we'll also support working on arbitrary modules as you open them: #57979. |
May I know why am I facing that issue. |
@harshitoshi I'm not sure I understand: you are getting this message because you set the "experimentalWorkspaceModule" setting. That setting is deprecated, and has been replaced by go workspaces. |
@findleyr please don't remove e.g.
|
How to remove the |
@gaisuke I'm not sure which LSP client you are using, so I don't know where settings are configured. |
A follow-up to #52897, this issue tracks removal of the "experimentalWorkspaceModule" gopls setting.
The text was updated successfully, but these errors were encountered: