fix(editor): preserve current SQL execution boundaries

This commit is contained in:
zipg authored and GitHub committed 2026-08-04 00:37:42 +08:00
1 parent c9764be9a0
commit a6f1a9a871
13 files changed
+232 -44

No files matched your search

@@ -1,7 +1,9 @@
import type { SqlTextRange } from "@/lib/sql/sqlStatementRanges";
import { trailingStatementDelimiterPosition, type StatementDelimiterDocument } from "@/lib/sql/statementDelimiter";
export function currentStatementFrameRangeTo(nextChar: string, range: SqlTextRange): number {
return nextChar === ";" ? range.to + 1 : range.to;
export function currentStatementFrameRangeTo(doc: StatementDelimiterDocument, range: SqlTextRange): number {
const delimiterPos = trailingStatementDelimiterPosition(doc, range.to);
return delimiterPos === null ? range.to : delimiterPos + 1;
}
export function shouldRebuildCurrentStatementFrame(update: { docChanged: boolean; selectionSet: boolean; configurationChanged: boolean }): boolean {