diff --git a/internal/lsp/command.go b/internal/lsp/command.go index 328ba92dda..398b2a5c80 100644 --- a/internal/lsp/command.go +++ b/internal/lsp/command.go @@ -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. diff --git a/internal/lsp/diagnostics.go b/internal/lsp/diagnostics.go index d0dcb27480..ca560d3c4b 100644 --- a/internal/lsp/diagnostics.go +++ b/internal/lsp/diagnostics.go @@ -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 diff --git a/internal/lsp/server.go b/internal/lsp/server.go index dceb2a7b29..763f4d176d 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -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{}