mirror of
https://github.com/golang/go
synced 2024-11-18 18:34:40 -07:00
internal/lsp: fix diagnostics on didChange
I introduced a bug in the way that diagnostics are computed after a didChange event in CL 208099. This will fix it. Whoever sees this first tomorrow, feel free to LGTM and submit this CL. Change-Id: I324c1185df456c2c5c2423fc7322b959e0117218 Reviewed-on: https://go-review.googlesource.com/c/tools/+/208262 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rohan Challa <rohan@golang.org>
This commit is contained in:
parent
947d4aa893
commit
82924fac8e
@ -72,8 +72,6 @@ func (s *Server) didChange(ctx context.Context, params *protocol.DidChangeTextDo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
snapshot := view.Snapshot()
|
||||
|
||||
wasFirstChange, err := view.SetContent(ctx, uri, params.TextDocument.Version, []byte(text))
|
||||
if err != nil {
|
||||
return err
|
||||
@ -89,7 +87,7 @@ func (s *Server) didChange(ctx context.Context, params *protocol.DidChangeTextDo
|
||||
}
|
||||
|
||||
// Run diagnostics on the newly-changed file.
|
||||
go s.diagnostics(snapshot, uri)
|
||||
go s.diagnostics(view.Snapshot(), uri)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user