diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index 48feb10216..207c5c4bff 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -18,6 +18,9 @@ import { QueryInput } from 'sql/workbench/parts/query/common/queryInput'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import * as CustomInputConverter from 'sql/workbench/common/customInputConverter'; import { NotebookInput } from 'sql/workbench/parts/notebook/notebookInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; +import * as path from 'path'; +import * as os from 'os'; const EditorOpenPositioning = { LEFT: 'left', @@ -663,6 +666,15 @@ export class EditorGroup extends Disposable { && !this.configurationService.getValue('sql.promptToSaveGeneratedFiles')) { return; } + // Do not add generated files from Temp if file is not dirty + if (e instanceof FileEditorInput && !e.isDirty()) { + let filePath = e.getResource() ? e.getResource().fsPath : undefined; + let tempPath = os.tmpdir(); + if (filePath && tempPath && + filePath.toLocaleLowerCase().includes(path.join(tempPath.toLocaleLowerCase(), 'mssql_definition'))) { + return; + } + } // {{SQL CARBON EDIT}} - End const value = factory.serialize(e);