feat(editor): support executing all SQL from blank lines

This commit is contained in:
zipg authored and GitHub committed 2026-08-10 18:26:39 +08:00
1 parent a9736f0ffc
commit a83f32d13f
18 files changed
+82 -11

No files matched your search

@@ -23,6 +23,13 @@ describe("executionCandidateForMode", () => {
expect(executionCandidateForMode([all], "all")).toBe(all);
});
it("falls back to all SQL only when blank-line execution is enabled", () => {
const all = candidate("all", ["all"]);
expect(executionCandidateForMode([all], "current", { executeAllOnBlankLine: false })).toBeNull();
expect(executionCandidateForMode([all], "current", { executeAllOnBlankLine: true })).toBe(all);
});
it("uses the deduplicated candidate when one statement is both current and all", () => {
const currentAndAll = candidate("all", ["cursor", "all"]);
@@ -1321,6 +1321,7 @@ WHERE t2.product_name = '12345'
expect(candidateKinds(candidates)).toEqual(["all"]);
expect(candidates[0].supportedKinds).toEqual(["all"]);
expect(executionCandidateForMode(candidates, "current")).toBeNull();
expect(executionCandidateForMode(candidates, "current", { executeAllOnBlankLine: true })).toBe(candidates[0]);
expect(executionCandidateForMode(candidates, "all")).toBe(candidates[0]);
});