From 0b5a7f81db506d65ef355dcd89d4fba30f623e99 Mon Sep 17 00:00:00 2001 From: Ian Cottrell Date: Mon, 15 Jul 2019 12:59:09 -0400 Subject: [PATCH] internal/lsp: add tracing to the didOpen call We only had the tracing on didChange before this Change-Id: Iadec8a43d439931bf58925f149a1d32b3ae29c36 Reviewed-on: https://go-review.googlesource.com/c/tools/+/186199 Run-TryBot: Ian Cottrell Reviewed-by: Rebecca Stambler --- internal/lsp/text_synchronization.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/lsp/text_synchronization.go b/internal/lsp/text_synchronization.go index fb7608d6..6544010b 100644 --- a/internal/lsp/text_synchronization.go +++ b/internal/lsp/text_synchronization.go @@ -31,6 +31,8 @@ func (s *Server) didOpen(ctx context.Context, params *protocol.DidOpenTextDocume view := s.session.ViewOf(uri) go func() { ctx := view.BackgroundContext() + ctx, done := trace.StartSpan(ctx, "lsp:background-worker") + defer done() s.Diagnostics(ctx, view, uri) }() return nil @@ -69,7 +71,6 @@ func (s *Server) didChange(ctx context.Context, params *protocol.DidChangeTextDo // Run diagnostics on the newly-changed file. go func() { ctx := view.BackgroundContext() - //TODO: connect the remote span? ctx, done := trace.StartSpan(ctx, "lsp:background-worker") defer done() s.Diagnostics(ctx, view, uri)