mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* #4363: Reopen notebook editors when ADS launched * Code review changes
This commit is contained in:
@@ -16,6 +16,7 @@ import { ResourceMap } from 'vs/base/common/map';
|
||||
import { QueryInput } from 'sql/parts/query/common/queryInput';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import * as CustomInputConverter from 'sql/parts/common/customInputConverter';
|
||||
import { NotebookInput } from 'sql/parts/notebook/notebookInput';
|
||||
|
||||
const EditorOpenPositioning = {
|
||||
LEFT: 'left',
|
||||
@@ -624,6 +625,8 @@ export class EditorGroup extends Disposable {
|
||||
let editors = this.editors.map(e => {
|
||||
if (e instanceof QueryInput) {
|
||||
return e.sql;
|
||||
} else if (e instanceof NotebookInput) {
|
||||
return e.textInput;
|
||||
}
|
||||
return e;
|
||||
});
|
||||
@@ -654,6 +657,8 @@ export class EditorGroup extends Disposable {
|
||||
let mru = this.mru.map(e => {
|
||||
if (e instanceof QueryInput) {
|
||||
return e.sql;
|
||||
} else if (e instanceof NotebookInput) {
|
||||
return e.textInput;
|
||||
}
|
||||
return e;
|
||||
});
|
||||
|
||||
@@ -528,10 +528,10 @@ export class EditorService extends Disposable implements EditorServiceImpl {
|
||||
if (!untitledInput.resource || typeof untitledInput.filePath === 'string' || (untitledInput.resource instanceof URI && untitledInput.resource.scheme === Schemas.untitled)) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
|
||||
let mode: string = getFileMode( this.instantiationService, untitledInput.resource);
|
||||
let modeId: string = untitledInput.language ? untitledInput.language : getFileMode( this.instantiationService, untitledInput.resource);
|
||||
return convertEditorInput(this.untitledEditorService.createOrGet(
|
||||
untitledInput.filePath ? URI.file(untitledInput.filePath) : untitledInput.resource,
|
||||
mode,
|
||||
modeId,
|
||||
untitledInput.contents,
|
||||
untitledInput.encoding
|
||||
), undefined, this.instantiationService);
|
||||
|
||||
Reference in New Issue
Block a user