fix(query): preserve selected statement source range
This commit is contained in:
1 parent
6bd49fcd19
commit
8cebc4a366
10 files changed
+127
-32
No files matched your search
@@ -8,6 +8,8 @@ export interface SqlExecutionSnapshot {
|
||||
fullSql: string;
|
||||
selectedSql: string;
|
||||
cursorPos: number;
|
||||
selectionFrom: number;
|
||||
selectionTo: number;
|
||||
}
|
||||
|
||||
export type SqlExecutionOverride = string | SqlExecutionSnapshot;
|
||||
@@ -35,7 +37,7 @@ export interface SqlExecutionChoiceRequest {
|
||||
}
|
||||
|
||||
export function isSqlExecutionSnapshot(value: SqlExecutionOverride | undefined): value is SqlExecutionSnapshot {
|
||||
return typeof value === "object" && value !== null && typeof value.fullSql === "string" && typeof value.selectedSql === "string" && typeof value.cursorPos === "number";
|
||||
return typeof value === "object" && value !== null && typeof value.fullSql === "string" && typeof value.selectedSql === "string" && typeof value.cursorPos === "number" && typeof value.selectionFrom === "number" && typeof value.selectionTo === "number";
|
||||
}
|
||||
|
||||
export function resolveExecutableSql(fullSql: string, selectedSql: string, options?: { mode?: ExecuteMode; cursorPos?: number }): string {
|
||||
|
||||
Reference in new issue
Block a user