mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Port most notebook model code over to be behind a service (#3068)
- Defines a new NotebookService in Azure Data Studio which will be used to interact with notebooks. Since notebooks can require per-file instantiation the provider is just used to create & track managers for a given URI. - Inject this into notebook.component.ts and pass required parameters that'll be used to properly initialize a manger into the method. Actual initialization not done yet. - Port over & recompile notebook model code - Define most required APIs in sqlops.proposed.d.ts. In the future, these will be used by extensions to contribute their own providers.
This commit is contained in:
@@ -54,10 +54,8 @@ export function convertEditorInput(input: EditorInput, options: IQueryEditorOpti
|
||||
uri = getNotebookEditorUri(input);
|
||||
if(uri){
|
||||
//TODO: We need to pass in notebook data either through notebook input or notebook service
|
||||
let notebookData: string = fs.readFileSync(uri.fsPath);
|
||||
let fileName: string = input? input.getName() : 'untitled';
|
||||
let filePath: string = uri.fsPath;
|
||||
let notebookInputModel = new NotebookInputModel(filePath, undefined, undefined);
|
||||
let notebookInputModel = new NotebookInputModel(uri, undefined, undefined);
|
||||
//TO DO: Second paramter has to be the content.
|
||||
let notebookInput: NotebookInput = instantiationService.createInstance(NotebookInput, fileName, notebookInputModel);
|
||||
return notebookInput;
|
||||
|
||||
Reference in New Issue
Block a user