1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00

internal/lsp: return the actual range from convenience code actions

Convenience code actions operates at line-by-line, but a line can
contain more than one fix.

To be able to tell them apart each response now return the actual
range as reported by the analyzer.

Fixes golang/go#40328

Change-Id: I9ffe4737653d2a5a6dafc3574e74975a71c71937
Reviewed-on: https://go-review.googlesource.com/c/tools/+/243877
Run-TryBot: Pontus Leitzler <leitzler@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Pontus Leitzler 2020-07-21 12:54:39 +02:00 committed by Rebecca Stambler
parent 77f530d86f
commit b8e13e1a4d

View File

@ -332,7 +332,7 @@ func convenienceFixes(ctx context.Context, snapshot source.Snapshot, ph source.P
case fillstruct.Analyzer.Name:
arg, err := json.Marshal(CommandRangeArgument{
URI: protocol.URIFromSpanURI(d.URI),
Range: rng,
Range: d.Range,
})
if err != nil {
return nil, err