Fix lost results on query editor save (#21043)

* Fix lost results on query editor save

* Fix typos
This commit is contained in:
Karl Burtram
2022-10-31 14:51:12 -07:00
committed by GitHub
parent 4ade808695
commit e0e333c35f
4 changed files with 36 additions and 14 deletions

View File

@@ -41,6 +41,7 @@ import { IUntitledTextEditorModel } from 'vs/workbench/services/untitled/common/
import { Schemas } from 'vs/base/common/network';
import { Registry } from 'vs/platform/registry/common/platform';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/browser/fileQueryEditorInput'; // {{SQL CARBON EDIT}} - add type
type CachedEditorInput = TextResourceEditorInput | IFileEditorInput | UntitledTextEditorInput;
@@ -1129,6 +1130,11 @@ export class EditorService extends Disposable implements EditorServiceImpl {
break; // failed or cancelled, abort
}
// {{SQL CARBON EDIT}} - disable editor resolution when replacing editors to maintain previous state
if (result instanceof FileQueryEditorInput) {
editorOptions.override = EditorResolution.DISABLED;
}
// Replace editor preserving viewstate (either across all groups or
// only selected group) if the resulting editor is different from the
// current one.