diff --git a/gopls/internal/regtest/modfile_test.go b/gopls/internal/regtest/modfile_test.go index aa5e8641e4..11fe3021a4 100644 --- a/gopls/internal/regtest/modfile_test.go +++ b/gopls/internal/regtest/modfile_test.go @@ -311,10 +311,6 @@ package main func main() { fmt.Println(blah.Name) -` - const want = `module mod.com - -go 1.12 ` runner.Run(t, mod, func(t *testing.T, env *Env) { env.Await(env.DiagnosticAtRegexp("go.mod", "require")) diff --git a/internal/lsp/analysis/simplifycompositelit/simplifycompositelit.go b/internal/lsp/analysis/simplifycompositelit/simplifycompositelit.go index eae53db9a5..c91fc7577a 100644 --- a/internal/lsp/analysis/simplifycompositelit/simplifycompositelit.go +++ b/internal/lsp/analysis/simplifycompositelit/simplifycompositelit.go @@ -14,8 +14,6 @@ import ( "go/printer" "go/token" "reflect" - "unicode" - "unicode/utf8" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/analysis/passes/inspect" @@ -189,16 +187,10 @@ func match(pattern, val reflect.Value) bool { return p.Interface() == v.Interface() } -func isWildcard(s string) bool { - rune, size := utf8.DecodeRuneInString(s) - return size == len(s) && unicode.IsLower(rune) -} - // Values/types for special cases. var ( identType = reflect.TypeOf((*ast.Ident)(nil)) objectPtrType = reflect.TypeOf((*ast.Object)(nil)) positionType = reflect.TypeOf(token.NoPos) callExprType = reflect.TypeOf((*ast.CallExpr)(nil)) - scopePtrType = reflect.TypeOf((*ast.Scope)(nil)) ) diff --git a/internal/lsp/cache/check.go b/internal/lsp/cache/check.go index 2a6210cd74..25f314786e 100644 --- a/internal/lsp/cache/check.go +++ b/internal/lsp/cache/check.go @@ -366,7 +366,7 @@ func typeCheck(ctx context.Context, snapshot *snapshot, m *metadata, mode source if found { return pkg, nil } - return nil, errors.Errorf("no parsed files for package %s, expected: %s, list errors: %v", pkg.m.pkgPath, pkg.compiledGoFiles, rawErrors) + return nil, errors.Errorf("no parsed files for package %s, expected: %v, list errors: %v", pkg.m.pkgPath, pkg.compiledGoFiles, rawErrors) } else { pkg.types = types.NewPackage(string(m.pkgPath), string(m.name)) } diff --git a/internal/lsp/cache/session.go b/internal/lsp/cache/session.go index c1704e321e..457b422957 100644 --- a/internal/lsp/cache/session.go +++ b/internal/lsp/cache/session.go @@ -512,14 +512,6 @@ func (s *Session) DidModifyFiles(ctx context.Context, changes []source.FileModif return snapshots, releases, deletionsSlice, nil } -func (s *Session) isOpen(uri span.URI) bool { - s.overlayMu.Lock() - defer s.overlayMu.Unlock() - - _, open := s.overlays[uri] - return open -} - func (s *Session) updateOverlays(ctx context.Context, changes []source.FileModification) (map[span.URI]*overlay, error) { s.overlayMu.Lock() defer s.overlayMu.Unlock() diff --git a/internal/lsp/cmd/test/cmdtest.go b/internal/lsp/cmd/test/cmdtest.go index cdda08b362..457fdbb17f 100644 --- a/internal/lsp/cmd/test/cmdtest.go +++ b/internal/lsp/cmd/test/cmdtest.go @@ -17,7 +17,6 @@ import ( "sync" "testing" - "golang.org/x/tools/go/packages/packagestest" "golang.org/x/tools/internal/jsonrpc2/servertest" "golang.org/x/tools/internal/lsp/cache" "golang.org/x/tools/internal/lsp/cmd" @@ -31,7 +30,6 @@ import ( ) type runner struct { - exporter packagestest.Exporter data *tests.Data ctx context.Context options func(*source.Options) diff --git a/internal/lsp/source/workspace_symbol.go b/internal/lsp/source/workspace_symbol.go index daff462362..25010de7f8 100644 --- a/internal/lsp/source/workspace_symbol.go +++ b/internal/lsp/source/workspace_symbol.go @@ -140,9 +140,6 @@ func bestMatch(fullPath string, matcher matcherFunc) (string, float64) { // * A symbolizer determines how we extract the symbol for an object. This // enables the 'symbolStyle' configuration option. type symbolCollector struct { - // query is the user-supplied query passed to the Symbol method. - query string - // These types parameterize the symbol-matching pass. matcher matcherFunc symbolizer symbolizer