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
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