fix(query): preserve selected statement source range

This commit is contained in:
t8y2 committed 2026-07-13 19:57:35 +08:00
1 parent 6bd49fcd19
commit 8cebc4a366
10 files changed
+127 -32

No files matched your search

@@ -1109,10 +1109,13 @@ function executableSqlFromView(currentView: EditorViewType): string {
}
function sqlExecutionSnapshotFromView(currentView: EditorViewType): SqlExecutionSnapshot {
const selection = currentView.state.selection.main;
return {
fullSql: currentView.state.doc.toString(),
selectedSql: selectedSqlFromView(currentView),
cursorPos: currentView.state.selection.main.head,
cursorPos: selection.head,
selectionFrom: selection.from,
selectionTo: selection.to,
};
}