The source.Session interface is not needed: the source package should
never need to know about sessions. Remove it in favor of the concrete
*cache.Session type.
Change-Id: I220a1fb1525c57f9fa2a4a4f80152c31a81565ff
Reviewed-on: https://go-review.googlesource.com/c/tools/+/435359
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>
Deprecate the following features, which never made it out of
experimental:
- experimentalWorkspaceModule (golang/go#52897)
- experimentalWatchedFileDelay (golang/go#55268)
- experimentalUseInvalidMetadata (golang/go#54180)
See the associated issues for rationale behind the deprecations.
With this change, any users configuring these settings will get a
ShowMessageRequest warning them of the deprecation.
Fixesgolang/go#52897Fixesgolang/go#55268Fixesgolang/go#54180
Change-Id: I49f178e68793df4e4f9edb63e9b03cad127c5f51
Reviewed-on: https://go-review.googlesource.com/c/tools/+/434640
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
An application that links in version 1.18 of (say)
go/types cannot process Go source files reported
by version 1.19 of 'go list'. There is no way to
tell go list to behave as if it was go1.18, so
for now we proceed with parsing/typechecking but,
in case of errors, we issue an additional informative
diagnostic.
Fixesgolang/go#55883Fixesgolang/go#55045
Updates golang/go#50825
Updates golang/go#52078
Change-Id: I5fd99b09742c136f4db7f71d2a75e4cdb730460d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/435356
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>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Tolerate the new form of the "... imported but not used" error message,
to allow landing this change in go/types.
Along the way, improve the test output when comparing diagnostics, and
formatting results.
For golang/go#54845
Change-Id: I998d539f82e0f70c85bdb4c40858be5e01dd08b6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/435355
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Update gopls to handle the new form of "undeclared name: ..." error
messages, "undefined: ...", and update tests to be tolerant of both.
Also do some minor cleanup of test error messages related to mismatching
diagnostics.
With this change, TryBots should succeed at CL 432556.
Updates golang/go#54845
Change-Id: I9214d00c59110cd34470845b72d3e2f5e73291c1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/434636
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
We're almost certain that the go process shown by ps
is not the one that we're waiting for in runCmdContext,
but only by printing the pid can we be sure.
Updates golang/go#54461
Change-Id: I1ce9580de6ee6bc4557d76c2a6b05f5a3e2eb6c2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/434637
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Update the reset_golden.sh script to run the ./test and ./internal/lsp
directories, following the deprecation of ./internal/lsp/cmd and
./internal/lsp/source tests. Also, fix it to generate golden data for
tests that only run at 1.17 and earlier.
Use the newly fixed script to sync the golden data.
For golang/go#54845
Change-Id: I2b42dac91cf1c7e2e8e25fd2aa8ab23c91e05c6c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/434635
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The previous explanation from CL 230312 suggested that multiple
Analyzers be used to distinguish severity levels, which is
unwieldy to implement and sounds more like a workaround than a
principle. I argue there is a principle here: that severity is
best determined by the user, not the analyzer itself.
This does require that drivers support some kind of filtering
or ranking based on Analyzer.Name and Diagnostic.Category.
Some already do; perhaps the unitchecker and multichecker
drivers should too.
Change-Id: I484877baf7963c444285f35c9f03ee3c5e6d7729
Reviewed-on: https://go-review.googlesource.com/c/tools/+/433536
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
After experimenting with the new t.Run+t.Parallel check in the
loopclosure analyzer, we discovered that users rely on the fact that
statements before the call to t.Parallel are executed synchronously, for
example by declaring test := test inside the function literal, but
before the call to t.Parallel.
To avoid such false positives, only consider statements occurring after
the first call to t.Parallel.
Change-Id: I88466ea3bfd318d42d734c320677fbe5e3f6cb00
Reviewed-on: https://go-review.googlesource.com/c/tools/+/433535
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 marker function collectCompletionItems required at least three
arguments. Express this in its signature, leaving a final variadic
argument for documentation. I considered just making this final argument
mandatory, but opted for minimizing the diff given that there are 400+
existing @item annotations.
With this change the only use of tests.Data.t is in mustRange. Since
conversion to range should always succeed, I switched this usage to a
panic and removed the t field.
For golang/go#54845
Change-Id: I407f07cb85fa1356ceb6dba366007f69d1b6a068
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432337
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
In order to narrow usage of tests.Data.t, use the mustRange helper in
more places.
For golang/go#54845
Change-Id: I446ca520fa76afb2bc10c1fd5a5765859176dd6a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432336
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
- simplify collection to use an expected span.Span and use mustRange
- remove the source_test.go version of the test, as it is redundant
For golang/go#54845
Change-Id: I3a7da8547e27dc157fb513486a151031ec135746
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432138
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The documentSymbols handler joined syntax information with type
information, meaning that it was only able to satisfy requests for files
in valid workspace packages. However, the value added by type
information was limited, and in many cases could be derived from syntax
alone. For example, while generating symbols for a const declaration, we
don't need the type checker to tell us that the symbol kind is const.
Refactor the documentSymbols handler to derive symbols from syntax
alone. This leads to some simplifications from the code, in addition to
eliminating the dependency on package data. Also, simplify symbol
details to just use types.ExprString, which includes some missing
information such as function return values. Also, update handling to
support Go 1.18 type embedding in interfaces.
Notably, this reverts decisions like golang/go#31202, in which we went to
effort to make the symbol kind more accurate. In my opinion (and the
opinion expressed in golang/go#52797), the cost of requiring type
information is not worth the minor improvement in accuracy of the symbol
kind, which (as far as I know) is only used for UI elements.
To facilitate testing (and start to clean up the test framework), make
several simplifications / improvements to the marker tests:
- simplify the collection of symbol data
- eliminate unused marks
- just use cmp.Diff for comparing results
- allow for arbitrary nesting of symbols.
- remove unnecessary @symbol annotations from workspace_symbol tests --
their data is not used by workspace_symbol handlers
- remove Symbol and WorkspaceSymbol handlers from source_test.go. On
inspection, these handlers were redundant with lsp_test.go.
Notably, the collection and assembly of @symbol annotations is still way
too complicated. It would be much simpler to just have a single golden
file summarizing the entire output, rather than weaving it together from
annotations. However, I realized this too late, and so it will have to
wait for a separate CL.
Fixesgolang/go#52797Fixesgolang/vscode-go#2242
Updates golang/go#54845
Change-Id: I3a2c2d39f59f9d045a6cedf8023ff0c80a69d974
Reviewed-on: https://go-review.googlesource.com/c/tools/+/405254
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
There was a bug where the code would try to access an out of bounds
index when trimming extra space and comments in extract. This change
also adds a regtest for extract.
Fixesgolang/go#55271
Change-Id: I7da716a6a68a9678011abf15def47acdea0b33fe
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432135
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Object resolution in go/types is more accurate than the purely syntactic
object resolution in go/parser (for example, golang/go#45160), and spans
multiple files. Use it for more accurate diagnostics in the loopclosure
analyzer.
Change-Id: I2160876dd4b3fd83aa07a9da971f27c17d7d6043
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432137
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Data.Golden is called from subtests: use the *testing.T from the caller,
so that we can get a more meaningful failure.
For golang/go#54845
Change-Id: I136df0c6a7a11bcf364b78ecac42ba2b51a15bb0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431844
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Add experimental new logic to the loopclosure analyzer that checks for
access to loop variables from parallel subtests. For now, this is gated
behind an internal variable so that we may experiment with it without
yet affecting cmd/vet.
Add an internal/loopclosure command that enables the experimental new
check.
Change-Id: Ibf7e388a58a2b3e712e66e095d06612cf3ea918c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/430916
Reviewed-by: David Chase <drchase@google.com>
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>
Clarify documentation around qualifiedObject and
its field invariants.
(Initially I tried to delete it but it's not so easy.)
Also, hoist KnownPackages et al outside of loop over
qualifiedIdentifiers in implementations() to avoid unnecessary
recomputation.
Change-Id: Idf087634b918a2277eabf8bbab2fdf49a8fc946c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431839
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
Disable logging for lsp tests: logs are not scoped to the failing test
and are therefore misleading.
For golang/go#54845
Change-Id: I232e4cfc114382121923e8e697452007793ec3c9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431843
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
When code was moved to the golang.org/x/tools/gopls module, the
gopls/test package tests we silently skipped, because of logic that
skipped the tests if the testdata directory was not found. Narrow that
check to only skip tests on android, which is where we expect testdata
to be missing.
Also, now that gopls code lives in the gopls module, there is little
reason to have two copies of the command-line tests. Delete
gopls/internal/lsp/cmd/cmd_test.go.
Change-Id: I6d57244dd77a983b1f83c1cf653d5345e4fa0434
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431842
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls needs to register that it is a codelensProvider.
Fixesgolang/go#55155
Change-Id: I91d6eb320871386175b2fb95ab5e9bf935a84014
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431837
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
CanExtract strips of the whitespace on either end of the range in
order to get an exact range to extract to function. We can do the
same thing for comments by moving adjusting the range if the start
or end positions contain the position.
Updates golang/go#37170Fixesgolang/go#54816
Change-Id: I3508c822434400f084a273730380c89611803e97
Reviewed-on: https://go-review.googlesource.com/c/tools/+/351989
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This log is noisy and of little value, often confusing users. Remove it.
Updates golang/go#51947
Change-Id: I2b2dff8383de52467bf3953d3efda4e6d4b792dd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431836
Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
When processing edits, they must be non-overlapping but they may be
adjacent: we must allow for insertions adjacent to replacements, e.g. an
edit of 3:1-3:1 followed by an edit of 3:1-3:15. Achieve this in the
fake editor by sorting edits by end position after start position.
Longer term, we should eliminate this ad-hoc editing in favor of
diff.ApplyEdit.
Change-Id: I72a252952585d0a652d97287486aa61c167db485
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431219
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dylan Le <dungtuanle@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Some of the json tags, especially for constructed structs, had improper
json tags (e.g., Range *Range `json:"Range"`, not `json:"range"). These
now start with lower-case letters.
Also, an optional field which is a struct type could be either
F FsType `json:"f,omitempty"`, or
F *FsType `json:"f,omitempty".
The second is generally better, as zero values should not be sent,
but there are many cases where the existing
code needs the first, to avoid allocations.
That is, if we're sending an empty optional field, there should be a *,
but if we're intializing a complicated structure (x.A.B.C.D = true, with
B and C optional) existing code wants no *. (These two cases could
conflict, and then the existing code would have to be changed.)
Fixesgolang/go#55099
Change-Id: I947a69322bcddf4c963d34662b72b464b738d17c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431218
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Add a TODO and wait for a shorter period of time following Kill, per
post-submit advice from bcmills on CL 424075.
For golang/go#54461
Change-Id: Ia0e388c0119660844dad32629ebca4f122fded12
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431075
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
The new LSP stubs were returning a "disabled" struct in CodeActions,
which is wrong, and this CL fixes.
Tested by hand.
Fixesgolang/go#55080
Change-Id: Id38df18f1e3f20ef2aa1cb1adfe96dacacad9ad6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/431216
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
When a go command hangs during gopls regression tests, print out
additional information about processes and file descriptors.
For golang/go#54461
Change-Id: I92aa4665e9056d15a274c154fce2783bed79718e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/424075
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This CL updates the LSP to 3.17.0. It is a DANGEROUS CL as the stubs
are being generated by Go code reading vscode's language independent
description of the protocol (in metaMode.json in the vscode-languageserver-node
repository.)
Some of the union types in the protocol have Go types with names containing 'Or'.
These types have custom marshaling and unmarshaling code.
Embedded structures in the protocol are broken out as their own
types, with names constructed from the context in which they occur.
The natural output has been modified to minimize the number of changes
needed for gopls. (e.g., Workspace6Gn is preserved for compatibility.0
Thus, many types that are union types in the LSP description have been replaced by the
types gopls already uses.
Updates golang/go#52969
Change-Id: I16f6d877215155ac9e782b0f5bcbdab3f1aa2593
Reviewed-on: https://go-review.googlesource.com/c/tools/+/424214
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL changes the default behavior of gopls to always publish
diagnostics for new file versions. In practice, this avoids stale
diagnostics in multiple LSP clients (golang/go#54983 has more details).
After this change, TestDownloadDeps was failing because it asserted on
the non-existence of published diagnostics. Update the test to treat an
empty diagnostic set the same as an unreceived diagnostic set.
Fixesgolang/go#54983
Change-Id: I41ed2f859b748e14585e7feb53702d3f38dcd599
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429935
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
This clears the diagnostics that were added by the `Check for
upgrades` codelens for the given go.mod file. The diagnostic
source for the diagnostics from `Check for upgrades` is now
modCheckUpgradesSource instead of modSource in order to allow
us to easily clear these diagnostics.
Fixesgolang/go#54065
Change-Id: I7c0824ce1fdfcf2a73ec83342501ceed82fc519f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426016
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
golang.org/x/text and golang.org/x/sync are direct dependencies.
Change-Id: I8fea3ddbbf5e2917e45a7a9a5b1d12310fe62c83
Reviewed-on: https://go-review.googlesource.com/c/tools/+/430275
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Now lsp packages are moved to the gopls module where the vulncheck
implementation exists. We no longer need to inject govulncheck
through the hook.
Change-Id: Ia627f1abe4c626d254d3e72b778535d6cb1ab41e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429938
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fix 1 - print usage info only when appropriate:
tool.CommandLineError is a special error that makes a command
exits with full usage documentation. When Govulncheck hook runs and
fails, it's unlikely the failure was from command line misuse
and the extra usage doc will distract users from the root cause.
Let's stop that by returning a plain error.
Fix 2 - stop printing package loading errors twice:
Package loading error was printed by the logger in gopls/internal/vulncheck.cmd
and once more by the gopls command line handler. Print it once.
For testing, added back the replace statement to go.mod.
We will update go.mod back after this commit is merged.
Change-Id: Ifaf569a31bbbc84d7b84e1b6d90a8fa0b27ac758
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429515
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429937
Only initialize *types.Info when there are []*ast.Files available.
Previously, when packages x and z, where x imports y and y imports z,
are loaded with packages.LoadSyntax and built with ssautil.Packages,
then package y will have *types.Info but no files.
If y has any globals initialized from a func variable, the bodies
of the function literals did not have type information and failed
to build.
Fixesgolang/go#53604
Change-Id: I3cce608d6a127ac44b65947b68cf0d748fc2dfc6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/422639
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Stop treating identical SuggestedFixes as overlapping text edits.
Packages can be loaded in multiple ways due to testing, e.g.
"p" and "p [p.test]". Currently SuggestedFixes from both are
considered overlapping and so are not applied.
Updates applyFixes() to report errors in more situations.
Fixesgolang/go#54740
Change-Id: I73acb3b73d88535144cfae5161faabb0615a1774
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426734
Reviewed-by: Abirdcfly Abirdcfly <fp544037857@gmail.com>
Run-TryBot: Tim King <taking@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
This CL implements the fake.Editor.RenameFile method, which mimic's the
behavior of VS Code when renaming files. Specifically:
- open buffers affected by the renaming are closed, and then reopened
with new URIs
- files are moved on disk
- didChangeWatchedFile notifications are sent
Along the way, add missing comments and fix one place where the editor
mutex was held while sending notifications (in Editor.CreateBuffer).
Generally, the editor should not hold any mutex while making a remote
call.
For golang/go#41567
Change-Id: I2abfa846e923de566a21c096502a68f125e7e671
Reviewed-on: https://go-review.googlesource.com/c/tools/+/427903
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
CL 428938 implements slice to array conversions in the type checkers,
per accepted proposal issue golang/go#46505. The disabled test was
expected to fail, but it won't fail anymore for Go 1.20 and higher.
Disable it for now (and track it in golang/go#54822) so we can make
progress with CL 428938.
For golang/go#46505.
For golang/go#54822.
Change-Id: I87fc78dccaa2bf1517cf875fec97855e360d0f25
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429295
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tim King <taking@google.com>
Following up on comments from CL 428595 and CL 426796, improve links to
'here', and update a stale comment on gopls' code location.
Updates golang/go#54509
Change-Id: Ie0e04b01b6e7193294fb9c39a809cee1a5b981c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429215
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>