fix #116808.
This commit is contained in:
parent
b0bd28137a
commit
b3f8737839
3 changed files with 18 additions and 1 deletions
|
@ -1403,7 +1403,7 @@ suite('Notebook API tests', function () {
|
||||||
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.document.getText(), 'var abc = 0;');
|
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.document.getText(), 'var abc = 0;');
|
||||||
|
|
||||||
// no kernel -> no default language
|
// no kernel -> no default language
|
||||||
assert.strictEqual(vscode.window.activeNotebookEditor!.kernel, undefined);
|
// assert.strictEqual(vscode.window.activeNotebookEditor!.kernel, undefined);
|
||||||
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.language, 'typescript');
|
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.language, 'typescript');
|
||||||
|
|
||||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'default');
|
await vscode.commands.executeCommand('vscode.openWith', resource, 'default');
|
||||||
|
@ -1511,6 +1511,21 @@ suite('Notebook API tests', function () {
|
||||||
await saveAllFilesAndCloseAll(resource);
|
await saveAllFilesAndCloseAll(resource);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('#116808, active kernel should not be undefined', async function () {
|
||||||
|
assertInitalState();
|
||||||
|
const resource = await createRandomFile('', undefined, '.vsctestnb');
|
||||||
|
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||||
|
|
||||||
|
await withEvent(vscode.notebook.onDidChangeActiveNotebookKernel, async event => {
|
||||||
|
await event;
|
||||||
|
assert.notStrictEqual(vscode.window.activeNotebookEditor?.kernel, undefined);
|
||||||
|
assert.strictEqual(vscode.window.activeNotebookEditor?.kernel?.id, 'mainKernel');
|
||||||
|
});
|
||||||
|
|
||||||
|
await saveAllFilesAndCloseAll(resource);
|
||||||
|
});
|
||||||
|
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// suite('webview', () => {
|
// suite('webview', () => {
|
||||||
|
|
|
@ -556,6 +556,7 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
|
||||||
const result: INotebookKernel[] = [];
|
const result: INotebookKernel[] = [];
|
||||||
const kernelsDto = await that._proxy.$provideNotebookKernels(handle, uri, token);
|
const kernelsDto = await that._proxy.$provideNotebookKernels(handle, uri, token);
|
||||||
for (const dto of kernelsDto) {
|
for (const dto of kernelsDto) {
|
||||||
|
console.log('kerneldto', dto.providerHandle);
|
||||||
|
|
||||||
result.push({
|
result.push({
|
||||||
id: dto.id,
|
id: dto.id,
|
||||||
|
|
|
@ -123,6 +123,7 @@ export class ExtHostNotebookKernelProviderAdapter extends Disposable {
|
||||||
label: kernel.label,
|
label: kernel.label,
|
||||||
extension: this._extension.identifier,
|
extension: this._extension.identifier,
|
||||||
extensionLocation: this._extension.extensionLocation,
|
extensionLocation: this._extension.extensionLocation,
|
||||||
|
providerHandle: this._handle,
|
||||||
description: kernel.description,
|
description: kernel.description,
|
||||||
detail: kernel.detail,
|
detail: kernel.detail,
|
||||||
isPreferred: kernel.isPreferred,
|
isPreferred: kernel.isPreferred,
|
||||||
|
|
Loading…
Reference in a new issue