force the isDirty flag to always be false (#10295)

This commit is contained in:
Alan Ren
2020-05-07 10:08:22 -07:00
committed by GitHub
parent 1656a9c285
commit d87855cf1f

View File

@@ -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;