Fix #6287 Notebook editor deserialize on reload/save is broken (#6288)

- Notebook editors have their own mode
This commit is contained in:
Kevin Cunnane
2019-07-08 14:58:15 -07:00
committed by Charles Gagnon
parent 73bb5501bd
commit f3b12dd5ac

View File

@@ -39,21 +39,24 @@ export function convertEditorInput(input: EditorInput, options: IQueryEditorOpti
let denyQueryEditor: boolean = options && options.denyQueryEditor; let denyQueryEditor: boolean = options && options.denyQueryEditor;
let untitledEditorInput: UntitledEditorInput = input as UntitledEditorInput; let untitledEditorInput: UntitledEditorInput = input as UntitledEditorInput;
let mode: string = (untitledEditorInput && untitledEditorInput.getMode) ? untitledEditorInput.getMode() : 'sql'; let mode: string = (untitledEditorInput && untitledEditorInput.getMode) ? untitledEditorInput.getMode() : 'sql';
if (input && !denyQueryEditor && mode === 'sql') { if (input && !denyQueryEditor) {
//QueryInput let uri: URI;
let uri: URI = getQueryEditorFileUri(input); if (mode === 'sql') {
if (uri) { //QueryInput
const queryResultsInput: QueryResultsInput = instantiationService.createInstance(QueryResultsInput, uri.toString()); uri = getQueryEditorFileUri(input);
let queryInput: QueryInput = instantiationService.createInstance(QueryInput, '', input, queryResultsInput, undefined); if (uri) {
return queryInput; const queryResultsInput: QueryResultsInput = instantiationService.createInstance(QueryResultsInput, uri.toString());
} let queryInput: QueryInput = instantiationService.createInstance(QueryInput, '', input, queryResultsInput, undefined);
return queryInput;
}
//QueryPlanInput //QueryPlanInput
uri = getQueryPlanEditorUri(input); uri = getQueryPlanEditorUri(input);
if (uri) { if (uri) {
let queryPlanXml: string = fs.readFileSync(uri.fsPath); let queryPlanXml: string = fs.readFileSync(uri.fsPath);
let queryPlanInput: QueryPlanInput = instantiationService.createInstance(QueryPlanInput, queryPlanXml, 'aaa', undefined); let queryPlanInput: QueryPlanInput = instantiationService.createInstance(QueryPlanInput, queryPlanXml, 'aaa', undefined);
return queryPlanInput; return queryPlanInput;
}
} }
//Notebook //Notebook