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:
Cory Rivera
2022-02-25 11:58:59 -08:00
committed by GitHub
parent 02341088eb
commit ffdefd3b52
41 changed files with 649 additions and 278 deletions

View File

@@ -67,7 +67,8 @@ class TestNotebookModel extends NotebookModelStub {
name: 'StandardKernel1',
displayName: 'StandardKernel1',
connectionProviderIds: ['Kernel1 connection 1', 'Kernel1 connection2'],
notebookProvider: 'kernel provider1'
notebookProvider: 'kernel provider1',
supportedLanguages: ['python']
}
],
[
@@ -76,7 +77,8 @@ class TestNotebookModel extends NotebookModelStub {
name: 'StandardKernel2',
displayName: 'StandardKernel2',
connectionProviderIds: ['Kernel1 connection 2', 'Kernel1 connection2'],
notebookProvider: 'kernel provider2'
notebookProvider: 'kernel provider2',
supportedLanguages: ['python']
}
]
]

View File

@@ -40,7 +40,8 @@ suite('Notebook Input', function (): void {
name: 'TestName',
displayName: 'TestDisplayName',
connectionProviderIds: ['TestId'],
notebookProvider: testProvider
notebookProvider: testProvider,
supportedLanguages: ['python']
}]);
});
let testManager: ISerializationManager = {
@@ -129,12 +130,14 @@ suite('Notebook Input', function (): void {
name: 'TestName1',
displayName: 'TestDisplayName1',
connectionProviderIds: ['TestId1'],
notebookProvider: 'TestProvider'
notebookProvider: 'TestProvider',
supportedLanguages: ['python']
}, {
name: 'TestName2',
displayName: 'TestDisplayName2',
connectionProviderIds: ['TestId2'],
notebookProvider: 'TestProvider'
notebookProvider: 'TestProvider',
supportedLanguages: ['python']
}];
untitledNotebookInput.standardKernels = testKernels;
assert.deepStrictEqual(untitledNotebookInput.standardKernels, testKernels);

View File

@@ -236,7 +236,8 @@ suite.skip('NotebookService:', function (): void {
standardKernels: [{
name: 'kernel1',
connectionProviderIds: [],
displayName: 'Kernel 1'
displayName: 'Kernel 1',
supportedLanguages: ['python']
}],
provider: 'otherProvider'
};

View File

@@ -21,12 +21,14 @@ suite('notebookUtils', function (): void {
const testKernel: nb.IStandardKernel = {
name: 'testName',
displayName: 'testDisplayName',
connectionProviderIds: ['testId1', 'testId2']
connectionProviderIds: ['testId1', 'testId2'],
supportedLanguages: ['python']
};
const sqlStandardKernel: nb.IStandardKernel = {
name: notebookConstants.SQL,
displayName: notebookConstants.SQL,
connectionProviderIds: [notebookConstants.SQL_CONNECTION_PROVIDER]
connectionProviderIds: [notebookConstants.SQL_CONNECTION_PROVIDER],
supportedLanguages: ['sql']
};
function setupMockNotebookService() {
@@ -108,7 +110,8 @@ suite('notebookUtils', function (): void {
name: 'testName',
displayName: 'testDisplayName',
connectionProviderIds: ['testId1', 'testId2'],
notebookProvider: 'testProvider'
notebookProvider: 'testProvider',
supportedLanguages: ['python']
}]);
});

View File

@@ -17,7 +17,7 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
import { URI, UriComponents } from 'vs/base/common/uri';
import { QueryTextEditor } from 'sql/workbench/browser/modelComponents/queryTextEditor';
import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview';
import { IEditorPane } from 'vs/workbench/common/editor';
import { IEditorInput, IEditorPane } from 'vs/workbench/common/editor';
import { INotebookShowOptions } from 'sql/workbench/api/common/sqlExtHost.protocol';
import { NotebookViewsExtension } from 'sql/workbench/services/notebook/browser/notebookViews/notebookViewsExtension';
import { INotebookView, INotebookViewCell, INotebookViewMetadata, INotebookViews } from 'sql/workbench/services/notebook/browser/notebookViews/notebookViews';
@@ -235,6 +235,9 @@ export class ServerManagerStub implements nb.ServerManager {
}
export class NotebookServiceStub implements INotebookService {
createNotebookInput(options: INotebookShowOptions, resource?: UriComponents): Promise<IEditorInput> {
throw new Error('Method not implemented.');
}
_serviceBrand: undefined;
get onNotebookEditorAdd(): vsEvent.Event<INotebookEditor> {
throw new Error('Method not implemented.');