Skip to content

Commit

Permalink
gopls/internal/golang: downgrade bug report in ExtractToNewFile
Browse files Browse the repository at this point in the history
While we shouldn't serve 'extract' code actions containing an invalid
range, we also as a matter of principle should not report bugs for
invalid commands from the client, even if for well-behaved clients they
should only originate from our own code action.

In other words, this could easily be a manifestation of a client bug,
and we should focus our attention on certain gopls bugs.

Fixes golang/go#71473

Change-Id: Id740d03e5043dc17c6ed50a9f9c767f9de445ed5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/645875
Reviewed-by: Alan Donovan <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
findleyr committed Jan 31, 2025
1 parent 5ffcf75 commit 51f179c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gopls/internal/golang/extracttofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func ExtractToNewFile(ctx context.Context, snapshot *cache.Snapshot, fh file.Han

start, end, firstSymbol, ok := selectedToplevelDecls(pgf, start, end)
if !ok {
return nil, bug.Errorf("invalid selection")
return nil, fmt.Errorf("invalid selection")
}
pgf.CheckPos(start) // #70553
// Inv: start is valid wrt pgf.Tok.
Expand Down

0 comments on commit 51f179c

Please sign in to comment.