mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
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:
@@ -63,7 +63,7 @@ suite('commands namespace tests', () => {
|
||||
args = arguments;
|
||||
});
|
||||
|
||||
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
|
||||
return window.showTextDocument(doc).then(editor => {
|
||||
return commands.executeCommand('t1', 12345, commands);
|
||||
}).then(() => {
|
||||
@@ -121,7 +121,7 @@ suite('commands namespace tests', () => {
|
||||
});
|
||||
|
||||
test('api-command: vscode.open', function () {
|
||||
let uri = Uri.file(join(workspace.rootPath, './image.png'));
|
||||
let uri = Uri.file(join(workspace.rootPath || '', './image.png'));
|
||||
let a = commands.executeCommand('vscode.open', uri).then(() => assert.ok(true), () => assert.ok(false));
|
||||
let b = commands.executeCommand('vscode.open', uri, ViewColumn.Two).then(() => assert.ok(true), () => assert.ok(false));
|
||||
let c = commands.executeCommand('vscode.open').then(() => assert.ok(false), () => assert.ok(true));
|
||||
|
||||
@@ -69,7 +69,7 @@ suite('languages namespace tests', () => {
|
||||
|
||||
test('completions with document filters', function (done) {
|
||||
let ran = false;
|
||||
let uri = Uri.file(join(workspace.rootPath, './bower.json'));
|
||||
let uri = Uri.file(join(workspace.rootPath || '', './bower.json'));
|
||||
|
||||
let jsonDocumentFilter = [{ language: 'json', pattern: '**/package.json' }, { language: 'json', pattern: '**/bower.json' }, { language: 'json', pattern: '**/.bower.json' }];
|
||||
|
||||
|
||||
@@ -5,5 +5,4 @@
|
||||
|
||||
/// <reference path="../../../../src/vs/vscode.d.ts" />
|
||||
/// <reference path='../../../../src/typings/mocha.d.ts'/>
|
||||
/// <reference path='../../../../extensions/declares.d.ts'/>
|
||||
/// <reference path='../../../../extensions/node.d.ts'/>
|
||||
/// <reference path='../../node_modules/@types/node/index.d.ts'/>
|
||||
|
||||
@@ -15,7 +15,7 @@ suite('window namespace tests', () => {
|
||||
teardown(cleanUp);
|
||||
|
||||
test('editor, active text editor', () => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
|
||||
return window.showTextDocument(doc).then((editor) => {
|
||||
const active = window.activeTextEditor;
|
||||
assert.ok(active);
|
||||
@@ -31,7 +31,7 @@ suite('window namespace tests', () => {
|
||||
|
||||
test('editor, assign and check view columns', () => {
|
||||
|
||||
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
|
||||
let p1 = window.showTextDocument(doc, ViewColumn.One).then(editor => {
|
||||
assert.equal(editor.viewColumn, ViewColumn.One);
|
||||
});
|
||||
@@ -52,7 +52,7 @@ suite('window namespace tests', () => {
|
||||
eventCounter += 1;
|
||||
});
|
||||
|
||||
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
|
||||
return window.showTextDocument(doc, ViewColumn.One).then(editor => {
|
||||
assert.equal(eventCounter, 1);
|
||||
return doc;
|
||||
@@ -111,8 +111,8 @@ suite('window namespace tests', () => {
|
||||
});
|
||||
|
||||
test('issue #5362 - Incorrect TextEditor passed by onDidChangeTextEditorSelection', (done) => {
|
||||
const file10Path = join(workspace.rootPath, './10linefile.ts');
|
||||
const file30Path = join(workspace.rootPath, './30linefile.ts');
|
||||
const file10Path = join(workspace.rootPath || '', './10linefile.ts');
|
||||
const file30Path = join(workspace.rootPath || '', './30linefile.ts');
|
||||
|
||||
let finished = false;
|
||||
let failOncePlease = (err: Error) => {
|
||||
@@ -291,7 +291,7 @@ suite('window namespace tests', () => {
|
||||
});
|
||||
|
||||
test('editor, selection change kind', () => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => window.showTextDocument(doc)).then(editor => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => window.showTextDocument(doc)).then(editor => {
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user