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

![Screen Shot 2023-06-26 at 12 03 41
PM](6791330d-010b-45d3-91ef-531d4745193f)
This commit is contained in:
Charlie Marsh 2023-06-26 12:40:28 -04:00 committed by GitHub
parent 8a1bb7a5af
commit d53b986fd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 13 deletions

View file

@ -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 || "",
},
})),
}