mirror of
https://github.com/golang/go
synced 2024-09-30 14:28:33 -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:
parent
77f530d86f
commit
b8e13e1a4d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user