Merge remote-tracking branch 'origin/main' into tyriar/116467_2

This commit is contained in:
Daniel Imms 2021-03-09 06:49:30 -08:00
commit 1e7fbfa767
2 changed files with 1 additions and 23 deletions

View file

@ -421,29 +421,6 @@ suite('Notebook API tests', function () {
await saveFileAndCloseAll(resource);
});
test.skip('change cell language', async function () {
const resource = await createRandomFile('', undefined, '.vsctestnb');
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
assert.strictEqual(vscode.window.activeNotebookEditor?.document.cells[0].language, 'typescript');
assert.strictEqual(vscode.window.activeNotebookEditor?.document.cells[0].cellKind, vscode.NotebookCellKind.Code);
await withEvent(vscode.notebook.onDidChangeCellLanguage, async event => {
await vscode.commands.executeCommand('notebook.cell.changeLanguage', { start: 0, end: 1 }, 'javascript');
await event;
assert.strictEqual(vscode.window.activeNotebookEditor?.document.cells[0].language, 'javascript');
});
// switch to markdown will change the cell kind
await withEvent(vscode.notebook.onDidChangeNotebookCells, async event => {
await vscode.commands.executeCommand('notebook.cell.changeLanguage', { start: 0, end: 1 }, 'markdown');
await event;
assert.strictEqual(vscode.window.activeNotebookEditor?.document.cells[0].language, 'markdown');
assert.strictEqual(vscode.window.activeNotebookEditor?.document.cells[0].cellKind, vscode.NotebookCellKind.Markdown);
});
await saveAllFilesAndCloseAll(resource);
});
test('edit API (replaceMetadata)', async function () {
const resource = await createRandomFile('', undefined, '.vsctestnb');
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');

View file

@ -1558,6 +1558,7 @@ declare module 'vscode' {
}
// todo@API use openNotebookDOCUMENT to align with openCustomDocument etc?
// todo@API rename to NotebookDocumentContentProvider
export interface NotebookContentProvider {
readonly options?: NotebookDocumentContentOptions;