Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)

This commit is contained in:
Anthony Dresser
2019-03-22 13:07:54 -07:00
committed by GitHub
parent f5c9174c2f
commit 4a87a24235
296 changed files with 2531 additions and 2472 deletions

View File

@@ -132,13 +132,13 @@ suite('Encoding', () => {
assert.equal(mimes.encoding, 'windows1252');
});
async function readAndDecodeFromDisk(path, _encoding) {
async function readAndDecodeFromDisk(path: string, fileEncoding: string | null) {
return new Promise<string>((resolve, reject) => {
fs.readFile(path, (err, data) => {
if (err) {
reject(err);
} else {
resolve(encoding.decode(data, _encoding));
resolve(encoding.decode(data, fileEncoding!));
}
});
});

View File

@@ -17,7 +17,7 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation';
const ignore = () => { };
const mkdirp = (path: string, mode: number, callback: (error) => void) => {
const mkdirp = (path: string, mode: number, callback: (error: any) => void) => {
extfs.mkdirp(path, mode).then(() => callback(null), error => callback(error));
};

View File

@@ -431,7 +431,7 @@ suite('Glob', () => {
test('expression support (single)', function () {
let siblings = ['test.html', 'test.txt', 'test.ts', 'test.js'];
let hasSibling = name => siblings.indexOf(name) !== -1;
let hasSibling = (name: string) => siblings.indexOf(name) !== -1;
// { "**/*.js": { "when": "$(basename).ts" } }
let expression: glob.IExpression = {
@@ -467,7 +467,7 @@ suite('Glob', () => {
test('expression support (multiple)', function () {
let siblings = ['test.html', 'test.txt', 'test.ts', 'test.js'];
let hasSibling = name => siblings.indexOf(name) !== -1;
let hasSibling = (name: string) => siblings.indexOf(name) !== -1;
// { "**/*.js": { "when": "$(basename).ts" } }
let expression: glob.IExpression = {
@@ -717,7 +717,7 @@ suite('Glob', () => {
};
let siblings = ['foo.ts', 'foo.js', 'foo', 'bar'];
let hasSibling = name => siblings.indexOf(name) !== -1;
let hasSibling = (name: string) => siblings.indexOf(name) !== -1;
assert.strictEqual(glob.match(expr, 'bar', hasSibling), '**/bar');
assert.strictEqual(glob.match(expr, 'foo', hasSibling), null);
@@ -774,7 +774,7 @@ suite('Glob', () => {
let expr = { '**/*.js': { when: '$(basename).ts' } };
let siblings = ['foo.ts', 'foo.js'];
let hasSibling = name => siblings.indexOf(name) !== -1;
let hasSibling = (name: string) => siblings.indexOf(name) !== -1;
assert.strictEqual(glob.parse(expr)('bar/baz.js', 'baz.js', hasSibling), null);
assert.strictEqual(glob.parse(expr)('bar/foo.js', 'foo.js', hasSibling), '**/*.js');
@@ -818,7 +818,7 @@ suite('Glob', () => {
]);
const siblings = ['baz', 'baz.zip', 'nope'];
const hasSibling = name => siblings.indexOf(name) !== -1;
const hasSibling = (name: string) => siblings.indexOf(name) !== -1;
testOptimizationForBasenames({
'**/foo/**': { when: '$(basename).zip' },
'**/bar/**': true
@@ -924,7 +924,7 @@ suite('Glob', () => {
]);
const siblings = ['baz', 'baz.zip', 'nope'];
let hasSibling = name => siblings.indexOf(name) !== -1;
let hasSibling = (name: string) => siblings.indexOf(name) !== -1;
testOptimizationForPaths({
'**/foo/123/**': { when: '$(basename).zip' },
'**/bar/123/**': true

View File

@@ -293,7 +293,7 @@ suite('SQLite Storage Library', () => {
return set;
}
async function testDBBasics(path, logError?: (error) => void) {
async function testDBBasics(path: string, logError?: (error: Error) => void) {
let options!: ISQLiteStorageDatabaseOptions;
if (logError) {
options = {