[tools] gopls: WIP for v0.23.0 DO NOT SUBMIT

0 views
Skip to first unread message

Peter Weinberger (Gerrit)

unread,
May 11, 2026, 11:31:39 AM (13 hours ago) May 11
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, Alan Donovan, golang-co...@googlegroups.com

Peter Weinberger submitted the change with unreviewed changes

Unreviewed changes

14 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: internal/imports/imports.go
Insertions: 1, Deletions: 1.

@@ -76,7 +76,7 @@
func FixImports(ctx context.Context, filename string, src []byte, goroot string, logf func(string, ...any), source Source) (fixes []*ImportFix, err error) {
if source == nil {
// In case someone adds a defective call from a new place
- return nil, fmt.Errorf("source is nil")
+ panic("source is nil")
}
ctx, done := event.Start(ctx, "imports.FixImports")
defer done()
```

Change information

Commit message:
gopls: deprecate importsSource and remove its use

The experimental option importsSource is no longer needed.
It controlled the use of an index in the user's module cache to satisfy
unimported completions. This is now used by default, if the user has
a module cache. Unimported completions will fail silently if the user does
not have a module cache, as can happen with some build configurations.
(Of course users without a module cache cannot satisfy unimported completions,
Now there will be no messages about, nor attempts to build an index.)

This change removes three hundred lines of code in completions.go
Change-Id: I2183fef846da3f060cc16bd8cd5e476d041efc4c
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M gopls/internal/cache/session.go
  • M gopls/internal/cache/source.go
  • M gopls/internal/cache/view.go
  • M gopls/internal/golang/completion/completion.go
  • M gopls/internal/golang/format.go
  • M gopls/internal/golang/rename.go
  • M gopls/internal/settings/settings.go
  • M gopls/internal/test/integration/misc/imports_test.go
  • M gopls/internal/test/marker/testdata/completion/issue59096.txt
  • M gopls/internal/test/marker/testdata/completion/issue60545.txt
  • M gopls/internal/test/marker/testdata/completion/randv2.txt
  • M gopls/internal/test/marker/testdata/completion/unimported.txt
  • M internal/imports/fix.go
  • M internal/imports/imports.go
Change size: L
Delta: 14 files changed, 107 insertions(+), 434 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I2183fef846da3f060cc16bd8cd5e476d041efc4c
Gerrit-Change-Number: 762160
Gerrit-PatchSet: 17
Gerrit-Owner: Peter Weinberger <p...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Peter Weinberger <p...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages