mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
some fixes for editor reopen with another type
This commit is contained in:
@@ -396,6 +396,8 @@ suite('metadata', () => {
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.metadata.custom!['testCellMetadata'] as number, 123);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
});
|
||||
|
||||
// TODO copy cell should not copy metadata
|
||||
});
|
||||
|
||||
suite('regression', () => {
|
||||
@@ -407,6 +409,8 @@ suite('regression', () => {
|
||||
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.source, '');
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
await vscode.commands.executeCommand('workbench.action.files.saveAll');
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
|
||||
test('#97830, #97764. Support switch to other editor types', async function () {
|
||||
@@ -427,6 +431,27 @@ suite('regression', () => {
|
||||
await vscode.commands.executeCommand('workbench.action.files.saveAll');
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
|
||||
// open text editor, pin, and then open a notebook
|
||||
test('#96105 - dirty editors', async function () {
|
||||
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './empty.vsctestnb'));
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'default');
|
||||
|
||||
await waitFor(500);
|
||||
await vscode.commands.executeCommand('notebook.cell.insertCodeCellBelow');
|
||||
await vscode.commands.executeCommand('default:type', { text: 'var abc = 0;' });
|
||||
|
||||
// now it's dirty, open the resource with notebook editor should open a new one
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
await waitFor(500);
|
||||
|
||||
assert.notEqual(vscode.notebook.activeNotebookEditor, undefined, 'notebook first');
|
||||
assert.notEqual(vscode.window.activeTextEditor, undefined);
|
||||
|
||||
// await vscode.commands.executeCommand('workbench.action.files.saveAll');
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('webview resource uri', () => {
|
||||
|
||||
Reference in New Issue
Block a user