mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Add showTextDocument(uri|file)
This commit is contained in:
@@ -24,6 +24,24 @@ suite('window namespace tests', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('editor, opened via fileName', () => {
|
||||
const fileName = join(workspace.rootPath || '', './far.js');
|
||||
return window.showTextDocument(fileName).then((editor) => {
|
||||
const active = window.activeTextEditor;
|
||||
assert.ok(active);
|
||||
assert.ok(pathEquals(active!.document.uri.fsPath, fileName));
|
||||
});
|
||||
});
|
||||
|
||||
test('editor, opened via resource', () => {
|
||||
const uri = Uri.file(join(workspace.rootPath || '', './far.js'));
|
||||
return window.showTextDocument(uri).then((editor) => {
|
||||
const active = window.activeTextEditor;
|
||||
assert.ok(active);
|
||||
assert.ok(pathEquals(active!.document.uri.fsPath, uri.fsPath));
|
||||
});
|
||||
});
|
||||
|
||||
// test('editor, UN-active text editor', () => {
|
||||
// assert.equal(window.visibleTextEditors.length, 0);
|
||||
// assert.ok(window.activeTextEditor === undefined);
|
||||
|
||||
Reference in New Issue
Block a user