mirror of https://github.com/golang/go.git
internal/lsp: two trivial cleanups from CL 219077
Change-Id: Ia55bfc4d8283589a7a70e2b7b2ed3265ead18d62 Reviewed-on: https://go-review.googlesource.com/c/tools/+/219378 Run-TryBot: Peter Weinberger <pjw@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
63d1300efe
commit
e3acd584e2
|
|
@ -69,9 +69,7 @@ func (r *prepareRename) Run(ctx context.Context, args ...string) error {
|
|||
return fmt.Errorf("request is not valid at the given position")
|
||||
}
|
||||
|
||||
resRange := *result
|
||||
|
||||
l := protocol.Location{Range: resRange}
|
||||
l := protocol.Location{Range: *result}
|
||||
s, err := file.mapper.Span(l)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -719,16 +719,15 @@ func (r *runner) PrepareRename(t *testing.T, src span.Span, want *source.Prepare
|
|||
}
|
||||
return
|
||||
}
|
||||
xx := got
|
||||
if xx.Start == xx.End {
|
||||
if got.Start == got.End {
|
||||
// Special case for 0-length ranges. Marks can't specify a 0-length range,
|
||||
// so just compare the start.
|
||||
if xx.Start != want.Range.Start {
|
||||
t.Errorf("prepare rename failed: incorrect point, got %v want %v", xx.Start, want.Range.Start)
|
||||
if got.Start != want.Range.Start {
|
||||
t.Errorf("prepare rename failed: incorrect point, got %v want %v", got.Start, want.Range.Start)
|
||||
}
|
||||
} else {
|
||||
if protocol.CompareRange(*xx, want.Range) != 0 {
|
||||
t.Errorf("prepare rename failed: incorrect range got %v want %v", *xx, want.Range)
|
||||
if protocol.CompareRange(*got, want.Range) != 0 {
|
||||
t.Errorf("prepare rename failed: incorrect range got %v want %v", *got, want.Range)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue