Make edits to AST and then use formatter

This commit is contained in:
Misode
2024-10-23 06:10:14 +02:00
parent a0f3e71000
commit 18332b9dbc
5 changed files with 47 additions and 45 deletions

View File

@@ -119,7 +119,7 @@ export function SchemaGenerator({ gen, allowedVersions }: Props) {
return
}
Analytics.undoGenerator(gen.id, 1, 'menu')
await service.undoEdits(uri)
await service.undoEdit(uri)
}
const redo = async (e: MouseEvent) => {
e.stopPropagation()
@@ -127,7 +127,7 @@ export function SchemaGenerator({ gen, allowedVersions }: Props) {
return
}
Analytics.redoGenerator(gen.id, 1, 'menu')
await service?.redoEdits(uri)
await service?.redoEdit(uri)
}
useEffect(() => {
@@ -137,10 +137,10 @@ export function SchemaGenerator({ gen, allowedVersions }: Props) {
}
if (e.ctrlKey && e.key === 'z') {
Analytics.undoGenerator(gen.id, 1, 'hotkey')
await service.undoEdits(uri)
await service.undoEdit(uri)
} else if (e.ctrlKey && e.key === 'y') {
Analytics.redoGenerator(gen.id, 1, 'hotkey')
await service.redoEdits(uri)
await service.redoEdit(uri)
}
}
const onKeyDown = (e: KeyboardEvent) => {