In subsequent CLs, tests are added that don't need the full machinery of
fake.Workdir (file tracking, etc.). Factor out some of the facility for
writing a txtar-encoded temp directory, and working with relative paths.
Change-Id: Iae25c37a8fd8de2dfe6c91e507d9be01440d3492
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263523
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>
And, export CommandPrefix const so api_json generator can use it.
Update golang/go#41187
Change-Id: Ie976b774d64ba707152b6f659a15aef19ef12dcd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263057
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
Errors in options generate showMessage notifications, but these
were lost if they were sent before the initialization handshake completes.
Change-Id: I011da2387467bb6bf188201a7294e1bb30805cbc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263518
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Build flags, -mod, and -modfile are all accepted by disjoint go command
verbs. Mixing them together had the effect of forcing gocommand users to
figure out which went where themselves, which was annoying and
error-prone. Add ModFlag and ModFile fields to Invocation and update all
uses to use them.
go/packages has a BuildFlags field that's bad for the same reason. Add
private modFlag and modFile fields that forward to the corresponding
Invocation fields.
imports.ProcessEnv gets the same treatment.
Fixesgolang/go#41826.
Change-Id: If74d19146e9e62930d7c34f40859c27c25566c4e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263213
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>
Rename Snapshot.GetFile to GetVersionedFile, and make the signature of
GetFile consistent with the corresponding method on session and cache.
This allows algorithms that depend only on file state to be expressed
using this API. In a subsequent CL, this is used for building and
testing the workspace module.
Preeemptively add the FileSource interface for use in these algorithms.
Change-Id: I550906e554fd290dcdf4cac442d5f223e0f644c1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263522
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: Rebecca Stambler <rstambler@golang.org>
Noticed these when I enabled the "unusedparams" analyzer. Not really
necessary to fix most of them, but seemed harmless.
Change-Id: I77c6e5f7c79f1abb701cd3332642486c34049736
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263203
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>
OpenFileWithContent is identical to CreateBuffer. Delete it in favor of
the latter, which (in my opinion) has the clearer name.
Change-Id: Icf0f017a9a71a273ace6d697c7d669a2df2e3ba8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263206
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>
Trust: Robert Findley <rfindley@google.com>
Currently, walking the transitive closure of invalidated packages
happens eagerly while we invalidate each file. Delay this until after
looping through invalidated files, so that we may more easily consider
invalidations not directly associated with an individual file change.
Change-Id: Id6a95098ce6d5d3ec70143c029ac7d2c9b8c7d28
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263205
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>
The reason unusedparams wasn't showing up was because we didn't handle
the analyses settings correctly. Fix it and remove unusedparams.
Change-Id: Ia8636c306d136a718d1d12a80326117b34f5da28
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263201
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>
To simplify snapshot.clone a bit, factor out the logic to figure out
which packages to invalidate when a new file arrives. This also made it
easier to improve the algorithm by caching os.Stat results when walking
known packages.
Change-Id: I012b60e8ad73eb4df80950aac48791204877e9e0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263204
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>
The command 'gopls semtok <file>.go' produces a version of <file>.go
decorated with comments describing tokens as semantic tokens. The
format is described towards the top of cmd/semantictokens.go.
There are also tests in testdata/semantic/. a.go is used by lsp_test.go
(with -cover) to show that essentially all of semantic.go is executed.
b.go illustrates the handling of strange, but legal, constructs
like 'const false = nil and non-ascii'. The .golden files show
the expected results.
The implementation will panic, rather than log, on unexpected state.
gopls semtok has been run on all the .go files in x/tools and in
the source distribution. There were no unexpected messages nor panics.
Change-Id: I11715bcc8d6830d1951eb58239978c4a363bbc30
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262198
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL adjusts the genapijson program as the follow up of the command
name change cls. The program loads the command list by parsing the
source code and uses the result to compute the codelens list.
Involved data types are also used for JSON marshalling, so I just
update the command name after codelens list loading is done using
the command data.
Updates golang/go#41187Fixesgolang/go#41985
Change-Id: Ic5e818e11b09c649f462fe87dabee0be64c96c2a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262354
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
The primary identifier for gopls commands was changed from Command.Name
to Command.ID(), but this change was not made in the commands passed
back to the client via ExecuteCommandOptions.
Fix this, and ensure that our regtests actually check commands against
the list of supported commands that has been sent.
For golang/go#41985
Change-Id: If566584f157e8a86d26eac6353dbfd772b298cfc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262597
Run-TryBot: Robert Findley <rfindley@google.com>
Trust: 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>
Every setting parse error should include the name of the error for user
sanity. Add it in the errorf method, clean up redundancy, and make
existing errors more consistent/correct.
Updates golang/go#41964.
Change-Id: I8f980ceb5d82d4238edcd4095ea0e9572ac9c271
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262353
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>
We stored the user's environment settings as a string slice, but users
set it as a map. It turns out that we have code spread around to convert
it both back and forth, so rather than hack up the doc generator,
so centralize that code and change the native representation to a map.
We end up with slightly less code.
Fixesgolang/go#41964.
Change-Id: I975c69524c7d79c7d09079f44cc44a27e72ba285
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262351
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>
Fix a few settings whose documentation was bad in various ways:
- semanticTokens' was not camel case; changed to semanticTokens.
- experimentalPackageCacheKey was not hooked up to a setting; do so.
- literalCompletions is for tests only; hide it.
- completionBudget should be specified as a duration string, not number
of nanoseconds.
- experimentalDiagnosticsDelay should have been affected similarly to
completionBudget but is not mentioned in the bug.
env is next.
Updates golang/go#41964.
Change-Id: I3470958cbdfc46daa76da297fc1a56da4a3f10ce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262345
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>
Type-checking can be very expensive for large packages and leave no
budget for shallow completions. This change adds a minimum budget of
10ms so we show the user at least some shallow suggestions.
Updates golang/go#41434
Change-Id: If2ef59c3fbdcfa2ebaabb21256cf606a4f9c14d6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/262347
Trust: Danish Dua <danishdua@google.com>
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This change dedupes cached standard library packages too since we might
see some of them again while reading disk.
Fixesgolang/go#41745
Change-Id: I879bfd9e199dffdde2d88438124154f164f64f00
Reviewed-on: https://go-review.googlesource.com/c/tools/+/261081
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 changes bumps relevance for modules with major versions >1 so the
results for unimported members are ordered by major version.
Updates golang/go#41800
Change-Id: I64f4a1cf78a101acf4229433d06b5793246962f5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/261084
Run-TryBot: Danish Dua <danishdua@google.com>
Trust: Danish Dua <danishdua@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This change adds "go test" as a code action and also introduce the
concept of explicit code actions, i.e. code actions that aren't returned
to the client unless it explicitly ask for it.
The purpose is to be able to have a mechanism that allows users to
execute a specific command in one shot, and future CL:s will add more of
the existing code lenses as explicit code actions. Code lenses can't be
used directly since they lack the range/kind combo to make them unique.
Updates golang/go#40438
Change-Id: I245df4e26c9e02e529662181e2c1bc44f999e101
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259377
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change pulls out the logic to process module-related errors from
go/packages.Load out of internal/lsp and into internal/lsp/cache. This
simplifies diagnostic handling in internal/lsp, as we can just return
a *source.ErrorList. Most of this is just a code move, not really a
logical change.
This also fixes the staticcheck error :)
Change-Id: Ic6cad3f59a7e4492dea85b8dcfa9e3f24a371803
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260805
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>
Workspace mode makes more sense as a property of the snapshot, since
it is determined based on the modules in the workspace. Move it to the
snapshot and enable the GOPATH to modules test. The mode switch means
that we may run `go mod` commands before a `go.mod` is on-disk, so add
handling for that case.
Also, remove the code added in CL 258121 to treat packages starting with
a "_/" the same way as command-line arguments--that's not actually
correct because perfectly valid packages can also have a "_/" package
path prefix.
Fixesgolang/go#40340
Change-Id: I35044f5d108983ba00df1359698bf14217caa982
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260078
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 Cl adds all the support for producing semantic tokens.
vscode 1.49.1 (the current version) does not ask for semantic tokens;
vscode-insiders does.
There are no categories for statement labels, nor for constant
values of boolean types. (The former doesn't exist in Typescript, and
boolean isn't a type in Typescript.)
The CL after this one will provide for extensive testing.
Change-Id: I589f51d510b0e423c947f4d95f685e6ba696506d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258477
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Peter Weinberger <pjw@google.com>
Updated the generator to check for this. Necessary to fix command name
collision in VS Code Go. Not the nicest solution, but seemed like the
least invasive one.
The codelens configuration is a little strange now, with the "gopls_"
prefixes, but the alternative is adding the prefix when processing the
config and that would make the default look different from the example.
Fixesgolang/go#41187
Change-Id: I5cf42f4a96f6252016dcd5c40a4ac401e1b30a8f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259204
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>
Many of the View's fields are for goimports, which is a good sign it
should be extracted into a separate struct. Do so in preparation for
redesigning the lifecycle.
I'm not certain this is the right direction but I don't want to deal
with a zillion merge conflicts as I figure it out. I'll move it back
later if it does turn out to have been a mistake.
No functional changes intended, just moved stuff around.
Change-Id: Ide4c2002133d00f6aaa92d114dae2b2ea3ad18fc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260557
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>
symbolStyle is a subtle enough setting to need documentation for its
possible values, but it is awkward to have to put this documentation in
the docstring for the type rather than the docstring for the value
specs. Update the generator to support this.
Change-Id: I276ec30c489719b2629a307faa506959decd6064
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258718
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>
Workspace mode did not yet support major versions other than v0/v1. To
do so, we have to check the major version before creating the fake gopls
workspace pseudoversion that goes in the workspace module.
Fixesgolang/go#41807
Change-Id: I108fe504fdf9e9a0ce23f7102991c9ae78f12a9f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260004
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>
We've recently noted that hashing the packages.Config into the cache key
for the type checked package is probably unnecessary, given that all the
other critical inputs into the typechecker are already included
(packageID, parsed files, and deps). Furthermore, when using a gopls
daemon this causes unnecessary cache misses, because the packages.Config
includes things like working directory that no longer matter once other
inputs to type checking have been computed.
Add an experiment flag that removes the packages.Config from the cache
key. An experiment is used to stage this change as comprehensively
testing the cache is ~impossible.
Change-Id: I7ba73daaa71a80ec996decaa9817ec515b5eeb6e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260737
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 is a temporary fix--golang/go#41826 is a better approach.
Fixesgolang/go#41803
Change-Id: Ia055c5e171fe5d4f6d67e9e2e9e7c85fe254605e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260000
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Missed this in CL 260002. Added to the unit tests :)
Change-Id: I81607fd3cbbf021771e09ecd75952f27a622e754
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260005
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL adds another regtest mode for trying out experiments, like the
workspace module mode. Before this CL, we lost coverage for default
mode when we turned experimental module mode on by default.
Removed TestNoWorkspaceModule, as it was just a placeholder until this
mode was available.
Change-Id: Ie3e4c2daec3e635c188bafa25b33dd178da875a3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258518
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 setting automatically turns on all of the off-by-default gopls
features so that users can opt in to all experiments.
Fixesgolang/go#41763
Change-Id: Ia6998128649a081c2a1e8eb08c2db6d795a73143
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260002
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
We were previously opting out of workspace module mode when any module
had vendor directories. While we still haven't decided how to handle
vendoring, it simplifies things to opt experimentalWorkspaceModule users
in to the workspace module mode when they have modules with vendoring.
Temporarily require default mode for the inconsistent vendoring test
(golang/go#41819).
Fixesgolang/go#41725
Change-Id: Ifa494daea51a2a3bb2e6bc3026bfb9e8118d31a3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259623
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 ability to show references to interface methods.
Instead of just showing direct references to a type, we also show
references to the type through an interface now.
Change-Id: I9d313b3b77c75adb9971dc56ee86caa697d03c90
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259998
Trust: Danish Dua <danishdua@google.com>
Run-TryBot: Danish Dua <danishdua@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
didModifyFiles and DidModifyFiles were tightly coupled but also repeated
each other's work a bit, and inconsistencies in the implementation led
to golang/go#41777.
Push all the work of assigning a "best view" down to the Session, and
always assign it somewhere, matching the logic in ViewOf. This would
in principle allow us to diagnose random files, but we only diagnose
workspace packages.
Fixesgolang/go#41777.
Change-Id: I6dab32b98bdff6edd07032d84a8fec1b82ecd283
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259877
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>
Looks like this may never have worked. "Error" does not appear in the
builtin package's scope, so we have to look up "error" and then find
the method. A little convoluted, but it works.
Change-Id: I5fe4e96d5c51a1fdc683e44b9a80e0cbdab85422
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259143
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>
Workspace packages seem to contain an empty package name when no
package is present, we can just ignore it since it leads to an
irrelevant completion suggestion.
Fixesgolang/go#41746
Change-Id: I4820751ad0f741dd0d29b42485b41bb4c296a169
Reviewed-on: https://go-review.googlesource.com/c/tools/+/259217
Run-TryBot: Danish Dua <danishdua@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Danish Dua <danishdua@google.com>
Factor out processing of string enums when setting options results. In a
couple places this will result in errors being detected for invalid
values where they weren't before. Interestingly the default branch for
symbolMatcher was 'caseInsensitive', when in fact the default matcher in
the absence of any setting is 'fuzzy'. The command tests were implicitly
relying on this bug, passing 'default' to mean 'caseInsensitive'. Fix
this.
Also add a test, since option processing is not trivial.
Change-Id: Ib3ec4b1619add4c7315b6a689ca257e068da6027
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258658
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>
Trust: Robert Findley <rfindley@google.com>
Now that we have documentation generation, improve the docstring for the
symbolStyle option.
Change-Id: I3c6de430eea501ecf797a11873c53c565cae9075
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258617
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>
Trust: Robert Findley <rfindley@google.com>