parent
0338b5b8fe
commit
ff13b50277
|
@ -43,11 +43,18 @@
|
|||
"./vs/base/browser/ui/splitview/splitview.ts",
|
||||
"./vs/base/browser/ui/tree/tree.ts",
|
||||
"./vs/base/browser/ui/widget.ts",
|
||||
"./vs/base/node/console.ts",
|
||||
"./vs/base/node/crypto.ts",
|
||||
"./vs/base/node/decoder.ts",
|
||||
"./vs/base/node/flow.ts",
|
||||
"./vs/base/node/id.ts",
|
||||
"./vs/base/node/paths.ts",
|
||||
"./vs/base/node/ports.ts",
|
||||
"./vs/base/node/proxy.ts",
|
||||
"./vs/base/node/request.ts",
|
||||
"./vs/base/node/stats.ts",
|
||||
"./vs/base/node/storage.ts",
|
||||
"./vs/base/node/stream.ts",
|
||||
"./vs/base/parts/contextmenu/common/contextmenu.ts",
|
||||
"./vs/base/parts/contextmenu/electron-browser/contextmenu.ts",
|
||||
"./vs/base/parts/contextmenu/electron-main/contextmenu.ts",
|
||||
|
@ -398,6 +405,7 @@
|
|||
"./vs/vscode.d.ts",
|
||||
"./vs/vscode.proposed.d.ts",
|
||||
"./vs/workbench/api/shared/tasks.ts",
|
||||
"./vs/workbench/browser/actions/toggleTabsVisibility.ts",
|
||||
"./vs/workbench/browser/part.ts",
|
||||
"./vs/workbench/browser/parts/quickinput/quickInputUtils.ts",
|
||||
"./vs/workbench/browser/parts/quickopen/quickopen.ts",
|
||||
|
@ -419,6 +427,10 @@
|
|||
"./vs/workbench/parts/codeEditor/electron-browser/accessibility.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/largeFileOptimizations.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts",
|
||||
"./vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts",
|
||||
"./vs/workbench/parts/comments/common/commentModel.ts",
|
||||
"./vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts",
|
||||
|
@ -428,6 +440,7 @@
|
|||
"./vs/workbench/parts/extensions/common/extensionQuery.ts",
|
||||
"./vs/workbench/parts/extensions/common/extensions.ts",
|
||||
"./vs/workbench/parts/extensions/common/extensionsFileTemplate.ts",
|
||||
"./vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts",
|
||||
"./vs/workbench/parts/logs/common/logConstants.ts",
|
||||
"./vs/workbench/parts/markers/electron-browser/constants.ts",
|
||||
"./vs/workbench/parts/markers/electron-browser/markers.ts",
|
||||
|
@ -450,6 +463,7 @@
|
|||
"./vs/workbench/parts/terminal/common/terminalMenu.ts",
|
||||
"./vs/workbench/parts/terminal/node/terminalCommandTracker.ts",
|
||||
"./vs/workbench/parts/terminal/node/terminalEnvironment.ts",
|
||||
"./vs/workbench/parts/url/electron-browser/url.contribution.ts",
|
||||
"./vs/workbench/parts/webview/electron-browser/webviewProtocols.ts",
|
||||
"./vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts",
|
||||
"./vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts",
|
||||
|
|
|
@ -29,7 +29,7 @@ export function isRemoteConsoleLog(obj: any): obj is IRemoteConsoleLog {
|
|||
|
||||
export function parse(entry: IRemoteConsoleLog): { args: any[], stack?: string } {
|
||||
const args: any[] = [];
|
||||
let stack: string;
|
||||
let stack: string | undefined;
|
||||
|
||||
// Parse Entry
|
||||
try {
|
||||
|
@ -50,11 +50,11 @@ export function parse(entry: IRemoteConsoleLog): { args: any[], stack?: string }
|
|||
return { args, stack };
|
||||
}
|
||||
|
||||
export function getFirstFrame(entry: IRemoteConsoleLog): IStackFrame;
|
||||
export function getFirstFrame(stack: string): IStackFrame;
|
||||
export function getFirstFrame(arg0: IRemoteConsoleLog | string): IStackFrame {
|
||||
export function getFirstFrame(entry: IRemoteConsoleLog): IStackFrame | undefined;
|
||||
export function getFirstFrame(stack: string | undefined): IStackFrame | undefined;
|
||||
export function getFirstFrame(arg0: IRemoteConsoleLog | string | undefined): IStackFrame | undefined {
|
||||
if (typeof arg0 !== 'string') {
|
||||
return getFirstFrame(parse(arg0).stack);
|
||||
return getFirstFrame(parse(arg0!).stack);
|
||||
}
|
||||
|
||||
// Parse a source information out of the stack if we have one. Format can be:
|
||||
|
@ -73,7 +73,7 @@ export function getFirstFrame(arg0: IRemoteConsoleLog | string): IStackFrame {
|
|||
// (?:(?:[a-zA-Z]+:)|(?:[\/])|(?:\\\\) => windows drive letter OR unix root OR unc root
|
||||
// (?:.+) => simple pattern for the path, only works because of the line/col pattern after
|
||||
// :(?:\d+):(?:\d+) => :line:column data
|
||||
const matches = /at [^\/]*((?:(?:[a-zA-Z]+:)|(?:[\/])|(?:\\\\))(?:.+)):(\d+):(\d+)/.exec(topFrame);
|
||||
const matches = /at [^\/]*((?:(?:[a-zA-Z]+:)|(?:[\/])|(?:\\\\))(?:.+)):(\d+):(\d+)/.exec(topFrame || '');
|
||||
if (matches && matches.length === 4) {
|
||||
return {
|
||||
uri: URI.file(matches[1]),
|
||||
|
@ -86,7 +86,7 @@ export function getFirstFrame(arg0: IRemoteConsoleLog | string): IStackFrame {
|
|||
return void 0;
|
||||
}
|
||||
|
||||
function findFirstFrame(stack: string): string {
|
||||
function findFirstFrame(stack: string | undefined): string | undefined {
|
||||
if (!stack) {
|
||||
return stack;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ export function log(entry: IRemoteConsoleLog, label: string): void {
|
|||
topFrame = `(${topFrame.trim()})`;
|
||||
}
|
||||
|
||||
let consoleArgs = [];
|
||||
let consoleArgs: string[] = [];
|
||||
|
||||
// First arg is a string
|
||||
if (typeof args[0] === 'string') {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
|||
import { once } from 'vs/base/common/functional';
|
||||
|
||||
export function checksum(path: string, sha1hash: string): TPromise<void> {
|
||||
const promise = new TPromise<string>((c, e) => {
|
||||
const promise = new TPromise<string | undefined>((c, e) => {
|
||||
const input = fs.createReadStream(path);
|
||||
const hash = crypto.createHash('sha1');
|
||||
const hashStream = hash as any as stream.PassThrough;
|
||||
|
@ -30,7 +30,7 @@ export function checksum(path: string, sha1hash: string): TPromise<void> {
|
|||
input.once('error', done);
|
||||
input.once('end', done);
|
||||
hashStream.once('error', done);
|
||||
hashStream.once('data', (data: Buffer) => done(null, data.toString('hex')));
|
||||
hashStream.once('data', (data: Buffer) => done(undefined, data.toString('hex')));
|
||||
});
|
||||
|
||||
return promise.then(hash => {
|
||||
|
@ -38,6 +38,6 @@ export function checksum(path: string, sha1hash: string): TPromise<void> {
|
|||
return TPromise.wrapError<void>(new Error('Hash mismatch'));
|
||||
}
|
||||
|
||||
return TPromise.as(null);
|
||||
return TPromise.as(void 0);
|
||||
});
|
||||
}
|
|
@ -142,7 +142,7 @@ function toNodeEncoding(enc: string): string {
|
|||
return enc;
|
||||
}
|
||||
|
||||
export function detectEncodingByBOMFromBuffer(buffer: Buffer, bytesRead: number): string {
|
||||
export function detectEncodingByBOMFromBuffer(buffer: Buffer, bytesRead: number): string | null {
|
||||
if (!buffer || bytesRead < 2) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ import * as assert from 'assert';
|
|||
* Executes the given function (fn) over the given array of items (list) in parallel and returns the resulting errors and results as
|
||||
* array to the callback (callback). The resulting errors and results are evaluated by calling the provided callback function.
|
||||
*/
|
||||
export function parallel<T, E>(list: T[], fn: (item: T, callback: (err: Error, result: E) => void) => void, callback: (err: Error[], result: E[]) => void): void {
|
||||
export function parallel<T, E>(list: T[], fn: (item: T, callback: (err: Error, result: E) => void) => void, callback: (err: Array<Error | null> | null, result: E[]) => void): void {
|
||||
let results = new Array(list.length);
|
||||
let errors = new Array<Error>(list.length);
|
||||
let errors = new Array<Error | null>(list.length);
|
||||
let didErrorOccur = false;
|
||||
let doneCount = 0;
|
||||
|
||||
|
@ -42,9 +42,9 @@ export function parallel<T, E>(list: T[], fn: (item: T, callback: (err: Error, r
|
|||
* array to the callback (callback). The resulting errors and results are evaluated by calling the provided callback function. The first param can
|
||||
* either be a function that returns an array of results to loop in async fashion or be an array of items already.
|
||||
*/
|
||||
export function loop<T, E>(param: (callback: (error: Error, result: T[]) => void) => void, fn: (item: T, callback: (error: Error, result: E) => void, index: number, total: number) => void, callback: (error: Error, result: E[]) => void): void;
|
||||
export function loop<T, E>(param: T[], fn: (item: T, callback: (error: Error, result: E) => void, index: number, total: number) => void, callback: (error: Error, result: E[]) => void): void;
|
||||
export function loop<E>(param: any, fn: (item: any, callback: (error: Error, result: E) => void, index: number, total: number) => void, callback: (error: Error, result: E[]) => void): void {
|
||||
export function loop<T, E>(param: (callback: (error: Error, result: T[]) => void) => void, fn: (item: T, callback: (error: Error | null, result: E | null) => void, index: number, total: number) => void, callback: (error: Error | null, result: E[] | null) => void): void;
|
||||
export function loop<T, E>(param: T[], fn: (item: T, callback: (error: Error | null, result: E | null) => void, index: number, total: number) => void, callback: (error: Error | null, result: E[] | null) => void): void;
|
||||
export function loop<E>(param: any, fn: (item: any, callback: (error: Error | null, result: E | null) => void, index: number, total: number) => void, callback: (error: Error | null, result: E[] | null) => void): void {
|
||||
|
||||
// Assert
|
||||
assert.ok(param, 'Missing first parameter');
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Url, parse as parseUrl } from 'url';
|
|||
import { isBoolean } from 'vs/base/common/types';
|
||||
import { Agent } from './request';
|
||||
|
||||
function getSystemProxyURI(requestURL: Url): string {
|
||||
function getSystemProxyURI(requestURL: Url): string | null {
|
||||
if (requestURL.protocol === 'http:') {
|
||||
return process.env.HTTP_PROXY || process.env.http_proxy || null;
|
||||
} else if (requestURL.protocol === 'https:') {
|
||||
|
@ -32,12 +32,12 @@ export async function getProxyAgent(rawRequestURL: string, options: IOptions = {
|
|||
|
||||
const proxyEndpoint = parseUrl(proxyURL);
|
||||
|
||||
if (!/^https?:$/.test(proxyEndpoint.protocol)) {
|
||||
if (!/^https?:$/.test(proxyEndpoint.protocol || '')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const opts = {
|
||||
host: proxyEndpoint.hostname,
|
||||
host: proxyEndpoint.hostname || '',
|
||||
port: Number(proxyEndpoint.port),
|
||||
auth: proxyEndpoint.auth,
|
||||
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true
|
||||
|
|
|
@ -93,7 +93,7 @@ export function collectWorkspaceStats(folder: string, filter: string[]): Promise
|
|||
const MAX_FILES = 20000;
|
||||
|
||||
function walk(dir: string, filter: string[], token, done: (allFiles: string[]) => void): void {
|
||||
let results = [];
|
||||
let results: string[] = [];
|
||||
readdir(dir, async (err, files) => {
|
||||
// Ignore folders that can't be read
|
||||
if (err) {
|
||||
|
|
|
@ -84,7 +84,7 @@ export class Storage extends Disposable {
|
|||
return value;
|
||||
}
|
||||
|
||||
getBoolean(key: string, fallbackValue?: boolean): boolean {
|
||||
getBoolean(key: string, fallbackValue: boolean = false): boolean {
|
||||
const value = this.get(key);
|
||||
|
||||
if (isUndefinedOrNull(value)) {
|
||||
|
@ -94,7 +94,7 @@ export class Storage extends Disposable {
|
|||
return value === 'true';
|
||||
}
|
||||
|
||||
getInteger(key: string, fallbackValue?: number): number {
|
||||
getInteger(key: string, fallbackValue: number = 0): number {
|
||||
const value = this.get(key);
|
||||
|
||||
if (isUndefinedOrNull(value)) {
|
||||
|
@ -269,7 +269,7 @@ export class SQLiteStorageImpl {
|
|||
return this.transaction(db, () => {
|
||||
if (request.insert && request.insert.size > 0) {
|
||||
this.prepare(db, 'INSERT INTO ItemTable VALUES (?,?)', stmt => {
|
||||
request.insert.forEach((value, key) => {
|
||||
request.insert!.forEach((value, key) => {
|
||||
stmt.run([key, value]);
|
||||
});
|
||||
});
|
||||
|
@ -277,7 +277,7 @@ export class SQLiteStorageImpl {
|
|||
|
||||
if (request.delete && request.delete.size) {
|
||||
this.prepare(db, 'DELETE FROM ItemTable WHERE key=?', stmt => {
|
||||
request.delete.forEach(key => {
|
||||
request.delete!.forEach(key => {
|
||||
stmt.run(key);
|
||||
});
|
||||
});
|
||||
|
@ -457,35 +457,35 @@ export class SQLiteStorageImpl {
|
|||
}
|
||||
|
||||
class SQLiteStorageLogger {
|
||||
private logInfo: boolean;
|
||||
private logError: boolean;
|
||||
private readonly logInfo: boolean;
|
||||
private readonly logError: boolean;
|
||||
|
||||
constructor(private options?: IStorageLoggingOptions) {
|
||||
this.logInfo = this.verbose && options && !!options.infoLogger;
|
||||
this.logError = options && !!options.errorLogger;
|
||||
constructor(private readonly options?: IStorageLoggingOptions) {
|
||||
this.logInfo = !!(this.verbose && options && options.infoLogger);
|
||||
this.logError = !!(options && options.errorLogger);
|
||||
}
|
||||
|
||||
get verbose(): boolean {
|
||||
return this.options && (this.options.info || this.options.trace || this.options.profile);
|
||||
return !!(this.options && (this.options.info || this.options.trace || this.options.profile));
|
||||
}
|
||||
|
||||
get trace(): boolean {
|
||||
return this.options && this.options.trace;
|
||||
return !!(this.options && this.options.trace);
|
||||
}
|
||||
|
||||
get profile(): boolean {
|
||||
return this.options && this.options.profile;
|
||||
return !!(this.options && this.options.profile);
|
||||
}
|
||||
|
||||
info(msg: string): void {
|
||||
if (this.logInfo) {
|
||||
this.options.infoLogger(msg);
|
||||
this.options!.infoLogger!(msg);
|
||||
}
|
||||
}
|
||||
|
||||
error(error: string | Error): void {
|
||||
if (this.logError) {
|
||||
this.options.errorLogger(error);
|
||||
this.options!.errorLogger!(error);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
import * as fs from 'fs';
|
||||
|
||||
export interface ReadResult {
|
||||
buffer: Buffer;
|
||||
buffer: Buffer | null;
|
||||
bytesRead: number;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ export function readExactlyByFile(file: string, totalBytes: number): Promise<Rea
|
|||
return reject(err);
|
||||
}
|
||||
|
||||
function end(err: Error, resultBuffer: Buffer, bytesRead: number): void {
|
||||
function end(err: Error | null, resultBuffer: Buffer | null, bytesRead: number): void {
|
||||
fs.close(fd, closeError => {
|
||||
if (closeError) {
|
||||
return reject(closeError);
|
||||
|
@ -71,14 +71,14 @@ export function readExactlyByFile(file: string, totalBytes: number): Promise<Rea
|
|||
* @param maximumBytesToRead The maximum number of bytes to read before giving up.
|
||||
* @param callback The finished callback.
|
||||
*/
|
||||
export function readToMatchingString(file: string, matchingString: string, chunkBytes: number, maximumBytesToRead: number): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) =>
|
||||
export function readToMatchingString(file: string, matchingString: string, chunkBytes: number, maximumBytesToRead: number): Promise<string | null> {
|
||||
return new Promise<string | null>((resolve, reject) =>
|
||||
fs.open(file, 'r', null, (err, fd) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
function end(err: Error, result: string): void {
|
||||
function end(err: Error | null, result: string | null): void {
|
||||
fs.close(fd, closeError => {
|
||||
if (closeError) {
|
||||
return reject(closeError);
|
||||
|
|
Loading…
Reference in a new issue