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>
diff --git a/internal/lsp/command.go b/internal/lsp/command.go
index 2b51dd7..7c7bc44 100644
--- a/internal/lsp/command.go
+++ b/internal/lsp/command.go
@@ -150,7 +150,7 @@
 		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)