internal/lsp: remove dead code

Running `staticcheck ./internal/lsp/...` turned up a few instances of
dead code. Remove them.

Change-Id: Ic53db59cd0959fad960b086158eb550a624a4d91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/268580
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
Rob Findley 2020-11-09 20:51:46 -05:00 committed by Robert Findley
parent 092357f697
commit 7099162a90
3 changed files with 0 additions and 13 deletions

View File

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

View File

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

View File

@ -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")