mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Remove languages property from NotebookData and NotebookDocument
This commit is contained in:
@@ -1468,7 +1468,13 @@ suite('regression', () => {
|
||||
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor !== undefined, true, 'notebook first');
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.document.getText(), 'var abc = 0;');
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
|
||||
// todo@jrieken enforce a kernel (how) and test that its language is picked
|
||||
// assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
|
||||
// no kernel -> no default language
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor!.kernel, undefined);
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor!.selection?.language, 'plaintext');
|
||||
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'default');
|
||||
assert.strictEqual(vscode.window.activeTextEditor?.document.uri.path, resource.path);
|
||||
|
||||
@@ -23,7 +23,6 @@ export function smokeTestActivate(context: vscode.ExtensionContext): any {
|
||||
context.subscriptions.push(vscode.notebook.registerNotebookContentProvider('notebookSmokeTest', {
|
||||
openNotebook: async (_resource: vscode.Uri) => {
|
||||
const dto: vscode.NotebookData = {
|
||||
languages: ['typescript'],
|
||||
metadata: {},
|
||||
cells: [
|
||||
{
|
||||
|
||||
@@ -10,17 +10,15 @@ export function activate(context: vscode.ExtensionContext): any {
|
||||
smokeTestActivate(context);
|
||||
|
||||
context.subscriptions.push(vscode.notebook.registerNotebookContentProvider('notebookCoreTest', {
|
||||
openNotebook: async (_resource: vscode.Uri) => {
|
||||
openNotebook: async (_resource: vscode.Uri): Promise<vscode.NotebookData> => {
|
||||
if (/.*empty\-.*\.vsctestnb$/.test(_resource.path)) {
|
||||
return {
|
||||
languages: ['typescript'],
|
||||
metadata: {},
|
||||
cells: []
|
||||
};
|
||||
}
|
||||
|
||||
const dto: vscode.NotebookData = {
|
||||
languages: ['typescript'],
|
||||
metadata: {
|
||||
custom: { testMetadata: false }
|
||||
},
|
||||
@@ -36,7 +34,6 @@ export function activate(context: vscode.ExtensionContext): any {
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
return dto;
|
||||
},
|
||||
resolveNotebook: async (_document: vscode.NotebookDocument) => {
|
||||
@@ -60,6 +57,7 @@ export function activate(context: vscode.ExtensionContext): any {
|
||||
id: 'mainKernel',
|
||||
label: 'Notebook Test Kernel',
|
||||
isPreferred: true,
|
||||
supportedLanguages: ['typescript'],
|
||||
executeAllCells: async (_document: vscode.NotebookDocument) => {
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
|
||||
@@ -98,6 +96,7 @@ export function activate(context: vscode.ExtensionContext): any {
|
||||
id: 'secondaryKernel',
|
||||
label: 'Notebook Secondary Test Kernel',
|
||||
isPreferred: false,
|
||||
supportedLanguages: ['typescript'],
|
||||
executeAllCells: async (_document: vscode.NotebookDocument) => {
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
edit.replaceNotebookCellOutput(_document.uri, 0, [new vscode.NotebookCellOutput([
|
||||
|
||||
Reference in New Issue
Block a user