internal/lsp: correct links provided in critical error pop-ups
Fixes golang/go#43600
Change-Id: Ib36b832652d20b542a3065544d41fee1f2ae3172
Reviewed-on: https://go-review.googlesource.com/c/tools/+/285515
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/gopls/doc/workspace.md b/gopls/doc/workspace.md
index c3ad8d3..ed30dae 100644
--- a/gopls/doc/workspace.md
+++ b/gopls/doc/workspace.md
@@ -19,10 +19,10 @@
### Multiple modules
-As of Jan 2020, if you are working with multiple modules, you will need to
-create a "workspace folder" for each module. This means that each module has
-its own scope, and features will not work across modules. We are currently
-working on addressing this limitation--see details about
+As of Jan 2021, if you are working with multiple modules or nested modules, you
+will need to create a "workspace folder" for each module. This means that each
+module has its own scope, and features will not work across modules. We are
+currently working on addressing this limitation--see details about
[experimental workspace module mode](#experimental-workspace-module-mode)
below.
diff --git a/internal/lsp/cache/load.go b/internal/lsp/cache/load.go
index fb328b8..41bc79d 100644
--- a/internal/lsp/cache/load.go
+++ b/internal/lsp/cache/load.go
@@ -203,8 +203,8 @@
if !s.ValidBuildConfiguration() {
msg := `gopls requires a module at the root of your workspace.
You can work with multiple modules by opening each one as a workspace folder.
-Improvements to this workflow will be coming soon (https://github.com/golang/go/issues/32394),
-and you can learn more here: https://github.com/golang/go/issues/36899.`
+Improvements to this workflow will be coming soon, and you can learn more here:
+https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.`
return &source.CriticalError{
MainError: errors.Errorf(msg),
ErrorList: s.applyCriticalErrorToFiles(ctx, msg, openFiles),
@@ -236,13 +236,15 @@
msg := fmt.Sprintf(`This file is in %s, which is a nested module in the %s module.
gopls currently requires one module per workspace folder.
Please open %s as a separate workspace folder.
-You can learn more here: https://github.com/golang/go/issues/36899.
+You can learn more here: https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.
`, modDir, filepath.Dir(rootModURI.Filename()), modDir)
srcErrs = append(srcErrs, s.applyCriticalErrorToFiles(ctx, msg, uris)...)
}
if len(srcErrs) != 0 {
return &source.CriticalError{
- MainError: errors.Errorf(`You are working in a nested module. Please open it as a separate workspace folder.`),
+ MainError: errors.Errorf(`You are working in a nested module.
+Please open it as a separate workspace folder. Learn more:
+https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.`),
ErrorList: srcErrs,
}
}