internal/lsp/cache: delete a few unused functions

Change-Id: I723ae6d2676bdbb4cfc0fec339e87604a032e807
Reviewed-on: https://go-review.googlesource.com/c/tools/+/216725
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
Rebecca Stambler 2020-01-28 20:38:33 -05:00
parent 207d3de1fa
commit 11f6c2ac6d
2 changed files with 1 additions and 36 deletions

View File

@ -480,13 +480,6 @@ func (s *snapshot) addID(uri span.URI, id packageID) {
s.ids[uri] = append(s.ids[uri], id)
}
func (s *snapshot) getIDs(uri span.URI) []packageID {
s.mu.Lock()
defer s.mu.Unlock()
return s.ids[uri]
}
func (s *snapshot) isWorkspacePackage(id packageID) (packagePath, bool) {
s.mu.Lock()
defer s.mu.Unlock()
@ -495,17 +488,6 @@ func (s *snapshot) isWorkspacePackage(id packageID) (packagePath, bool) {
return scope, ok
}
func (s *snapshot) getFileURIs() []span.URI {
s.mu.Lock()
defer s.mu.Unlock()
var uris []span.URI
for uri := range s.files {
uris = append(uris, uri)
}
return uris
}
// GetFile returns a File for the given URI. It will always succeed because it
// adds the file to the managed set if needed.
func (s *snapshot) GetFile(uri span.URI) (source.FileHandle, error) {
@ -513,24 +495,13 @@ func (s *snapshot) GetFile(uri span.URI) (source.FileHandle, error) {
if err != nil {
return nil, err
}
return s.getFileHandle(f), nil
}
func (s *snapshot) getFileHandle(f *fileBase) source.FileHandle {
s.mu.Lock()
defer s.mu.Unlock()
if _, ok := s.files[f.URI()]; !ok {
s.files[f.URI()] = s.view.session.GetFile(f.URI())
}
return s.files[f.URI()]
}
func (s *snapshot) findFileHandle(f *fileBase) source.FileHandle {
s.mu.Lock()
defer s.mu.Unlock()
return s.files[f.URI()]
return s.files[f.URI()], nil
}
func (s *snapshot) awaitLoaded(ctx context.Context) error {

View File

@ -404,12 +404,6 @@ func (v *view) buildProcessEnv(ctx context.Context) (*imports.ProcessEnv, error)
return env, nil
}
func (v *view) fileVersion(filename string) string {
uri := span.FileURI(filename)
fh := v.session.GetFile(uri)
return fh.Identity().String()
}
func (v *view) mapFile(uri span.URI, f *fileBase) {
v.filesByURI[uri] = f
if f.addURI(uri) == 1 {