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 <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Ian Cottrell 2019-07-15 12:59:09 -04:00
parent 919acb9f1f
commit 0b5a7f81db
1 changed files with 2 additions and 1 deletions

View File

@ -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)