feat(sql-library): show matching line snippets with jump in search

This commit is contained in:
lxk955 authored and GitHub committed 2026-10-01 23:47:24 +08:00
1 parent eeeb67e62c
commit 51f9dfc854
19 files changed
+686 -106

No files matched your search

+6 -1
View File
@@ -212,8 +212,9 @@ interface BuildQueryResultExportRequestOptions {
insertMode?: SqlInsertMode;
}
interface OpenSavedSqlOptions {
export interface OpenSavedSqlOptions {
targetMode?: SavedSqlOpenTargetMode;
reveal?: { line: number; column?: number };
}
interface OpenObjectSourceTabOptions {
@@ -5432,6 +5433,9 @@ export const useQueryStore = defineStore("query", () => {
existing.editorViewport = restored.viewport;
}
applySavedSqlExecutionTarget(existing, target);
if (options.reveal) {
existing.editorRevealRequest = { id: ++contentRevealSeq, line: options.reveal.line, column: options.reveal.column };
}
switchTab(existing.id);
return existing.id;
}
@@ -5455,6 +5459,7 @@ export const useQueryStore = defineStore("query", () => {
isExplaining: false,
mode: "query",
autoCommit: defaultAutoCommitForDbTypeWithSetting(dbType),
editorRevealRequest: options.reveal ? { id: ++contentRevealSeq, line: options.reveal.line, column: options.reveal.column } : undefined,
editorSelection: restoredPosition.selection,
editorViewport: restoredPosition.viewport,
};