mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Add notebook extension support for .NET Interactive. (#18334)
* Also updated kernel dropdown to only include SQL aliased kernels when using SQL notebook provider.
This commit is contained in:
@@ -102,8 +102,12 @@ export class MainThreadNotebook extends Disposable implements MainThreadNotebook
|
||||
}
|
||||
}
|
||||
|
||||
public $updateProviderDescriptionLanguages(providerId: string, languages: string[]): void {
|
||||
notebookRegistry.updateProviderDescriptionLanguages(providerId, languages);
|
||||
public $updateProviderKernels(providerId: string, languages: azdata.nb.IStandardKernel[]): void {
|
||||
notebookRegistry.updateProviderKernels(providerId, languages);
|
||||
}
|
||||
|
||||
public $updateKernelLanguages(providerId: string, kernelName: string, languages: string[]): void {
|
||||
notebookRegistry.updateKernelLanguages(providerId, kernelName, languages);
|
||||
}
|
||||
//#endregion
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ import { localize } from 'vs/nls';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { NotebookEditor } from 'sql/workbench/contrib/notebook/browser/notebookEditor';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { NewNotebookAction } from 'sql/workbench/contrib/notebook/browser/notebookActions';
|
||||
|
||||
class MainThreadNotebookEditor extends Disposable {
|
||||
private _contentChangedEmitter = new Emitter<NotebookContentChange>();
|
||||
@@ -322,8 +320,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@INotebookService private readonly _notebookService: INotebookService,
|
||||
@IFileService private readonly _fileService: IFileService,
|
||||
@ITextFileService private readonly _textFileService: ITextFileService,
|
||||
@ICommandService private readonly _commandService: ICommandService
|
||||
@ITextFileService private readonly _textFileService: ITextFileService
|
||||
) {
|
||||
super();
|
||||
if (extHostContext) {
|
||||
@@ -345,6 +342,11 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
}
|
||||
}
|
||||
|
||||
async $tryCreateNotebookDocument(options: INotebookShowOptions): Promise<UriComponents> {
|
||||
let input = await this._notebookService.createNotebookInput(options);
|
||||
return input.resource;
|
||||
}
|
||||
|
||||
$tryShowNotebookDocument(resource: UriComponents, options: INotebookShowOptions): Promise<string> {
|
||||
return Promise.resolve(this.doOpenEditor(resource, options));
|
||||
}
|
||||
@@ -712,12 +714,4 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$createNotebookDocument(providerId: string, contents: azdata.nb.INotebookContents): Promise<azdata.nb.NotebookDocument> {
|
||||
return this._commandService.executeCommand(NewNotebookAction.INTERNAL_NEW_NOTEBOOK_CMD_ID, {
|
||||
providerId: providerId,
|
||||
initialContent: contents,
|
||||
initialDirtyState: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user