Open new file buffer via API

This commit is contained in:
Benjamin Pasero
2017-01-18 19:13:26 +01:00
parent dbef8f1afe
commit 8b7756063b
6 changed files with 61 additions and 23 deletions

View File

@@ -85,6 +85,21 @@ suite('workspace-namespace', () => {
});
});
test('openTextDocument, untitled without path', function () {
return workspace.openTextDocument().then(doc => {
assert.equal(doc.uri.scheme, 'untitled');
assert.ok(doc.isDirty);
});
});
test('openTextDocument, untitled without path but language ID', function () {
return workspace.openTextDocument({ language: 'xml' }).then(doc => {
assert.equal(doc.uri.scheme, 'untitled');
assert.equal(doc.languageId, 'xml');
assert.ok(doc.isDirty);
});
});
test('openTextDocument, untitled closes on save', function (done) {
const path = join(workspace.rootPath, './newfile.txt');