mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 18:46:34 -05:00
Generate temp files as not dirty (#3698)
* Generate temp files as not dirty * Remove whitespace
This commit is contained in:
@@ -16,6 +16,7 @@ import { ResourceMap } from 'vs/base/common/map';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import { QueryInput } from 'sql/parts/query/common/queryInput';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import * as CustomInputConverter from 'sql/parts/common/customInputConverter';
|
||||
|
||||
const EditorOpenPositioning = {
|
||||
@@ -631,6 +632,14 @@ export class EditorGroup extends Disposable {
|
||||
editors.forEach(e => {
|
||||
let factory = registry.getEditorInputFactory(e.getTypeId());
|
||||
if (factory) {
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// don't serialize unmodified unitited files
|
||||
if (e instanceof UntitledEditorInput && !e.isDirty()
|
||||
&& !this.configurationService.getValue<boolean>('sql.promptToSaveGeneratedFiles')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let value = factory.serialize(e);
|
||||
if (typeof value === 'string') {
|
||||
serializedEditors.push({ id: e.getTypeId(), value });
|
||||
|
||||
@@ -115,7 +115,9 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
|
||||
return this.dirty;
|
||||
}
|
||||
|
||||
private setDirty(dirty: boolean): void {
|
||||
// {{SQL CARBON EDIT}}
|
||||
// make property public
|
||||
public setDirty(dirty: boolean): void {
|
||||
if (this.dirty === dirty) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user