mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 23:25:14 +00:00
Fix autofix capabilities in playground (#5375)
## Summary
These had just bitrotted over time -- we were no longer passing along
the row-and-column indices, etc.
## Test Plan

This commit is contained in:
parent
8a1bb7a5af
commit
d53b986fd4
2 changed files with 27 additions and 13 deletions
|
@ -54,7 +54,7 @@ export default function SourceEditor({
|
|||
provideCodeActions: function (model, position) {
|
||||
const actions = diagnostics
|
||||
.filter((check) => position.startLineNumber === check.location.row)
|
||||
.filter((check) => check.fix)
|
||||
.filter(({ fix }) => fix)
|
||||
.map((check) => ({
|
||||
title: check.fix
|
||||
? check.fix.message
|
||||
|
@ -71,11 +71,11 @@ export default function SourceEditor({
|
|||
edit: {
|
||||
range: {
|
||||
startLineNumber: edit.location.row,
|
||||
startColumn: edit.location.column + 1,
|
||||
startColumn: edit.location.column,
|
||||
endLineNumber: edit.end_location.row,
|
||||
endColumn: edit.end_location.column + 1,
|
||||
endColumn: edit.end_location.column,
|
||||
},
|
||||
text: edit.content,
|
||||
text: edit.content || "",
|
||||
},
|
||||
})),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue