|
@@ -31,12 +31,13 @@ export const syncSqlExecutables = (
|
|
|
executor: Executor,
|
|
executor: Executor,
|
|
|
statementDetails: StatementDetails
|
|
statementDetails: StatementDetails
|
|
|
): SyncSqlExecutablesResult => {
|
|
): SyncSqlExecutablesResult => {
|
|
|
- const allNewStatements = statementDetails.precedingStatements.concat(
|
|
|
|
|
|
|
+ const allNewStatements = [
|
|
|
|
|
+ ...statementDetails.precedingStatements,
|
|
|
statementDetails.activeStatement,
|
|
statementDetails.activeStatement,
|
|
|
- statementDetails.followingStatements
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ ...statementDetails.followingStatements
|
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
- const existingExecutables: (Executable | undefined)[] = executor.executables.concat();
|
|
|
|
|
|
|
+ const existingExecutables: (Executable | undefined)[] = [...executor.executables];
|
|
|
|
|
|
|
|
const result = {
|
|
const result = {
|
|
|
all: <SqlExecutable[]>[],
|
|
all: <SqlExecutable[]>[],
|
|
@@ -65,6 +66,7 @@ export const syncSqlExecutables = (
|
|
|
executable.database = activeDatabase;
|
|
executable.database = activeDatabase;
|
|
|
executable.parsedStatement = parsedStatement;
|
|
executable.parsedStatement = parsedStatement;
|
|
|
if (edited) {
|
|
if (edited) {
|
|
|
|
|
+ executable.edited = true;
|
|
|
result.edited.push(executable);
|
|
result.edited.push(executable);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -73,6 +75,7 @@ export const syncSqlExecutables = (
|
|
|
database: activeDatabase,
|
|
database: activeDatabase,
|
|
|
executor: executor
|
|
executor: executor
|
|
|
});
|
|
});
|
|
|
|
|
+ executable.edited = true;
|
|
|
}
|
|
}
|
|
|
if (parsedStatement === statementDetails.activeStatement) {
|
|
if (parsedStatement === statementDetails.activeStatement) {
|
|
|
activeStatementIndex = index;
|
|
activeStatementIndex = index;
|