diff --git a/src/typings/node.d.ts b/src/typings/node.d.ts index aa5953d8f15fdc5aeb97e3b57000eb77e198138d..8c33c5a8412b5d7523c6da71a7826d4ad0963f6f 100644 --- a/src/typings/node.d.ts +++ b/src/typings/node.d.ts @@ -88,10 +88,10 @@ interface NodeModule { // Same as module.exports declare var exports: any; declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; + new(str: string, encoding?: string): Buffer; + new(size: number): Buffer; + new(size: Uint8Array): Buffer; + new(array: any[]): Buffer; prototype: Buffer; isBuffer(obj: any): boolean; byteLength(string: string, encoding?: string): number; @@ -115,19 +115,19 @@ declare var Buffer: { * @param str String to store in buffer. * @param encoding encoding to use, optional. Default is 'utf8' */ - new (str: string, encoding?: string): Buffer; + new(str: string, encoding?: string): Buffer; /** * Allocates a new buffer of {size} octets. * * @param size count of octets to allocate. */ - new (size: number): Buffer; + new(size: number): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. */ - new (array: Uint8Array): Buffer; + new(array: Uint8Array): Buffer; /** * Produces a Buffer backed by the same allocated memory as * the given {ArrayBuffer}. @@ -135,19 +135,19 @@ declare var Buffer: { * * @param arrayBuffer The ArrayBuffer with which to share memory. */ - new (arrayBuffer: ArrayBuffer): Buffer; + new(arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. */ - new (array: any[]): Buffer; + new(array: any[]): Buffer; /** * Copies the passed {buffer} data onto a new {Buffer} instance. * * @param buffer The buffer to copy. */ - new (buffer: Buffer): Buffer; + new(buffer: Buffer): Buffer; prototype: Buffer; /** * Allocates a new Buffer using an {array} of octets. @@ -250,7 +250,7 @@ declare var Buffer: { declare namespace NodeJS { export var Console: { prototype: Console; - new (stdout: WritableStream, stderr?: WritableStream): Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; } export interface ErrnoException extends Error { @@ -1324,7 +1324,7 @@ declare module "https" { } export var Agent: { - new (options?: AgentOptions): Agent; + new(options?: AgentOptions): Agent; }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; @@ -1959,7 +1959,7 @@ declare module "net" { } export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + new(options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; }; export interface ListenOptions { @@ -2464,6 +2464,7 @@ declare module "fs" { */ export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; export function writeFile(filename: string | number, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string | number, data: any, options: string, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; @@ -2780,7 +2781,7 @@ declare module "string_decoder" { end(buffer?: Buffer): string; } export var StringDecoder: { - new (encoding?: string): NodeStringDecoder; + new(encoding?: string): NodeStringDecoder; }; } @@ -3184,7 +3185,7 @@ declare module "crypto" { verifySpkac(spkac: Buffer): boolean; } export var Certificate: { - new (): Certificate; + new(): Certificate; (): Certificate; } @@ -4128,6 +4129,6 @@ declare module "_debugger" { } export var Client: { - new (): ClientInstance + new(): ClientInstance } } diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index 2b68de0c2e37d4831840c6cd740204880a28e79b..adbac3e577601a26ab0f05d8c1bce4ab390ffdca 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -409,11 +409,11 @@ class ChainableEvent implements IChainableEvent { constructor(private _event: Event) { } - map(fn) { + map(fn: (i: T) => O): IChainableEvent { return new ChainableEvent(mapEvent(this._event, fn)); } - filter(fn) { + filter(fn: (e: T) => boolean): IChainableEvent { return new ChainableEvent(filterEvent(this._event, fn)); } diff --git a/src/vs/base/node/extfs.ts b/src/vs/base/node/extfs.ts index ecffac0980deb2fb680e36e88b072a9e8f9d3242..6b99256462b6a1a65239a1e247d43b8aa53d00aa 100644 --- a/src/vs/base/node/extfs.ts +++ b/src/vs/base/node/extfs.ts @@ -451,4 +451,4 @@ export function realpath(path: string, callback: (error: Error, realpath: string function normalizePath(path: string): string { return strings.rtrim(paths.normalize(path), paths.sep); -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts index 7db3d8f0c5a3a155b94795c8f134b608c3592e4b..0115099afdc7920381c79eb0e34a1e95b8a99a05 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts @@ -149,7 +149,7 @@ export class DefinitionAction extends EditorAction { revealIfVisible: !sideBySide } }, sideBySide).then(editor => { - return editor && editor.getControl(); + return editor && editor.getControl(); }); } diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts index d54532548279ad585068ac5204f71faee99cd945..4951c14ec8c8f9fe23c2e002d3e2c05897dcf65e 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts @@ -6,7 +6,6 @@ 'use strict'; import 'vs/css!./messageController'; -import { any } from 'vs/base/common/event'; import { setDisposableTimeout } from 'vs/base/common/async'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -62,12 +61,10 @@ export class MessageController { this._messageWidget = new MessageWidget(this._editor, position, message); // close on blur, cursor, model change, dispose - this._messageListeners.push(any( - this._editor.onDidBlurEditorText, - this._editor.onDidChangeCursorPosition, - this._editor.onDidDispose, - this._editor.onDidChangeModel - )(this.closeMessage, this)); + this._messageListeners.push(this._editor.onDidBlurEditorText(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidChangeCursorPosition(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidDispose(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidChangeModel(() => this.closeMessage())); // close after 3s this._messageListeners.push(setDisposableTimeout(() => this.closeMessage(), 3000)); @@ -184,4 +181,4 @@ registerThemingParticipant((theme, collector) => { if (background) { collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`); } -}); \ No newline at end of file +}); diff --git a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts index 0e9b8d4f0040ba905da768498e752d683a24f763..401e489ee0f1a65df9e465434330800370c1b370 100644 --- a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts +++ b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts @@ -234,22 +234,22 @@ namespace schema { }, icon: { description: localize('vscode.extension.contributes.commandType.icon', '(Optional) Icon which is used to represent the command in the UI. Either a file path or a themable configuration'), - anyOf: [ - 'string', - { - type: 'object', - properties: { - light: { - description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'), - type: 'string' - }, - dark: { - description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'), - type: 'string' - } + anyOf: [{ + type: 'string' + }, + { + type: 'object', + properties: { + light: { + description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'), + type: 'string' + }, + dark: { + description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'), + type: 'string' } } - ] + }] } } }; diff --git a/src/vs/workbench/services/progress/browser/progressService2.ts b/src/vs/workbench/services/progress/browser/progressService2.ts index 583d16c913d490bfce00ac35117cfd7f5ef9c9fc..7f55c70b15e7787832afd8251304fd115c3b98f8 100644 --- a/src/vs/workbench/services/progress/browser/progressService2.ts +++ b/src/vs/workbench/services/progress/browser/progressService2.ts @@ -129,7 +129,7 @@ export class ProgressService2 implements IProgressService2 { } } - private _withViewletProgress(viewletId: string, task: (progress: IProgress) => TPromise): void { + private _withViewletProgress(viewletId: string, task: (progress: IProgress<{ message?: string, percentage?: number }>) => TPromise): void { const promise = task(emptyProgress); diff --git a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts index 447581c40b033ed6debbf93b35ed3e6e679d9d22..9e4fb57d0191c2c0313da33c50eff733219c7dfe 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts @@ -29,7 +29,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands(OneGetThreadService(shape), undefined); - commands.registerCommand('foo', () => { }).dispose(); + commands.registerCommand('foo', (): any => { }).dispose(); assert.equal(lastUnregister, 'foo'); assert.equal(CommandsRegistry.getCommand('foo'), undefined); @@ -50,7 +50,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands(OneGetThreadService(shape), undefined); - const reg = commands.registerCommand('foo', () => { }); + const reg = commands.registerCommand('foo', (): any => { }); reg.dispose(); reg.dispose(); reg.dispose();