Use @types/node in extensions (#19692)

Switches builtin extensions to use @types/node for node definitions. Fixes a few errors that show up as a result of updating to a more modern version of node.d.ts
This commit is contained in:
Matt Bierner
2017-02-01 15:20:17 -08:00
committed by GitHub
parent c4f02ee14a
commit cda3584a99
18 changed files with 95 additions and 2368 deletions

View File

@@ -60,7 +60,7 @@ suite('workspace-namespace', () => {
test('openTextDocument', () => {
let len = workspace.textDocuments.length;
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
assert.ok(doc);
assert.equal(workspace.textDocuments.length, len + 1);
});
@@ -79,7 +79,7 @@ suite('workspace-namespace', () => {
return; // TODO@Joh this test fails on windows
}
return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath, './newfile.txt'))).then(doc => {
return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath || '', './newfile.txt'))).then(doc => {
assert.equal(doc.uri.scheme, 'untitled');
assert.ok(doc.isDirty);
});
@@ -101,7 +101,7 @@ suite('workspace-namespace', () => {
});
test('openTextDocument, untitled closes on save', function (done) {
const path = join(workspace.rootPath, './newfile.txt');
const path = join(workspace.rootPath || '', './newfile.txt');
return workspace.openTextDocument(Uri.parse('untitled:' + path)).then(doc => {
assert.equal(doc.uri.scheme, 'untitled');
@@ -118,7 +118,7 @@ suite('workspace-namespace', () => {
d0.dispose();
return deleteFile(Uri.file(join(workspace.rootPath, './newfile.txt'))).then(() => done(null));
return deleteFile(Uri.file(join(workspace.rootPath || '', './newfile.txt'))).then(() => done(null));
});
});
@@ -409,7 +409,7 @@ suite('workspace-namespace', () => {
test('applyEdit', () => {
return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath, './new2.txt'))).then(doc => {
return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath || '', './new2.txt'))).then(doc => {
let edit = new WorkspaceEdit();
edit.insert(doc.uri, new Position(0, 0), new Array(1000).join('Hello World'));
return workspace.applyEdit(edit);