Sections were being iteratively replaced in the original doc, rather
than an incrementally updated doc.
Change-Id: Ie49058ecc109e3f99babe24f02ee9c742915cd8d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258567
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
The view reinitialization logic appears to be broken, and so needs one
remaining use of the modURI, which be fixed in a follow-up. Every other
use of view.modURI is removed.
Updates golang/go#32394
Change-Id: Ic051ed848c30e6981d42a576fb35f40efbeb17a6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257417
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Trust: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Due to Windows' default file locking and the fact that regtests shell
out to the go command, cleanup sometimes fails.
This is causing trybot flakes, increasingly as of late. Since the
tempdir will eventually be cleaned up on the trybots anyway, don't fail
on windows.
For golang/go#38490
Change-Id: I136d97143baba1d98777db51daa062cf0e42e33e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258315
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change adds calls to c.matcher.score for commment completion so
comments match the prefix (or fuzzy match depending on user settings)
and don't end up giving the user too many irrelevant suggestions.
Change-Id: Ie660f82c491c17d52e68e781a812bf8053e501f8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258322
Trust: Danish Dua <danishdua@google.com>
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Printing the Go version without the session's go command runner means
that we may not find the right Go version. Also, panicking when we
cannot find a go command is not useful to the user--show the error as a
view initialization error instead.
Fixesgolang/go#41701
Change-Id: I0e0753da9795b1c78331db1faecd27c2bfcee9b4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258312
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: Robert Findley <rfindley@google.com>
This Cl adds all the support for producing semantic tokens other than
generating them. That includes new stubs for LSP, a new option for
the user to choose semantic tokens, and the skeleton for producing
semantic tokens, except that 0 semantic tokens are produced.
vscode 1.49.1 (the current version) does not ask for semantic tokens;
vscode-insiders does.
Change-Id: Iceb8fff974deb9283281319bb5878271c3d3170d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257578
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Relying on the reports returned by (*Server).diagnose adds a constraint
on the signature of that function. Change to using the diagnostics
cached on the server to determine what gopls published to the client.
Change-Id: I49c1cddcf7db81a79e154a9935016b2ef2e5d69c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257378
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: Robert Findley <rfindley@google.com>
This change removes contexts from functions that don't use them. Passing
down context unnecessarily leads to us having to propagate them
everywhere.
Change-Id: I1723721faf4f487b6cc92b9daef3f23747d9cbc1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258285
Trust: Danish Dua <danishdua@google.com>
Run-TryBot: Danish Dua <danishdua@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Unimported completions are expensive and can use up a large portion of
completion budget just to find initial deep search candidates. This
change moves these expensive operations which search through the module
cache to after normal deep completions so we search through more useful
candidates first.
Fixesgolang/go#41434Fixesgolang/go#41665
Change-Id: I6f3963f8c65c1a97833a35738d2e96420de2f6ee
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257974
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Danish Dua <danishdua@google.com>
This change switches over load and RunProcessEnvFunc to use the
snapshot's modules instead of the view's modURI. These do not seem to
have been the racy parts of CL 257417.
Change-Id: I317a350fc4b0c62d77858455a0e2e61148804ecd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257969
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>
As of CL 189818, bundle has been updated to use the go/packages API to
load packages. That API supports module mode and legacy GOPATH mode.
Update the test to provide coverage for all modes.
Updates golang/go#24661.
Change-Id: Ied6196f7317b9b0289faf80dbfe9815e9b98b55d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255053
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Do a pass of unused code cleanup and other staticcheck errors.
Change-Id: Iaf5d27c4f5405d4cce3e48fa06a5d46ec757de40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257965
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
There's very little reason not to always await IWL, and none of our
tests actually need to be able to execute before it completes.
Await IWL before running the test func.
Change-Id: Ia0626aa4e4c6cfa89dc5d03075b6bd797574a8dc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258078
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Splitting this CL out of CL 257417 to minimize the number of changes.
A few of the view's methods are moved to the snapshot, as they will
soon rely on the snapshot's modules field. Some dead code is also
deleted.
We now populate the snapshot's modules field even when
ExperimentalWorkspaceModule is not true, but we stop looking for modules
after searching the view's root.
Change-Id: Id0068ec10fafcfa6f7694dfcb8aaee8cb025078f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257961
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>
When building the workspace module, prefer a gopls.mod file located at
the root of the view if it exists.
Also do some minor documenting/cleanup along the way.
For golang/go#32394
Change-Id: If87729a766d37e6c834fefe40cfb47b67a36a60c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256582
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Robert Findley <rfindley@google.com>
Enable documentation for Debugging options, code lenses, and LSP
commands.
See the comment in loadCommands; reading comments off a composite
literal is annoying. If the documentation were available at runtime this
would be much easier, and we should probably switch to that at the first
sign of trouble.
Fixesgolang/go#33544.
Change-Id: I503b62aa2fc4a993f5978c449088db54fc79f7de
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257737
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Lock around log access in regtests. This flake was relatively rare in
regtests because of the serial nature of our jsonrpc2 implementation,
but was nonetheless racy.
Fixesgolang/go#41653
Change-Id: I08674f42b05624a69d33885c2232c9e31866375b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257957
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change allows a view to have multiple go.mod files associated
with it. This doesn't actually make any changes in internal/lsp/cache
with regards to the view's modURI, but it does do the necessary plumbing
in the client packages.
The next CL will delete modURI.
Updates golang/go#32394
Change-Id: I2312efd69c364aed4244ee3769679885a1ebc7e4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256941
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>
Multi-module mode works rather differently than module mode, so ideally
we should have good test coverage for it. We can get a lot for a little
by running the marker tests as a module in a multi-module workspace. To
do that, we can move everything one directory lower, and use the
original directory as the root of the workspace.
The mechanics of setting it up are a little distasteful but not too bad.
We prepend a directory to all the paths in the packagestest.Module, and
after Export, move the created go.mod down into that directory. The only
other change is to find the golden files in the right place.
Command line tests use URIs everywhere, and it was too annoying to fix
them, so I didn't bother. Unimported completion tests fail and are
skipped for the moment.
Change-Id: I5a15156ca4c357ca668bfee05deb9493203e43a1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256821
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reusing the config causes a race condition because it may be modified.
Get a new config in the bound function instead.
See the logs here:
https://storage.googleapis.com/go-build-log/23cc16cd/linux-amd64-race_343e911a.log.
Change-Id: Iaab43631740e43ba97cd70f7cd8a3bbaa91c26c9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257206
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>
This change adds a test to check the functionality of the GC details
code lens, including the behavior of toggling it on and off. This
exposed a Windows bug that was mentioned on Slack, which can be fixed by
adjusting the URI.
I also refactored a bit of the code to use a JSON decoder, which
simplifies things a little bit.
Change-Id: I7737107cf020fa35bca245485a3b1a1416920fd2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256940
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: Peter Weinberger <pjw@google.com>
This change moves package selection to before type checking so we don't
unnecessarily type-check both variants of a package. As a result, exec
time and memory usage for features making calls to GetParsedFile are cut
by half since we only type check either the narrowest or the widest
package.
Change-Id: Ifd076f8c38e33de2bd3509fe17feafccd59d7419
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257240
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Danish Dua <danishdua@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This fixes panics caused by us thinking that we should use tempModFile
without a go.mod in the view. This code will likely go away after
view.modURI is deleted.
Change-Id: I77a9c9f62bcac27cafa69eb970e004dd58d29d07
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257201
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Show message warnings are annoying to users. Instead, show a diagnostic
for orphaned files. Right now, it will always be there (instead of on
first open). Not sure if users will find this annoying or helpful.
Fixesgolang/go#31668
Change-Id: I5051072b00fee9018d447585fdd9cdfe9df7107a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256977
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
This CL adds diagnostics to the go.mod file if one of the modules in
the workspace is invalid and causes the initial workspace load to fail.
When the module is fixed, the initial workspace load will be retried.
This CL also introduces the *source.ErrorList error type, which will be
useful in the future as a way of producing diagnostics out of errors.
Updates golang/go#32394
Change-Id: Ib8860a4f16c1983b8512f75e26354512d5a9a86d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254753
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: Robert Findley <rfindley@google.com>
This may be expensive, and we don't want to do it if the results will
be unused.
Updates golang/go#41558
Change-Id: I0c01a80f4fc459e1cc189934ad23ab443e5ea2a5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/257137
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: Robert Findley <rfindley@google.com>
The go generate command was not honoring its dir argument, instead just
running in the workspace root.
Fixesgolang/go#41566
Change-Id: I5fb96a765cf4fb2572e2a8a2e560e02f0760023f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256818
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This change adds benchmarks for completions running against x/tools
codebase. We still maintain support for manually configured completion
benchmarks through the CLI; run instructions are added as comments in
code.
Change-Id: I3bcf7edac183397ad01755b767798925c4bd30ba
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256877
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Danish Dua <danishdua@google.com>
Wire up a command to generate a gopls.mod file for a multi-module
workspace. In the future, this can actually be used to manage the
workspace, but for now the file is just generated, not actually used.
For golang/go#32394
Change-Id: I8a53da8ac9337bde132c7d8ca8557467f368fc24
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256042
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change refactors deep completion to move search path to a candidate
instead of pointing to it in search queue. This removes the idea of
"being in deep completion" and instead a deep candidate is just a
candidate with a path from search root.
Change-Id: Iec6a0f4409c0c8793986d5c1063000205ed43477
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256417
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Danish Dua <danishdua@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Currently, we deep search top level candidates as soon as they're found,
which isn't necessarily leading to an overall breadth first search
approach. This change refactors completion to add candidates to search
queue instead and only call deepSearch once at the end.
Change-Id: I712b03c98b57680a1f1c95df2385f7f2ea6e1ed0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256259
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Danish Dua <danishdua@google.com>
Add a new field to the options JSON, EnumValues. Use it to automatically
generate the documentation for enums. Fix the displayed type to be
"enum" rather than the full-qualified Go type name.
To make this easy, I changed the various enum constants to be strings,
with values matching their configuration values. It may be possible to
automatically parse them in the future, but we can get to that later.
The documentation for hoverKind's private values is a little janky. I
didn't want to build a way to hide them. We can hardcode it if we really
care.
Updates golang/go#33544.
Change-Id: Ia5cc958e347d5ff041068c57726d530809bb0f70
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256358
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Mostly a rollback of CL 217541. No changes in the actual tests.
Change-Id: I910551d4750822bd2d8c5039d1cf194e42d01500
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256363
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
The logic of incrementally populating the view was getting unnecessarily
complicated and hard to reason about. Split out helper functions that
we can use to create the view's fields before creating it.
Change-Id: I872fe22a9c2802668facf6b2d795b195aa47de00
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255348
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: Robert Findley <rfindley@google.com>
As we begin testing multi-module workspace, clean up existing
multi-module marker tests. Most of their coverage was redundant with reg
tests already. Add a couple to cover the remainder.
This is probably not strictly necessary but it was easier to remove the
tests than worry about how to support them in multi-module mode.
Change-Id: I54cca5eea60e0679759f7d39131c5cd015fb0154
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256361
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Clean up a stray use of build tags rather than testenv.
Change-Id: Id645b4f6af1f770a47ea8ff3f0d16b14f25976c2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256360
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
FileHandles with stat errors didn't have their URIs populated. It's
probably reasonable to expect URI and Kind to work on them.
Change-Id: Ic328b262803f93b5042da89a973859c598fa5beb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256359
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
A deprecation notice was added to benchcmp in a1f8cf0047, but there is no mention of it in the benchcmp docs at https://pkg.go.dev/golang.org/x/tools/cmd/benchcmp, so it may not be immediately obvious to new users.
This PR adds the deprecation notice to the documentation as well to make it easier to discover.
Change-Id: Ib49228abc140435023694173511caa4d3c6c0672
GitHub-Last-Rev: 8e19863394
GitHub-Pull-Request: golang/tools#252
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255878
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Giovanni Bajo <rasky@develer.com>
We should be able to smoothly add and remove modules from the workspace.
This change moves the module-related fields from the view into the
snapshot so that they can be easily modified and recomputed. The
workspace module is now a workspaceModuleHandle.
Updates golang/go#32394
Change-Id: I6ade7f223cc6070a29b6021b825586b753a0daf1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254940
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: Robert Findley <rfindley@google.com>
This change improves the labels for import suggestions to only show the
last part of the path. Since VSCode fuzzy searches for labels in text
edit, we now return only the last part of path as text edit instead of
replacing the full import path. Just changing label while returning full
path leads to bad user experience.
Closesgolang/go#35877
Change-Id: Ib10e7a3e030dc9b850ff1d9ec8d45240b75b64a3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255837
Run-TryBot: Danish Dua <danishdua@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Danish Dua <danishdua@google.com>
1.16 wants to set GO111MODULE=on. There are, AFAIK, two differences
between "auto" and "on". First, if you're in a directory outside of GOPATH
and with no go.mod, "on" will run in module mode with GOMOD=os.DevNull.
I don't think we care very much about that. Second, if you're in GOPATH
with no go.mod, "on" will run in module mode, breaking GOPATH mode.
Breaking GOPATH mode may be desirable for the go command generally, but
for gopls I think it will lead to an unnecessarily bad user experience.
Users will find out when they do their first build or test; there's IMO
no need to also break their editor.
Flip the default back to "auto".
Change-Id: I280e001a9f7e80d65e68c0cb94353d70a7f5425e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255781
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This CL does not fix failures in ./gopls/internal/regtest, which will
be fixed separately.
In refactor/rename.TestDiff, add a go.mod file.
In internal/imports.ProcessEnv.buildContext, set an I/O hook if
GO111MODULE=off in ProcessEnv but not in the current process's
environment.
Context allows the user to set GOPATH, GOOS, GOARCH, and a few other
environment variables, but not GO111MODULE. Context.Import may return
different results than packages.Load if the latter is invoked with a
GO111MODULE value that differs from the caller's environment. Setting
an I/O hook forces Import to run in GOPATH mode, not invoking 'go list'.
This is undocumented, but it should be stable while GOPATH is
supported.
For golang/go#41330
Change-Id: I5679e8941e32dc95b05c234cb2e3fec5cabebced
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255398
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
This change converts deep completion from depth first search to breadth
first search.
Change-Id: Iebc7ba8d3acb44928220596065d4e8de53ea9b48
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254542
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Danish Dua <danishdua@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>