diff --git a/internal/lsp/cache/workspace.go b/internal/lsp/cache/workspace.go index 4d05adc5eb..efaa38cafc 100644 --- a/internal/lsp/cache/workspace.go +++ b/internal/lsp/cache/workspace.go @@ -308,11 +308,6 @@ func isGoMod(uri span.URI) bool { return filepath.Base(uri.Filename()) == "go.mod" } -// isGoMod reports if uri is a go.sum file. -func isGoSum(uri span.URI) bool { - return filepath.Base(uri.Filename()) == "go.sum" -} - // fileExists reports if the file uri exists within source. func fileExists(ctx context.Context, uri span.URI, source source.FileSource) (bool, error) { fh, err := source.GetFile(ctx, uri) diff --git a/internal/lsp/general.go b/internal/lsp/general.go index 620140c91f..3b940b827f 100644 --- a/internal/lsp/general.go +++ b/internal/lsp/general.go @@ -13,7 +13,6 @@ import ( "os" "path" "path/filepath" - "strings" "sync" "golang.org/x/tools/internal/event" @@ -409,11 +408,6 @@ func (s *Server) registerWatchedDirectoriesLocked(ctx context.Context, dirs map[ return nil } -func isSubdirectory(root, leaf string) bool { - rel, err := filepath.Rel(root, leaf) - return err == nil && !strings.HasPrefix(rel, "..") -} - func (s *Server) fetchConfig(ctx context.Context, name string, folder span.URI, o *source.Options) error { if !s.session.Options().ConfigurationSupported { return nil diff --git a/internal/lsp/semantic.go b/internal/lsp/semantic.go index b669fabaff..48700d2c58 100644 --- a/internal/lsp/semantic.go +++ b/internal/lsp/semantic.go @@ -126,8 +126,6 @@ const ( tokOperator tokenType = "operator" ) -var lastPosition token.Position - func (e *encoded) token(start token.Pos, leng int, typ tokenType, mods []string) { if start == 0 { e.unexpected("token at token.NoPos")