This breaks the build at Go 1.12, as documented in golang/go#50827.
Fixesgolang/go#50827
Change-Id: Ic7c122757e53981c5ee8f7fdf74fe276895717f2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380555
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
And include the link to the milestone and a known issue
Change-Id: Iaae07cdf1a533da44fd15e0692b29e4173ed879f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/381016
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
In https://go.dev/issue/50879, we observe ECONNRESET errors from
'dial' in TestRedirect for various paths. That seems to imply that a
unique connection is being dialed for each path — but these
connections are all going through http.DefaultTransport, which has a
30-second keepalive, and the test takes well under that amount of time
to complete.
The only reason we would be dialing a connection per request would be
if the connection itself leaks — and, indeed, inspecting the test in
more detail it fails to close the response body.
I don't know why failing to close the response body would lead to
ECONNRESET errors, but at the very least fixing that issue should
reduce the number of 'dial' operations and thus the number of
platform-specific failure modes.
Fixesgolang/go#50879.
(Maybe.)
Change-Id: I5af47ee3683c54106424c66e94b021a0ec7e6d2d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/381736
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Enable a test case that uses comparable, now that its type string
has been adjusted.
Follow-up for CL 380999.
Change-Id: I5ce729e42234d7539a464d0aafba5a7f53d59625
Reviewed-on: https://go-review.googlesource.com/c/tools/+/381234
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Uncomment (and adjust) test cases that were broken due to type parameter
type/object strings.
Comment out a test case that uses comparable, while its type string is
being adjusted.
Change-Id: I79fa2081f4a8acfe1bf23da61289272bde8ad034
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380999
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This is a more common practice.
Change-Id: I45e37219a4d813a75fb239f0ce309489abe3616b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380794
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Guodong Li <guodongli@google.com>
Reviewed-by: Tim King <taking@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
We care that gopls operations complete within a reasonable time.
However, what is “reasonable” depends strongly on the specifics of the
user and the hardware they are running on: a timeout that would be
perfectly reasonable on a high-powered user workstation with little
other load may be far too short on an overloaded and/or underpowered
CI builder.
This change adjusts the regtest runner to use the test deadline
instead of an arbitrary, flag-defined timeout; we expect the user or
system running the test to scale the test timeout appropriately to the
specific platform and system load.
When the testing package gains support for per-test timeouts
(golang/go#48157), this approach will automatically apply those
timeouts too.
If we decide that we also want to test specific performance and/or
latency targets, we can set up specific configurations for that (as
either aggressive per-test timeouts or benchmarks) in a followup
change.
For golang/go#50582
Change-Id: I1ab11b2049effb097aa620046fe11609269f91c4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380497
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
We don't know whether this failure is due to a Go bug or a platform
bug, so we'll skip it on the one builder to reduce noise, but not the
GOOS/GOARCH as a whole. If we do not observe failures on other
windows/arm64 builders, we can perhaps chalk it up to a platform bug.
If we do observe failures on other builders, then we'll have more data
to investigate with.
For golang/go#50706
Change-Id: I52511dd4a5cff80953823d9cf901975ff4657457
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379734
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
We may want to generalize this to have regtest.Run always derive the
default timeout from the test's deadline. In the meantime, this is a
more targeted fix for the specific timeout in TestGCDetails.
Fixesgolang/go#49902
(Maybe.)
Change-Id: Ie15735dc7b0d462ec047d3f3d8a2eceeb4411fa0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380496
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This CL begins adding a guide for the new APIs introduced with Go 1.18
to support writing tools that understand generic Go code.
For now I've added a summary of the new APIs, an initial example, and
some discussion of the typeparams package. Subsequent CLs will add more
examples, and polish.
Updates golang/go#50447
Change-Id: I4ed8d7a2f43e748374d14f3f515673d69ab2d5a0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377834
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Trust: Dominik Honnef <dominik@honnef.co>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Supresses reporting when either interface is type parameterized.
In principle, we should be able to report when we know two interfaces
cannot be unified. This is more complicated with type parameters.
Waiting on go/types to provide this complex functionality.
Updates #50658
Change-Id: Ib767585c785aea12dbb9e337cc339881a63be57e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380014
Run-TryBot: Tim King <taking@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Tim King <taking@google.com>
snapshot.GetVersionedFile already memoizes the file handle in
snapshot.files. There is no reason to do another write, and this write
is unsynchronized.
Fixesgolang/go#50747
Change-Id: Ib196395135de6f22dd59169accb756665ad10e58
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380214
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This test has a high failure rate on the builders, and the failures
appear to be mostly platform-independent. This change skips the test
until the failures can be diagnosed and fixed.
For golang/go#50748
Change-Id: Iadfda7345f3dcbafa61338469aa6dc45e1d85a49
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380215
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This change makes source.FormatVarType return the instantiated type
parameter instead of the actual AST expression because that will just
refer to the abstract type parameter and not the insantiated one.
I am not sure if this covers all edge cases or if there's a better
solution but I'm happy to adjust to whatever is appropriate.
Fixesgolang/go#50623
Change-Id: I6e0b2d93c47c9a0502f2995ca8d3668a9a31c056
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378714
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
As described in golang/go#50481, in the existing export data schema
blank type parameters do not have unique names, and therefore types with
multiple blank (receiver) type parameters cannot be correctly imported.
This CL implements the fix proposed in that issue, using the schema
<prefix>.$<index> as the exported name of a blank type parameter, where
<prefix> is the qualifying prefix and <index> is the index of the type
parameter in its type parameter list. The importer is backwards
compatible with the old schema: it will continue to import <prefix>._ as
long as there are not multiple blank type parameters.
I considered not making the exporter change simultaneously with the
importer change, so that we interleave the corresponding changes in the
standard library. However, that made it harder to test the importer, and
updating both seems unlikely to cause problems.
For golang/go#50481
Change-Id: Id24428c6ea2b256312156894f9f76fa8e9ee38d4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379855
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
It not necessary to sanitize object/type strings produced by go/types,
because they no longer contain subscripts.
Change-Id: I3ed41359d59b01ab2cf2ad4a6b587635ce4cecf2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379854
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Add additional assertions when comparing objects in imported packages.
In particular, cmpObj was skipping many assertions about top-level named
types that were not reachable from other declarations.
Change-Id: If8f6bee452d921b72550aed4e7ac1b31fa859f5e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376114
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TestPostfixSnippetCompletion appears to produce racy writes to the
filesystem, and the failure mode does not seem to be
platform-specific. This skips the test to reduce noise until someone
has the time to investigate in more depth.
For golang/go#50707
Change-Id: I31c3aaf0cdb92ae2323cc8a926d3775d1433a9ff
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379735
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Update and expand on the package documentation for the
internal/typeparams package.
Change-Id: I2af16250580abf9e6b3a8692356faa498ba83f29
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377654
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The IndexExprData type of internal/typeparams was redundant now
that the typeparams.IndexListExpr type has been introduced. Remove it,
and change GetIndexExprData to an UnpackIndexExpr method, symmetric with
PackIndexExpr. With the IndexListExpr type, both UnpackIndexExpr and
PackIndexExpr can be moved to common.go.
Change-Id: I6c31f52ab594175decfbd1a4cd94b60a23a1e629
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377235
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
We have inconsistent rendering of newlines in enums, as pointed out in
CL 314189 (that change edited the markdown directly, which won't work).
Change-Id: Ie39b80fe65287bd447d18cacdaea60b24b4bd08f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/369957
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The fastfuzzy matcher is around 3x faster than the fuzzy matcher for
queries that need to search a large number of symbols, and has improved
scoring due to built-in knowledge about the structure of Go symbols.
Enable it in experimental builds of gopls, with plans to enable it by
default in the next release.
For golang/go#50016
Change-Id: Ie2c333f248bb8397d92f52fbbfdd2bf623372d0a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377434
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
I'm not sure how to hit this in practice, since it appears that symbols
should only return errors with some type of corruption, but we should
keep going when searching for symbols in snapshot files.
Change-Id: I9fcf6cc92fdc943520e8890ece51d28ec46e8812
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376363
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Hook up the fastfuzzy symbol matcher to our fzf-style query parsing, for
consistency with the (slow) fuzzy matcher.
In the past I had wanted to implement this natively inside the
SymbolMatcher, but it is much simpler to keep using combinators. In the
common case we'll just be using fuzzy matching.
For golang/go#50016
Change-Id: I1c62c8c8e9d29da570cb1e4034c2b10782529081
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376362
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
In the new SymbolMatcher, add an additional scoring feature that
considers whether the matching pattern streak is part of a whole-word
match. This differentiates matches of "foo" against "pkg.foo" and
"pkg.foobar".
For golang/go#50016
Change-Id: Ib84ff13eee0b7ec23143325592cef9a41be07375
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376361
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
There are no changes to the internals of gopls. THe newest version
of the LSP has support for notebooks.
Change-Id: I6d12350e195f459df14efe3b349fff4cc917470c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379114
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
Trust: Peter Weinberger <pjw@google.com>
CL 379116 changes the format of the error this checker is looking for.
Update it to handle both the old and new form.
Change-Id: I91668e4fcbe203a9028d07b780fd17e9758fc838
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379174
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The pathExcludedByFilter helper function expects path to be relative to
the workspace folder. This is a confusing API, and led to us passing
absolute paths when checking for excluded template files.
Fix it, add a regtest, and add a TODO to clean up the API.
Fixesgolang/go#50431
Change-Id: Iedcf0dd9710e541c9fb8c296d9856a13ef3fbcb6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378398
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
modfile.File.SetRequire panics on duplicate requires with conflicting
versions. Avoid the panic by returning an error in this case.
Skip directness diagnostics that run into this error, rather than
invalidating all diagnostics.
Fixesgolang/go#50425
Change-Id: Ic6379ecc48581e7fd7b470ed295e449833c351dd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376394
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Add some additional regressions tests for our loading of templates based
on language ID and/or the configured templateExtensions. Move these
tests to a new regtest package "templates", so that they may be easily
run together.
Fixesgolang/vscode-go#1957
Change-Id: Ic83454725e9aec41b3c1f5202bb68d97cc73c839
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378394
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
There is no standard for go template file extensions, and users may not
want this functionality. Make template support opt-in by changing the
default value of templateExtensions to be [].
Updates golang/vscode-go#1957
Change-Id: I7e37d22b1bc63d8300634b3b0394b4036b43fa49
Reviewed-on: https://go-review.googlesource.com/c/tools/+/375874
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Having the explicit skipTemplate guard should not be necessary, since
with templateExtensions empty we should not detect any templates that
the user did not ask for. Remove it
For golang/vscode-go#1957
Change-Id: Idbe30bc61f47ed405d98fdb029f44a0841769ad0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378355
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Now that we honor the template file kind provided by LSP clients, we
need to use this to derive the set of active templates.
For golang/vscode-go#1957
Change-Id: If0883b2acff746fe6d187124b939f3a2d0e0d4f2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378354
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Honor the file kind provided by clients for overlays, by passing the
FileHandle into View.FileKind and checking for overlays.
For golang/vscode-go#1957
Change-Id: I4a767cb64dc5205f1d10c3126a2cbe67c21a34e4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/378314
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Make the language id (sent from the client) 'gotmpl' equivalent to 'tmpl'
Wherever a view is known, use its options to determine which files
are template files. Whenever the client sends an explicit
languageID, use that.
Partially fixesgolang/vscode-go#1957
Change-Id: I04cd630d6c6c80e0a78c2fafb6ddc1166ce86829
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376854
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
(*token.File)MergeLine() can panic. Add code to avoid the panic
and request information from users.
Fixesgolang/go#50329
Change-Id: I9c10a5c6cbee4ff8a34321e77e32971f7e588cb5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376274
Run-TryBot: Peter Weinberger <pjw@google.com>
Trust: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Add additional order invariants to workspace symbol results to
differentiate between items of equal score: sort next by symbol length,
and then finally by lexical ordering.
For golang/go#50016
Change-Id: Ic5cda2628f57cecfe972b7585525c49b0f8518bf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376360
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
This adds two new snippets, centred around string manipulation.
The first snippet applies to variables of type string, and is called
split. When used, it replaces `someStringVar.split!` with
`strings.Split(someStringVar, "|")`, where `|` indicates the location of
the cursor.
The second snippet is essentially the same as the first, but in
"reverse". Meaning that rather than going from a string to a slice of
strings, it goes from a slice of strings to a single string:
`someStringSlice.join!` -> `strings.Join(someStringSlice, "|")`.
Change-Id: I0e303a39766463034687f76a5d9dbab419e2021b
GitHub-Last-Rev: 935cc418e75d54f0e5b1194cdb576c8829252a26
GitHub-Pull-Request: golang/tools#347
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362474
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Now that the standard library importer/exporter has been updated for a
while, we can set iexportVersionGenerics to its final value -- 2.
Fixesgolang/go#47654
Change-Id: I27eca4cf2b82b7c09e2b6a754c6e5e5af71a7b29
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377554
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Dan Scales <danscales@google.com>
Workspace symbols requests fail when a file in the workspace is missing
metadata, such as if a build-tagged file is open in an overlay. We keep
going if metadata is missing, but not on metadata errors (such as
packages.Load errors).
Change this to log and keep going on errors.
Fixesgolang/go#50536
Change-Id: I41331e864bf21e4f39674248bc30bfc02a4c3d1d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377234
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Server.didChangeConfiguration spins off a goroutine to diagnose the
reconfigured view, but this goroutine was calling View.Snapshot(), which
is not safe to call outside of jsonrpc2 serialization, because
the view may have been deleted.
Instead acquire the snapshot synchronously and just release it after
diagnosing. This should be sufficient, because any subsequent snapshot
change should have triggered a diagnostic anyway.
Fixesgolang/go#50327
Change-Id: I2977ce0093d31be833ace979e65d112a31ac1543
Reviewed-on: https://go-review.googlesource.com/c/tools/+/375875
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
According to https://go.dev/issue/50478#issuecomment-1006947143, Plan
9 does not support renaming across directories. For the MultiModule
test cases we want to rename go.mod to testdata/go.mod, so we need to
fall back to copying if os.Rename fails.
Fixesgolang/go#50478.
Change-Id: I30b7601e1d4b122ce114015f3585f6ba6d6c9714
Reviewed-on: https://go-review.googlesource.com/c/tools/+/376115
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
The purpose of t.Helper is to attribute test failures to the caller's
file and line number. However, in lsp.TestLSP (and in tests.RunTests)
the reason for a given failure tends to have little to no relationship
to the caller code, so it is more useful to attribute failures to the
specific part of the setup that fails.
For golang/go#50477
Change-Id: I7c37070d036efb20f68764cfb82ce2aab1ff933c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/375877
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>