mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Fixed Broken Notebook Preview (#4895)
This commit is contained in:
@@ -169,6 +169,13 @@ export class ExtHostNotebookDocumentsAndEditors implements ExtHostNotebookDocume
|
||||
options.providerId = showOptions.providerId;
|
||||
options.connectionProfile = showOptions.connectionProfile;
|
||||
options.defaultKernel = showOptions.defaultKernel;
|
||||
if (showOptions.initialContent) {
|
||||
if (typeof (showOptions.initialContent) !== 'string') {
|
||||
options.initialContent = JSON.stringify(showOptions.initialContent);
|
||||
} else {
|
||||
options.initialContent = showOptions.initialContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
let id = await this._proxy.$tryShowNotebookDocument(uri, options);
|
||||
let editor = this.getEditor(id);
|
||||
|
||||
@@ -404,7 +404,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
};
|
||||
let isUntitled: boolean = uri.scheme === Schemas.untitled;
|
||||
|
||||
const fileInput = isUntitled ? this._untitledEditorService.createOrGet(uri, notebookModeId) :
|
||||
const fileInput = isUntitled ? this._untitledEditorService.createOrGet(uri, notebookModeId, options.initialContent) :
|
||||
this._editorService.createInput({ resource: uri, language: notebookModeId });
|
||||
let input = this._instantiationService.createInstance(NotebookInput, path.basename(uri.fsPath), uri, fileInput);
|
||||
input.isTrusted = isUntitled;
|
||||
|
||||
@@ -854,6 +854,7 @@ export interface INotebookShowOptions {
|
||||
providerId?: string;
|
||||
connectionProfile?: azdata.IConnectionProfile;
|
||||
defaultKernel?: azdata.nb.IKernelSpec;
|
||||
initialContent?: string;
|
||||
}
|
||||
|
||||
export interface ExtHostNotebookDocumentsAndEditorsShape {
|
||||
|
||||
Reference in New Issue
Block a user