Pending CL 426477 changes go/types error messages containing the phrase:
type parameters require
to:
type parameter requires
Adjust diagnostics test accordingly (note that regular expressions are
currently not supported).
For golang/go#54511.
Change-Id: I561cb940a41cb6cc949c44e0d4b8f009336a46cd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/427736
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
CL 425716 changes parser behavior for incorrect code (it is more
lenient) which breaks a few lsp tests. Disable them for now so we
can submit CL 425716.
For golang/go#54511.
For golang/go#54822.
Change-Id: I00fa67e29628137f3e4e44c38e92094ea581a61b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/427654
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Add functions to the output when hovering over a type.
Fixesgolang/go#54008
Change-Id: Ia0a7b5a878c3d63c4bbc549f003c45592db1c135
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420714
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This change prevents analysis from running on a package containing
any kind of error unless the analyzer has indicated that it is robust.
This is presumed to be the cause of several panics in production.
And a test.
Updates golang/go#54762
Change-Id: I9327e18ef8d7773c943ea45fc786991188358131
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426803
Run-TryBot: Alan Donovan <adonovan@google.com>
Auto-Submit: 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>
This is a follow-up on CL 425497. Must be submitted after CL 425007.
For golang/go#54511.
Change-Id: Ice9c1c62b911efa8efa20ea295bf313aabe8c5bb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425594
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
While moving internal/lsp to gopls/internal/lsp, we discovered that
we're bumping up against a command line length limit on windows. Use an
arbitrary shorter module path to avoid this, for now.
Updates golang/go#54800
Updates golang/go#54509
Change-Id: I7be07da29a769c1ce7c31cbbd374ca47b0944132
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426801
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
In several places throughout the x/tools codebase, the internal/lsp/diff
package is used to provide clearer test output when comparing large,
multi-line strings. In some places, this is implemented via the
tests.Diff helper function, but in others it is not (presumably due to
import cycles).
Factor out this pattern into a diff.Pretty function, and add commentary.
Also remove the *testing.T argument, as diffs should never fail; opt to
panic instead. Also add a test.
Using this function, simplify the logic to comparing our 1.18 markdown
output with 1.19 golden content, by normalizing differences between the
two.
This is necessary as markdown content will change as a result of moving
internal/lsp to gopls/internal/lsp.
For golang/go#54509
Change-Id: Ie1fea1091bbbeb49e00c4efa7e02707cafa415cc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426776
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
This method does not in fact report whether the package is ill-typed.
It actually reports whether any of three fields of pkg are nil.
They never are.
This does rather explain why type-error analyzers are executed
on (genuinely) ill-typed packages, despite the !IllTyped()
condition. And why analyzers that aren't prepared to handle
ill-typed code (!RunDespiteErrors) sometimes crash in production.
Updates golang/go#54762
Change-Id: I95421584bec68fb849b5ed52cc4e6d9b6bb679be
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426802
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
This change consolidates the logic of the memoized function
for analysis (previously split across execAll and runAnalysis)
to make the error control flow clearer. The new function,
actionImpl, follows the same conventions as in other memoized
functions.
Errors from await (e.g. cancellation) are now separate from
errors from analysis itself. Only the latter are now ignored
in the diagnostics loop over the roots.
Also, where previously the recursion would ignore failed
dependencies (proceeding to call runAnalysis even after
seeing an &actionData{err!=nil}), now the recursion aborts
if one of the prerequisites fails, as it should.
The only edges currently enabled are "horizontal" (inputs,
not facts). This would explain the crash in golang/go#54798,
in which the result of the nspector pass was not available
to the structtag pass.
Also:
- merge the loops over deps in execAll and runAnalysis.
- remove unnecessary checks for context cancellation in
loops of pure computation.
- don't suppress errors from awaitPromise.
- add commentary.
- turn two "can't happen" errors into panics.
- remove unnecessary logging of analysis failures.
Fixesgolang/go#54798
Change-Id: Iefb42d2d074a31f2f717dc94c38aed7f1dab1c80
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426800
Auto-Submit: Alan Donovan <adonovan@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
In the presence of type errors, TypeOf may return nil, and this appears
to have contributed to a crash in the fillreturns analysis. I haven't
been able to find or deduce a test case, but this change makes the logic
more defensive.
Also remove a stale pre-go1.17 test that used to trigger a panic
(the one fixed here? unclear) to assert that panics were recoverable.
Updates golang/go#54655
Change-Id: Ic9ca9a307eede50a2d4db6424822a155dd43e635
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426019
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
As a nice side effect, make it easier to migrate internal/lsp/ to
gopls/internal/lsp.
For golang/go#54509
Change-Id: Ib541c08426f1f1d1e2a42b2d1cab47eab96dc092
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426775
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run reset_golden.sh, so that our golden files are stable. This will be
useful later, when we migrate internal/lsp to gopls/internal/lsp, and
golden files must be updated to account for changing offsets.
For golang/go#54509
Change-Id: I2e9a8d3493d64d632b9f0f0e0360d633803f9d92
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426797
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
The diagnostics emitted by the Go toolchain vary from one
release to the next, and the gopls tests run against multiple
versions. Therefore our tests need a way to express multiple
possibilities in their expectations. This change interprets
the patterns in @diag test annotations as regular expressions,
allowing some flexibility in recognizing both old and new
messages. It's not a panacea but it is one step to reducing
the considerable friction of making changes to the compiler
or go/types in the main tree.
Details:
- Factor the three implementations of the Tests.Diagnostics
abstract method so that they all use DiffDiagnostics
to report differences, substantially rewriting one of them.
- Move the "no_diagnostics" hack, of which there were three
copies, not all consistent, into DiffDiagnostics.
- Eliminate the named type for each tests.Data field;
a type alias is all that's needed.
- Add Diagnostics.String method.
- Add various TODOs for further improvements.
- Add various apparently missing Fatal statements within
the tests.
Change-Id: Id38ad72a851b551dd4eb1d8c021bcb8adbb2213f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425956
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
This is a simple revert of CL 425497, which disabled the tests.
The problem was due to a misencoded FMOVD instruction causing
some 0.0 constants to compile to nonzero; fixed by CL 425188.
Updates golang/go#54655
Updates golang/go#425188
Change-Id: I2231b57b7b78ac1ae2e8b60cda62898ea7122cda
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426017
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
The Check for upgrades codelens was only looking for upgrades for
the current module, but was applying diagnostics to all go.mod
files in the workspace. This change makes sure to only apply the
diagnostics in the same selected go.mod.
Fixesgolang/go#54556
Change-Id: I1eacbc8af2e9dcfe1e1a67516f047bcb94099872
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425195
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
This change ensures that the End position provided to span.NewRange
in suggestedAnalysisFixes is valid even when the diagnostic has
only a valid start position. This seems to be the cause of
some panics observed in the ARM builders in the attached issue.
Also, reduce the scope of the recover operation to just the analyzer's
run method: we don't want to hide further bugs (or discard stack traces)
in the setup or postprocessing logic.
Also:
- split a single assertion in span.NewRange into two.
- Add information to various error messages to help identify causes.
- Add TODO comments about inconsistent treatment of token.File
in span.FileSpan, and temporarily remove bug.Errorf that
is obviously reachable from valid inputs.
- Add TODO to fix another panic in an analyzer that is covered
by our tests but was hitherto suppressed.
- Add TODO to use bug.Errorf after recover to prevent recurrences.
We can't do that until the previous panic is fixed.
Updates https://github.com/golang/go/issues/54655
Change-Id: I0576d03fcfffe0c8df157cf6c6520c9d402f8803
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425356
Run-TryBot: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
This is a stopgap until I can diagnost the problem, but in the meantime
we need to fix the builders.
Updates https://github.com/golang/go/issues/54655
Change-Id: I6260828e8c07e3121c45f99166a26d51aa9805a4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425575
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tim King <taking@google.com>
This will allow us to submit CL 425007 after which we can re-enable
this code and adjust the error accordingly.
For golang/go#54511.
Change-Id: I2861a8f372bce214824d7cbdffad6abf7ca4a58e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425497
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Port of CL 425360 and CL 425365 from stdlib importer to x/tools.
Fixesgolang/go#54653.
Change-Id: Ib475f715ae70400e3ebfb91d6b7755d8e1ddee37
Reviewed-on: https://go-review.googlesource.com/c/tools/+/425362
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Go 1.19 introduced new formatting for doc comments, and a new package
for processing them. This change uses the new package when gopls is
compiled with go 1.19 or later.
The difficulty is with the hover tests, which have to work both when
gopls is compiled with earlier versions of go, and with go 1.19.
Fortunately the changes in formatting the test cases are easily checked.
Fixesgolang/go#54260
Change-Id: I9e8e7f0cf3392afa0865b5d3f4e5fcdd88dfe75f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421502
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
CL 417576 externalized shouldLoad tracking into a map, which was used to
trigger a reload and cleared once reload completes. Unfortunately, it
overlooked the fact that we may also reload the entire workspace (via
reinitialization). In this case, we should clear newly loaded IDs from
the shouldLoad map, so that they are not subsequently loaded again.
Fixesgolang/go#54473
Change-Id: I26f49552cae502644142dc4a4e946294db37f6f7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/424074
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
This logic is now in x/website.
Delete from here to avoid confusion.
Change-Id: Iec8efaa3490fa471a4ebd7e1fb34b4927a39062d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/301309
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
- ignore error from buildPackageHandle, with rationale.
- remove unnessary optimization in call to Clone(updates={}):
Clone does the same check internally.
- more comments.
Change-Id: I4551cf560aea722d972fb6da404aed71a79f4037
Reviewed-on: https://go-review.googlesource.com/c/tools/+/416217
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reloading has been significantly refactored recently. Unskip this test
to see if it flakes:
- If it does not flake, that is a useful signal.
- If it does flake, that is also a useful signal.
Notably, following CL 419500 we allow network when reloading the
workspace, and so do not need to apply quick-fixes in order to download
the new module from the proxy.
For golang/go#46375
For golang/go#53878
Change-Id: Idde7195730c32bdb434a26b28aac82649dd1b5ac
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422910
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
The go command can't always resolve arbitrary commits as versions, and
some commits have an x/tools replace directive that must be honored, so
use 'git clone' with an arbitrary commit ref, instead of 'go install'
with a Go module version, to install gopls.
Also rename BenchmarkIWL to BenchmarkInitialWorkspaceLoad.
For golang/go#53538
Change-Id: Ic3a08e4c023e0292f6595cc5b2ab59954d073546
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422908
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Metadata reloading has been significantly refactored recently. Unskip
this test to see if it still flakes.
For golang/go#51352
For golang/go#53878
Change-Id: I9f2ae1835bbace1b5095c2d45db082c4e709437b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/423974
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
This query parameter is not needed.
Change-Id: Id45d7be0b1cbe5d383bcc6768ef20df26de3e7b3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422901
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
A debugging print statement was left in the analyzer, which breaks
gopls' communication over stdin/stdout.
Fix this, and add tests.
Fixesgolang/vscode-go#2406
Change-Id: I1b785fa09e66eae2f1b1e03806e5b59d2015e75e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422902
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Tim King <taking@google.com>
Folks are reporting the current error message as not useful,
remarking that they don’t know which formatting verb goes with
which Go type, see e.g. b/227741360.
Change-Id: I367bc8c4df3521f0726dc4defa4e563532706148
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422854
Reviewed-by: Nicolas Hillegeer <aktau@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Tracking changes in go repo for unified IR.
See CL 422297.
Change-Id: If05aba7693c70cac4969721e5dd8a5bf197670b4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422899
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: David Chase <drchase@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diagnostic Tags add another hint for the client for how to
display diagnostics. The Unnecessary tags allows clients to
fade out the diagnostic instead of adding a squiggle. This adds
this tag to unused import errors as well as unused vars.
For golang/vscode-go#2285
Change-Id: I0c93b28a6a2ef4eed314dcf30a37c27dd65940ac
Reviewed-on: https://go-review.googlesource.com/c/tools/+/415499
Reviewed-by: Robert Findley <rfindley@google.com>
To facilitate testing specific gopls versions, add a -gopls_version flag
that installs and uses a specified gopls version.
Also fix a bug in the DidChange benchmark that causes it to be
inaccurate when the benchmark function is invoked multiple times (by the
benchmark runner or via -count): because the server environment is
shared across invocations, we can't use the benchmark iteration to
derive the expected number of changes: we must use our count of actual
DidChange notifications from the server.
Change-Id: I1ad733cb3e695d382e81dfb7e31346162d9b7635
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422368
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nooras Saba <saba@golang.org>
This test was asserting immediately on the non-presence of published
diagnostics, and therefore was racing with the diagnostics calculation
pass. Following https://go.dev/cl/420539 this became a flake, because
once gopls has calculated diagnostics for the open event, it will
actually publish empty diagnostics for the opened file.
Update the test to use a OnceMet so that we only evaluate the
expectation once we've finished the diagnostics pass. As a result, the
test deterministically failed, which was fixed by using the
EmptyOrNoDiagnostics expectation.
Fixesgolang/go#54271
Change-Id: Id3f220ce44c7996132699a724b6c627f034e367f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422136
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Follow Lua Style Guide for function names.
Query the client's offset encoding, with a fallback to utf-16.
Omit handling of r.command since the source.organizeImports code action
doesn't return any.
Omit passing a value for wait_ms. It is optional and defaults to 1000
(see NeoVim help for vim.lsp.buf_request_sync).
Change-Id: I5e5eb6cee3a46fee1edc1e6d15b40ad88498a26c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421295
Reviewed-by: Dylan Le <dungtuanle@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
When the go.work file is set by the GOWORK environment variable, we must
create an additional file watching pattern.
Fixesgolang/go#53631
Change-Id: I2d78c5a9ee8a71551d5274db7eb4e6c623d8db74
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421501
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
In order to correctly process changes to the go.work file, the workspace
must know about GOWORK settings configured in the users environment.
Compute this when initializing the view, and thread this through to the
workspace.
At this point, workspace information is spread around in a few places.
Add some TODOs to clean this up.
Also remove some module data that was not used in
TestBrokenWorkspace_DuplicateModules.
Updates golang/go#53631
Change-Id: Ie0577d702c8a229304387bc7fe53a8befb544acb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421500
Reviewed-by: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
For users of Go >= 1.18, update the error message presented to users
with broken workspaces to suggest using a go.work. For older Go
versions, suggest updating to 1.18+.
Also:
- add support for changing workspace folders from the fake editor
- update the test to confirm that changing workspace folders resolves
the error message
- inline validBuildConfiguration, and make a few TODOs for how the code
could be further cleaned up
Fixesgolang/go#53882
Change-Id: Ia03dcfec59569b1a3ac941dc40d079b9c2593825
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421499
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Dylan Le <dungtuanle@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
This test is really about workspace setup, not diagnostics. Move it
in advance of changes to this feature.
Pure code move, no other changes.
Change-Id: Ib78f1fe5ce701673f5aa071f399da11f208874df
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421498
Reviewed-by: Suzy Mueller <suzmue@golang.org>
gopls.run_vulncheck_exp runs `gopls vulncheck`
(fork of govulncheck) and pipes its stderr (logs)
as progress messages. The default log format
includes timestamp and that is too long for progress
message. Tell gopls vulncheck to omit timestamp
in the log message.
Use "govulncheck" as the progress message prefix,
instead of the long "Checking vulnerabilities".
Change-Id: I92fe9958b20d0260711a42af9b5f9f399e267587
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420998
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>