Skip to content

Commit b8e13e1

Browse files
leitzlerstamblerre
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 77f530d commit b8e13e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/lsp/code_action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func convenienceFixes(ctx context.Context, snapshot source.Snapshot, ph source.P
332332
case fillstruct.Analyzer.Name:
333333
arg, err := json.Marshal(CommandRangeArgument{
334334
URI: protocol.URIFromSpanURI(d.URI),
335-
Range: rng,
335+
Range: d.Range,
336336
})
337337
if err != nil {
338338
return nil, err

0 commit comments

Comments
 (0)