mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Do not add generated files from Temp if file is not dirty (#5758)
* Do not add generated files from Temp if file is not dirty * restricting the path more * Adding tmpdir as per CR comment
This commit is contained in:
@@ -18,6 +18,9 @@ import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
|||||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||||
import * as CustomInputConverter from 'sql/workbench/common/customInputConverter';
|
import * as CustomInputConverter from 'sql/workbench/common/customInputConverter';
|
||||||
import { NotebookInput } from 'sql/workbench/parts/notebook/notebookInput';
|
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 = {
|
const EditorOpenPositioning = {
|
||||||
LEFT: 'left',
|
LEFT: 'left',
|
||||||
@@ -663,6 +666,15 @@ export class EditorGroup extends Disposable {
|
|||||||
&& !this.configurationService.getValue<boolean>('sql.promptToSaveGeneratedFiles')) {
|
&& !this.configurationService.getValue<boolean>('sql.promptToSaveGeneratedFiles')) {
|
||||||
return;
|
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
|
// {{SQL CARBON EDIT}} - End
|
||||||
|
|
||||||
const value = factory.serialize(e);
|
const value = factory.serialize(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user