feat(query): jump to PostgreSQL error position from result messages

This commit is contained in:
amwps290 authored and GitHub committed 2026-09-15 17:39:59 +08:00
1 parent 571fc07d85
commit 5a0e74eec6
36 files changed
+2079 -23

No files matched your search

@@ -1118,6 +1118,17 @@ function focusStatementRange(range: { from: number; to: number } | null) {
currentView.focus();
}
function focusErrorPosition(offset: number) {
const currentView = view.value;
if (!currentView || !editorViewModule) return;
const errorPos = Math.max(0, Math.min(offset, currentView.state.doc.length));
currentView.dispatch({
selection: { anchor: errorPos },
effects: [editorViewModule.EditorView.scrollIntoView(errorPos, { y: "center" })],
});
currentView.focus();
}
function onPickerActiveIndexChange(index: number) {
pickerActiveIndex.value = index;
const candidate = pickerCandidates.value[index];
@@ -7553,6 +7564,7 @@ defineExpose({
captureExecutionSnapshot,
pasteClipboardAsSqlInCondition,
focusStatementRange,
focusErrorPosition,
previewStatementRange,
refreshCompletionCache,
});