From d87855cf1f19b867a450dcfe9dbd3da33537c735 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Thu, 7 May 2020 10:08:22 -0700 Subject: [PATCH] force the isDirty flag to always be false (#10295) --- .../workbench/contrib/profiler/browser/profilerEditor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts index 776c511978..6f04b3aa49 100644 --- a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts +++ b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts @@ -120,6 +120,7 @@ export interface IDetailData { export class ProfilerEditor extends BaseEditor { public static readonly ID: string = 'workbench.editor.profiler'; + private _untitledTextEditorModel: UntitledTextEditorModel; private _editor: ProfilerResourceEditor; private _editorModel: ITextModel; private _editorInput: UntitledTextEditorInput; @@ -319,6 +320,7 @@ export class ProfilerEditor extends BaseEditor { let data = this.input.data.getItem(args.rows[0]); if (data) { this._modelService.updateModel(this._editorModel, data['TextData']); + this._untitledTextEditorModel.setDirty(false); this._detailTableData.clear(); this._detailTableData.push(Object.keys(data).filter(key => { return data[key] !== ' '; @@ -436,8 +438,8 @@ export class ProfilerEditor extends BaseEditor { editorContainer.className = 'profiler-editor'; this._editor.create(editorContainer); this._editor.setVisible(true); - const model = this._instantiationService.createInstance(UntitledTextEditorModel, URI.from({ scheme: Schemas.untitled }), false, undefined, 'sql', undefined); - this._editorInput = this._instantiationService.createInstance(UntitledTextEditorInput, model); + this._untitledTextEditorModel = this._instantiationService.createInstance(UntitledTextEditorModel, URI.from({ scheme: Schemas.untitled }), false, undefined, 'sql', undefined); + this._editorInput = this._instantiationService.createInstance(UntitledTextEditorInput, this._untitledTextEditorModel); this._editor.setInput(this._editorInput, undefined); this._editorInput.resolve().then(model => this._editorModel = model.textEditorModel); return editorContainer;