From f0068bd333b234c38cb0ed6b2946665a40ad171b Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Tue, 15 Oct 2019 14:47:05 -0400 Subject: [PATCH] internal/lsp: remove misleading check span This span resulted in misleading information, since it would appear any time you called the Check function. This function often returns cached results, so it's not particularly useful. Change-Id: I26be652a99b906fb2e8703ff9af86fbe2ef5fc5d Reviewed-on: https://go-review.googlesource.com/c/tools/+/201219 Run-TryBot: Rebecca Stambler Reviewed-by: Michael Matloob TryBot-Result: Gobot Gobot --- internal/lsp/cache/check.go | 3 --- internal/lsp/cache/pkg.go | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/lsp/cache/check.go b/internal/lsp/cache/check.go index 620f3021a1..d22be51329 100644 --- a/internal/lsp/cache/check.go +++ b/internal/lsp/cache/check.go @@ -174,9 +174,6 @@ func (cph *checkPackageHandle) Check(ctx context.Context) (source.Package, error } func (cph *checkPackageHandle) check(ctx context.Context) (*pkg, error) { - ctx, done := trace.StartSpan(ctx, "cache.checkPackageHandle.check", telemetry.Package.Of(cph.m.id)) - defer done() - v := cph.handle.Get(ctx) if v == nil { return nil, errors.Errorf("no package for %s", cph.m.id) diff --git a/internal/lsp/cache/pkg.go b/internal/lsp/cache/pkg.go index 9b3256a4ea..d570cbaf46 100644 --- a/internal/lsp/cache/pkg.go +++ b/internal/lsp/cache/pkg.go @@ -23,9 +23,10 @@ type pkg struct { view *view // ID and package path have their own types to avoid being used interchangeably. - id packageID - mode source.ParseMode - pkgPath packagePath + id packageID + pkgPath packagePath + mode source.ParseMode + files []source.ParseGoHandle errors []packages.Error imports map[packagePath]*pkg