mirror of
https://github.com/golang/go
synced 2024-11-18 10:54:40 -07:00
internal/lsp: use URI as key in gc optimization details map
Packages that have gc_details enabled is stored internally in a map[span.URI]struct{}, but when toggling on/off via ExecuteCommand, the scheme is lost. The mismatch lead to no diagnostics from gc_details. This fix uses span.URIFromPath() to parse the file path, so that the internal keys are found when diagnostics are calculated. Change-Id: I53b4e869625251c366b12b570eb03212319d2770 Reviewed-on: https://go-review.googlesource.com/c/tools/+/245858 Run-TryBot: Pontus Leitzler <leitzler@gmail.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
644d416712
commit
fe6bb45d21
@ -150,7 +150,7 @@ func (s *Server) executeCommand(ctx context.Context, params *protocol.ExecuteCom
|
||||
if err := source.UnmarshalArgs(params.Arguments, &fileURI); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pkgDir := span.URI(path.Dir(fileURI.Filename()))
|
||||
pkgDir := span.URIFromPath(path.Dir(fileURI.Filename()))
|
||||
s.gcOptimizationDetailsMu.Lock()
|
||||
if _, ok := s.gcOptimizatonDetails[pkgDir]; ok {
|
||||
delete(s.gcOptimizatonDetails, pkgDir)
|
||||
|
Loading…
Reference in New Issue
Block a user