internal/lsp: correct typo

Misspelled 'gcOptimizationDetails'. (auto-completion helped.)

Change-Id: I496de8f1749768e5bc0037821fe1672ba605d605
Reviewed-on: https://go-review.googlesource.com/c/tools/+/265779
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Peter Weinberger <pjw@google.com>
This commit is contained in:
Peter Weinbergr 2020-10-28 08:18:41 -04:00 committed by Peter Weinberger
parent 0dcbe3655a
commit dc70f74c71
3 changed files with 14 additions and 14 deletions

View File

@ -201,10 +201,10 @@ func (s *Server) runCommand(ctx context.Context, work *workDone, command *source
}
pkgDir := span.URIFromPath(filepath.Dir(fileURI.Filename()))
s.gcOptimizationDetailsMu.Lock()
if _, ok := s.gcOptimizatonDetails[pkgDir]; ok {
delete(s.gcOptimizatonDetails, pkgDir)
if _, ok := s.gcOptimizationDetails[pkgDir]; ok {
delete(s.gcOptimizationDetails, pkgDir)
} else {
s.gcOptimizatonDetails[pkgDir] = struct{}{}
s.gcOptimizationDetails[pkgDir] = struct{}{}
}
s.gcOptimizationDetailsMu.Unlock()
// need to recompute diagnostics.

View File

@ -224,7 +224,7 @@ If you believe this is a mistake, please file an issue: https://github.com/golan
if gcDetailsDir == "" {
dirURI := span.URIFromPath(filepath.Dir(pgf.URI.Filename()))
s.gcOptimizationDetailsMu.Lock()
_, ok := s.gcOptimizatonDetails[dirURI]
_, ok := s.gcOptimizationDetails[dirURI]
s.gcOptimizationDetailsMu.Unlock()
if ok {
gcDetailsDir = dirURI

View File

@ -23,15 +23,15 @@ const concurrentAnalyses = 1
// messages on on the supplied stream.
func NewServer(session source.Session, client protocol.Client) *Server {
return &Server{
delivered: make(map[span.URI]sentDiagnostics),
gcOptimizatonDetails: make(map[span.URI]struct{}),
watchedDirectories: make(map[span.URI]struct{}),
changedFiles: make(map[span.URI]struct{}),
session: session,
client: client,
diagnosticsSema: make(chan struct{}, concurrentAnalyses),
progress: newProgressTracker(client),
debouncer: newDebouncer(),
delivered: make(map[span.URI]sentDiagnostics),
gcOptimizationDetails: make(map[span.URI]struct{}),
watchedDirectories: make(map[span.URI]struct{}),
changedFiles: make(map[span.URI]struct{}),
session: session,
client: client,
diagnosticsSema: make(chan struct{}, concurrentAnalyses),
progress: newProgressTracker(client),
debouncer: newDebouncer(),
}
}
@ -93,7 +93,7 @@ type Server struct {
// optimization details to be included in the diagnostics. The key is the
// directory of the package.
gcOptimizationDetailsMu sync.Mutex
gcOptimizatonDetails map[span.URI]struct{}
gcOptimizationDetails map[span.URI]struct{}
// diagnosticsSema limits the concurrency of diagnostics runs, which can be expensive.
diagnosticsSema chan struct{}