From f2c47075c8dd2f16d5ebdd6215e5f36361d5d5c4 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 30 Dec 2016 19:28:08 +0100 Subject: [PATCH] tslint: less implicit any use --- src/vs/base/browser/builder.ts | 2 +- src/vs/base/browser/event.ts | 6 +++--- src/vs/base/browser/htmlContentRenderer.ts | 2 +- src/vs/base/browser/ui/list/listView.ts | 2 +- src/vs/base/browser/ui/list/listWidget.ts | 4 ++-- src/vs/base/common/async.ts | 2 +- src/vs/base/common/color.ts | 6 +++--- src/vs/base/common/comparers.ts | 4 ++-- src/vs/base/common/decorators.ts | 2 +- src/vs/base/common/diagnostics.ts | 2 +- src/vs/base/common/diff/diff2.ts | 4 ++-- src/vs/base/common/event.ts | 6 +++--- src/vs/base/common/filters.ts | 4 ++-- src/vs/base/common/json.ts | 2 +- src/vs/base/common/map.ts | 2 +- src/vs/base/common/platform.ts | 6 +++--- src/vs/base/node/zip.ts | 2 +- src/vs/platform/environment/node/argv.ts | 2 +- .../keybinding/common/keybindingsRegistry.ts | 2 +- .../api/node/mainThreadEditorsTracker.ts | 2 +- .../api/node/mainThreadTreeExplorers.ts | 2 +- .../workbench/api/node/mainThreadWorkspace.ts | 6 +++--- .../browser/parts/editor/editorGroupsControl.ts | 2 -- .../browser/parts/editor/tabsTitleControl.ts | 2 +- .../common/editor/editorStacksModel.ts | 2 +- .../electron-browser/debugEditorContribution.ts | 2 +- .../parts/debug/electron-browser/debugHover.ts | 6 +++--- .../parts/debug/electron-browser/repl.ts | 2 -- .../parts/debug/electron-browser/replViewer.ts | 2 +- .../explorers/browser/views/treeExplorerView.ts | 10 +--------- .../extensions/browser/extensionsActions.ts | 2 +- .../extensions/browser/extensionsQuickOpen.ts | 2 +- .../parts/files/browser/fileActions.ts | 1 - .../parts/files/browser/saveErrorHandler.ts | 1 - .../preferences/browser/preferencesEditor.ts | 6 +++--- .../parts/search/common/searchModel.ts | 2 +- .../electron-browser/snippetsTracker.ts | 2 -- .../electron-browser/terminalInstance.ts | 4 ++-- .../electron-browser/releaseNotesEditor.ts | 6 ------ .../parts/update/electron-browser/update.ts | 17 +++++++---------- .../configuration/node/configurationService.ts | 2 +- .../node/configurationEditingService.test.ts | 4 +--- .../node/configurationResolverService.ts | 2 +- .../services/search/node/textSearch.ts | 2 +- .../services/search/node/worker/searchWorker.ts | 2 +- .../services/telemetry/common/workspaceStats.ts | 5 +++-- .../services/textfile/common/textFileService.ts | 2 -- .../electron-browser/textFileService.ts | 4 +--- .../electron-browser/stylesContributions.ts | 4 ++-- .../themes/electron-browser/themeService.ts | 6 +++--- src/vs/workbench/test/workbenchTestServices.ts | 3 +-- 51 files changed, 74 insertions(+), 105 deletions(-) diff --git a/src/vs/base/browser/builder.ts b/src/vs/base/browser/builder.ts index fd1f4e809dd..4f586a24a2e 100644 --- a/src/vs/base/browser/builder.ts +++ b/src/vs/base/browser/builder.ts @@ -692,7 +692,7 @@ export class Builder implements IDisposable { } }; - return this.on(arg1, fn, listenerToUnbindContainer); + return this.on(arg1, fn, listenerToUnbindContainer, useCapture); } /** diff --git a/src/vs/base/browser/event.ts b/src/vs/base/browser/event.ts index 3cec88098ba..6da3585864e 100644 --- a/src/vs/base/browser/event.ts +++ b/src/vs/base/browser/event.ts @@ -114,14 +114,14 @@ export interface IDomEvent { (element: EventHandler, type: string, useCapture?: boolean): _Event; } -export const domEvent: IDomEvent = (element: EventHandler, type: string, useCapture?) => { +export const domEvent: IDomEvent = (element: EventHandler, type: string, useCapture?: boolean) => { const fn = e => emitter.fire(e); const emitter = new Emitter({ onFirstListenerAdd: () => { - element.addEventListener(type, fn); + element.addEventListener(type, fn, useCapture); }, onLastListenerRemove: () => { - element.removeEventListener(type, fn); + element.removeEventListener(type, fn, useCapture); } }); diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 2239732614d..e06eedb4d6d 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -91,7 +91,7 @@ function _renderHtml(content: IHTMLContentElement, options: RenderOptions = {}): const renderer = new marked.Renderer(); renderer.image = (href: string, title: string, text: string) => { - let dimensions = []; + let dimensions: string[] = []; if (href) { const splitted = href.split('|').map(s => s.trim()); href = splitted[0]; diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index dc2ae29ed42..6fec843ae34 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -240,7 +240,7 @@ export class ListView implements IDisposable { return DOM.addDisposableListener(domNode, type, handler, useCapture); } - private fireScopedEvent(handler: (event: any) => void, index) { + private fireScopedEvent(handler: (event: any) => void, index: number) { if (index < 0) { return; } diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 36581beb633..f05b962354a 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -65,7 +65,7 @@ class Trait implements IDisposable { splice(start: number, deleteCount: number, insertCount: number): void { const diff = insertCount - deleteCount; const end = start + deleteCount; - const indexes = []; + const indexes: number[] = []; for (let index of indexes) { if (index >= start && index < end) { @@ -110,7 +110,7 @@ class Trait implements IDisposable { class FocusTrait extends Trait { - constructor(private getElementId: (number) => string) { + constructor(private getElementId: (number: number) => string) { super('focused'); } diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index 55442230b02..b899d0f7350 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -402,7 +402,7 @@ export function sequence(promiseFactories: ITask>[]): TPromise(promiseFactories: ITask>[], shouldStop: (t: T) => boolean = t => !!t): TPromise { promiseFactories = [...promiseFactories.reverse()]; - const loop = () => { + const loop: () => TPromise = () => { if (promiseFactories.length === 0) { return TPromise.as(null); } diff --git a/src/vs/base/common/color.ts b/src/vs/base/common/color.ts index a532c64cc86..bbc24c4aa3b 100644 --- a/src/vs/base/common/color.ts +++ b/src/vs/base/common/color.ts @@ -65,12 +65,12 @@ function hsla2rgba(hsla: HSLA): RGBA { let s = Math.min(hsla.s, 1); let l = Math.min(hsla.l, 1); let a = hsla.a === void 0 ? hsla.a : 1; - let r, g, b; + let r: number, g: number, b: number; if (s === 0) { r = g = b = l; // achromatic } else { - let hue2rgb = function hue2rgb(p, q, t) { + let hue2rgb = function hue2rgb(p: number, q: number, t: number) { if (t < 0) { t += 1; } @@ -115,7 +115,7 @@ export class Color { * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white. */ public getLuminosity(): number { - let luminosityFor = function (color): number { + let luminosityFor = function (color: number): number { let c = color / 255; return (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4); }; diff --git a/src/vs/base/common/comparers.ts b/src/vs/base/common/comparers.ts index a90bc8f98a5..7a77f168718 100644 --- a/src/vs/base/common/comparers.ts +++ b/src/vs/base/common/comparers.ts @@ -83,8 +83,8 @@ export function compareByPrefix(one: string, other: string, lookFor: string): nu } export interface IScorableResourceAccessor { - getLabel(T): string; - getResourcePath(T): string; + getLabel(t: T): string; + getResourcePath(t: T): string; } export function compareByScore(elementA: T, elementB: T, accessor: IScorableResourceAccessor, lookFor: string, lookForNormalizedLower: string, scorerCache?: { [key: string]: number }): number { diff --git a/src/vs/base/common/decorators.ts b/src/vs/base/common/decorators.ts index d20f57e96c3..e7330957a46 100644 --- a/src/vs/base/common/decorators.ts +++ b/src/vs/base/common/decorators.ts @@ -23,7 +23,7 @@ export function memoize(target: any, key: string, descriptor: any) { const memoizeKey = `$memoize$${key}`; - descriptor[fnKey] = function (...args) { + descriptor[fnKey] = function (...args: any[]) { if (!this.hasOwnProperty(memoizeKey)) { Object.defineProperty(this, memoizeKey, { configurable: false, diff --git a/src/vs/base/common/diagnostics.ts b/src/vs/base/common/diagnostics.ts index dc866d18614..9c0e4f6df8f 100644 --- a/src/vs/base/common/diagnostics.ts +++ b/src/vs/base/common/diagnostics.ts @@ -19,7 +19,7 @@ globals.Monaco.Diagnostics = {}; var switches = globals.Monaco.Diagnostics; var map = {}; -var data = []; +var data: any[] = []; function fifo(array: any[], size: number) { while (array.length > size) { diff --git a/src/vs/base/common/diff/diff2.ts b/src/vs/base/common/diff/diff2.ts index c37b16e49e5..91a92308335 100644 --- a/src/vs/base/common/diff/diff2.ts +++ b/src/vs/base/common/diff/diff2.ts @@ -148,8 +148,8 @@ export class LcsDiff2 { // Construct the changes let i = 0; let j = 0; - let xChangeStart, yChangeStart; - let changes = []; + let xChangeStart: number, yChangeStart: number; + let changes: DiffChange[] = []; while (i < xLength && j < yLength) { if (this.resultX[i] && this.resultY[j]) { // No change diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index 9f9d99f83d1..926667f2a24 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -218,7 +218,7 @@ export function once(event: Event): Event { } export function any(...events: Event[]): Event { - let listeners = []; + let listeners: IDisposable[] = []; const emitter = new Emitter({ onFirstListenerAdd() { @@ -297,7 +297,7 @@ export class EventBufferer { } bufferEvents(fn: () => void): void { - const buffer = []; + const buffer: Function[] = []; this.buffers.push(buffer); fn(); this.buffers.pop(); @@ -334,7 +334,7 @@ class ChainableEvent implements IChainableEvent { return new ChainableEvent(filterEvent(this._event, fn)); } - on(listener, thisArgs, disposables) { + on(listener, thisArgs, disposables: IDisposable[]) { return this._event(listener, thisArgs, disposables); } } diff --git a/src/vs/base/common/filters.ts b/src/vs/base/common/filters.ts index ad0bc3ef508..66e7daaa755 100644 --- a/src/vs/base/common/filters.ts +++ b/src/vs/base/common/filters.ts @@ -209,7 +209,7 @@ function analyzeCamelCaseWord(word: string): ICamelCaseAnalysis { } function isUpperCaseWord(analysis: ICamelCaseAnalysis): boolean { - const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis; + const { upperPercent, lowerPercent } = analysis; return lowerPercent === 0 && upperPercent > 0.6; } @@ -298,7 +298,7 @@ function _matchesWords(word: string, target: string, i: number, j: number): IMat } else if (word[i] !== target[j].toLowerCase()) { return null; } else { - let result = null; + let result: IMatch[] = null; let nextWordIndex = j + 1; result = _matchesWords(word, target, i + 1, j + 1); while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) { diff --git a/src/vs/base/common/json.ts b/src/vs/base/common/json.ts index 62ba0371429..a22159dfc85 100644 --- a/src/vs/base/common/json.ts +++ b/src/vs/base/common/json.ts @@ -42,7 +42,7 @@ export interface JSONScanner { /** * Sets the scan position to a new offset. A call to 'scan' is needed to get the first token. */ - setPosition(pos: number); + setPosition(pos: number): void; /** * Read the next token. Returns the tolen code. */ diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 2e57ca4cbc1..3906356d003 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -310,7 +310,7 @@ class Node { */ export class TrieMap { - static PathSplitter = s => s.split(/[\\/]/).filter(s => !!s); + static PathSplitter = (s: string) => s.split(/[\\/]/).filter(s => !!s); private _splitter: (s: string) => string[]; private _root = new Node(); diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts index 3075beb0a97..3ba367b9b62 100644 --- a/src/vs/base/common/platform.ts +++ b/src/vs/base/common/platform.ts @@ -13,8 +13,8 @@ let _isRootUser = false; let _isNative = false; let _isWeb = false; let _isQunit = false; -let _locale = undefined; -let _language = undefined; +let _locale: string = undefined; +let _language: string = undefined; interface NLSConfig { locale: string; @@ -124,7 +124,7 @@ interface IGlobals { clearTimeout(token: TimeoutToken): void; setInterval(callback: (...args: any[]) => void, delay: number, ...args: any[]): IntervalToken; - clearInterval(token: IntervalToken); + clearInterval(token: IntervalToken): void; } const _globals = (typeof self === 'object' ? self : global); diff --git a/src/vs/base/node/zip.ts b/src/vs/base/node/zip.ts index 222149de148..aabb762c20e 100644 --- a/src/vs/base/node/zip.ts +++ b/src/vs/base/node/zip.ts @@ -106,7 +106,7 @@ function read(zipPath: string, filePath: string): TPromise { export function buffer(zipPath: string, filePath: string): TPromise { return read(zipPath, filePath).then(stream => { return new TPromise((c, e) => { - const buffers = []; + const buffers: Buffer[] = []; stream.once('error', e); stream.on('data', b => buffers.push(b)); stream.on('end', () => c(Buffer.concat(buffers))); diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index 13e55e6f3fb..caa91b82bb4 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -148,7 +148,7 @@ export function formatOptions(options: { [name: string]: string; }, columns: num } function wrapText(text: string, columns: number): string[] { - let lines = []; + let lines: string[] = []; while (text.length) { let index = text.length < columns ? text.length : text.lastIndexOf(' ', columns); let line = text.slice(0, index).trim(); diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts index 02d64285d52..ea1ef26e4ce 100644 --- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts +++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts @@ -23,7 +23,7 @@ export interface ICommandAndKeybindingRule extends IKeybindingRule { } export interface IKeybindingsRegistry { - registerKeybindingRule(rule: IKeybindingRule); + registerKeybindingRule(rule: IKeybindingRule): void; registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): void; getDefaultKeybindings(): IKeybindingItem[]; diff --git a/src/vs/workbench/api/node/mainThreadEditorsTracker.ts b/src/vs/workbench/api/node/mainThreadEditorsTracker.ts index 0c72506ad9f..f742f730926 100644 --- a/src/vs/workbench/api/node/mainThreadEditorsTracker.ts +++ b/src/vs/workbench/api/node/mainThreadEditorsTracker.ts @@ -579,7 +579,7 @@ export class MainThreadEditorsTracker { } private _findVisibleTextEditorIds(): string[] { - let result = []; + let result: string[] = []; let modelUris = Object.keys(this._model2TextEditors); for (let i = 0, len = modelUris.length; i < len; i++) { let editors = this._model2TextEditors[modelUris[i]]; diff --git a/src/vs/workbench/api/node/mainThreadTreeExplorers.ts b/src/vs/workbench/api/node/mainThreadTreeExplorers.ts index c0f8ded4be4..178c1e4ac93 100644 --- a/src/vs/workbench/api/node/mainThreadTreeExplorers.ts +++ b/src/vs/workbench/api/node/mainThreadTreeExplorers.ts @@ -16,7 +16,7 @@ export class MainThreadTreeExplorers extends MainThreadTreeExplorersShape { private _proxy: ExtHostTreeExplorersShape; constructor( - @IThreadService private threadService: IThreadService, + @IThreadService threadService: IThreadService, @ITreeExplorerService private treeExplorerService: ITreeExplorerService, @IMessageService private messageService: IMessageService, @ICommandService private commandService: ICommandService diff --git a/src/vs/workbench/api/node/mainThreadWorkspace.ts b/src/vs/workbench/api/node/mainThreadWorkspace.ts index cab823119aa..3a2223513a7 100644 --- a/src/vs/workbench/api/node/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/node/mainThreadWorkspace.ts @@ -30,9 +30,9 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape { constructor( @ISearchService searchService: ISearchService, @IWorkspaceContextService contextService: IWorkspaceContextService, - @ITextFileService textFileService, - @IWorkbenchEditorService editorService, - @ITextModelResolverService textModelResolverService, + @ITextFileService textFileService: ITextFileService, + @IWorkbenchEditorService editorService: IWorkbenchEditorService, + @ITextModelResolverService textModelResolverService: ITextModelResolverService, @IFileService fileService: IFileService ) { super(); diff --git a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts index 7df18064577..ce92c4c1a14 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts @@ -22,7 +22,6 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { Position, POSITIONS } from 'vs/platform/editor/common/editor'; import { IEditorGroupService, ITabOptions, GroupArrangement, GroupOrientation } from 'vs/workbench/services/group/common/groupService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -139,7 +138,6 @@ export class EditorGroupsControl implements IEditorGroupsControl, IVerticalSashL @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorGroupService: IEditorGroupService, @ITelemetryService private telemetryService: ITelemetryService, - @IConfigurationService private configurationService: IConfigurationService, @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionService private extensionService: IExtensionService, @IInstantiationService private instantiationService: IInstantiationService, diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index cc3e6831b22..7ede1f4eb2b 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -425,7 +425,7 @@ export class TabsTitleControl extends TitleControl { } private hookTabListeners(tab: HTMLElement, index: number): IDisposable { - const disposables = []; + const disposables: IDisposable[] = []; // Open on Click disposables.push(DOM.addDisposableListener(tab, DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index 9998b376d9a..94bad196395 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -559,7 +559,7 @@ export class EditorGroup implements IEditorGroup { // It is possible to have the same resource opened twice (once as normal input and once as diff input) // So we need to do ref counting on the resource to provide the correct picture let counter = this.mapResourceToEditorCount[resource.toString()] || 0; - let newCounter; + let newCounter: number; if (remove) { if (counter > 1) { newCounter = counter - 1; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index 3f866eb3759..4fd7b01fa9d 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -66,7 +66,7 @@ export class DebugEditorContribution implements IDebugEditorContribution { } private getContextMenuActions(breakpoint: IBreakpoint, uri: uri, lineNumber: number): TPromise { - const actions = []; + const actions: IAction[] = []; if (breakpoint) { actions.push(this.instantiationService.createInstance(RemoveBreakpointAction, RemoveBreakpointAction.ID, RemoveBreakpointAction.LABEL)); actions.push(this.instantiationService.createInstance(EditConditionalBreakpointAction, EditConditionalBreakpointAction.ID, EditConditionalBreakpointAction.LABEL, this.editor, lineNumber)); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts index 6104389492a..344ef9cf51a 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts @@ -110,13 +110,13 @@ export class DebugHoverWidget implements IContentWidget { } private getExactExpressionRange(lineContent: string, range: Range): Range { - let matchingExpression = undefined; + let matchingExpression: string = undefined; let startOffset = 0; // Some example supported expressions: myVar.prop, a.b.c.d, myVar?.prop, myVar->prop, MyClass::StaticProp, *myVar // Match any character except a set of characters which often break interesting sub-expressions let expression: RegExp = /([^()\[\]{}<>\s+\-/%~#^;=|,`!]|\->)+/g; - let result = undefined; + let result: RegExpExecArray = undefined; // First find the full expression under the cursor while (result = expression.exec(lineContent)) { @@ -134,7 +134,7 @@ export class DebugHoverWidget implements IContentWidget { // For example in expression 'a.b.c.d', if the focus was under 'b', 'a.b' would be evaluated. if (matchingExpression) { let subExpression: RegExp = /\w+/g; - let subExpressionResult = undefined; + let subExpressionResult: RegExpExecArray = undefined; while (subExpressionResult = subExpression.exec(matchingExpression)) { let subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length; if (subEnd >= range.endColumn) { diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index 7b5e93d976f..64ecd31fb0b 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -29,7 +29,6 @@ import { MenuId } from 'vs/platform/actions/common/actions'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ReplExpressionsRenderer, ReplExpressionsController, ReplExpressionsDataSource, ReplExpressionsActionProvider, ReplExpressionsAccessibilityProvider } from 'vs/workbench/parts/debug/electron-browser/replViewer'; @@ -81,7 +80,6 @@ export class Repl extends Panel implements IPrivateReplService { constructor( @debug.IDebugService private debugService: debug.IDebugService, - @IContextMenuService private contextMenuService: IContextMenuService, @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService, @IStorageService private storageService: IStorageService, diff --git a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts index 22b9551cb7c..ed9ad8d3cfd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts @@ -373,7 +373,7 @@ export class ReplExpressionsRenderer implements IRenderer { pattern.lastIndex = 0; // the holy grail of software development const match = pattern.exec(text); - let resource = null; + let resource: uri = null; try { resource = match && uri.file(match[1]); } catch (e) { } diff --git a/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts b/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts index 183d1ddccd9..28ed164473a 100644 --- a/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts +++ b/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts @@ -50,19 +50,11 @@ export class TreeExplorerView extends CollapsibleViewletView { const dataSource = this.instantiationService.createInstance(TreeDataSource, this.treeNodeProviderId); const renderer = this.instantiationService.createInstance(TreeRenderer, this.viewletState, this.actionRunner, container.getHTMLElement()); const controller = this.instantiationService.createInstance(TreeController, this.treeNodeProviderId); - const sorter = null; - const filter = null; - const dnd = null; - const accessibilityProvider = null; return new Tree(container.getHTMLElement(), { dataSource, renderer, - controller, - sorter, - filter, - dnd, - accessibilityProvider + controller }); } diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index 524f44128e4..eba4ecb0047 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -313,7 +313,7 @@ export class DropDownMenuActionItem extends ActionItem { } private getActions(): IAction[] { - let actions = []; + let actions: IAction[] = []; const menuActionGroups = this.menuActionGroups.filter(group => group.some(action => action.enabled)); for (const menuActions of menuActionGroups) { actions = [...actions, ...menuActions, new Separator()]; diff --git a/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts b/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts index db0612bd1f8..7f99ba447e9 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts @@ -72,7 +72,7 @@ export class GalleryExtensionsHandler extends QuickOpenHandler { } getResults(text: string): TPromise> { - const entries = []; + const entries: SimpleEntry[] = []; if (text) { const label = nls.localize('searchFor', "Press Enter to search for '{0}' in the Marketplace.", text); diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index 9733f4c95de..94b082fb8ff 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -1174,7 +1174,6 @@ export class CompareResourcesAction extends Action { constructor( resource: URI, tree: ITree, - @IInstantiationService private instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService ) { super('workbench.files.action.compareFiles', CompareResourcesAction.computeLabel()); diff --git a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts index 8de0dfa8fc3..1e716709f59 100644 --- a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts +++ b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts @@ -183,7 +183,6 @@ class ResolveSaveConflictMessage implements IMessageWithAction { model: ITextFileEditorModel, message: string, @IMessageService private messageService: IMessageService, - @IInstantiationService private instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEnvironmentService private environmentService: IEnvironmentService ) { diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 197d0fb3dc5..c31f0532651 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -97,7 +97,7 @@ export class DefaultPreferencesEditor extends BaseTextEditor { public static ID: string = 'workbench.editor.defaultPreferences'; private static VIEW_STATE: Map = new Map(); - private inputDisposeListener; + private inputDisposeListener: IDisposable; private defaultSettingHeaderWidget: DefaultSettingsHeaderWidget; private delayedFilterLogging: Delayer; @@ -244,8 +244,8 @@ class DefaultPreferencesCodeEditor extends CodeEditor { } export interface IPreferencesRenderer { - render(); - dispose(); + render(): void; + dispose(): void; } export abstract class PreferencesEditorContribution extends Disposable implements editorCommon.IEditorContribution { diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index bca28da2a8b..9847b83b1f0 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -503,7 +503,7 @@ export class SearchModel extends Disposable { private currentRequest: PPromise; - constructor( @ISearchService private searchService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) { + constructor( @ISearchService private searchService: ISearchService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) { super(); this._searchResult = this.instantiationService.createInstance(SearchResult, this); } diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts index 1dce853f6a9..3d95492bca2 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts @@ -14,7 +14,6 @@ import { mkdirp, fileExists, readdir } from 'vs/base/node/pfs'; import { onUnexpectedError } from 'vs/base/common/errors'; import lifecycle = require('vs/base/common/lifecycle'); import { readAndRegisterSnippets } from 'vs/editor/node/textMate/TMSnippets'; -import { IFileService } from 'vs/platform/files/common/files'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { watch, FSWatcher } from 'fs'; @@ -28,7 +27,6 @@ export class SnippetsTracker implements workbenchExt.IWorkbenchContribution { private fileWatchDelayer: async.ThrottledDelayer; constructor( - @IFileService private fileService: IFileService, @ILifecycleService private lifecycleService: ILifecycleService, @IEnvironmentService environmentService: IEnvironmentService ) { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 6121cc1c58c..07181e043b5 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -306,7 +306,7 @@ export class TerminalInstance implements ITerminalInstance { } protected _getCwd(workspace: IWorkspace, ignoreCustomCwd: boolean): string { - let cwd; + let cwd: string; // TODO: Handle non-existent customCwd if (!ignoreCustomCwd) { @@ -355,7 +355,7 @@ export class TerminalInstance implements ITerminalInstance { this._onProcessIdReady.fire(this); } }); - this._process.on('exit', (exitCode) => { + this._process.on('exit', (exitCode: number) => { // Prevent dispose functions being triggered multiple times if (!this._isExiting) { this.dispose(); diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts index 40c3a86214e..85f19d8c247 100644 --- a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts @@ -16,10 +16,7 @@ import { IThemeService } from 'vs/workbench/services/themes/common/themeService' import { ReleaseNotesInput } from './releaseNotesInput'; import { EditorOptions } from 'vs/workbench/common/editor'; import WebView from 'vs/workbench/parts/html/browser/webview'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IRequestService } from 'vs/platform/request/node/request'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IModeService } from 'vs/editor/common/services/modeService'; import { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer'; @@ -46,10 +43,7 @@ export class ReleaseNotesEditor extends BaseEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, @IThemeService private themeService: IThemeService, - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IRequestService private requestService: IRequestService, @IOpenerService private openerService: IOpenerService, - @IKeybindingService private keybindingService: IKeybindingService, @IModeService private modeService: IModeService ) { super(ReleaseNotesEditor.ID, telemetryService); diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index b2471615aee..c537d235a44 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -119,13 +119,12 @@ export class OpenLatestReleaseNotesInBrowserAction extends Action { export abstract class AbstractShowReleaseNotesAction extends Action { constructor( - id, - label, + id: string, + label: string, private returnValue: boolean, private version: string, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IInstantiationService private instantiationService: IInstantiationService, - @IOpenerService private openerService: IOpenerService + @IInstantiationService private instantiationService: IInstantiationService ) { super(id, label, null, true); } @@ -153,10 +152,9 @@ export class ShowReleaseNotesAction extends AbstractShowReleaseNotesAction { returnValue: boolean, version: string, @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IInstantiationService instantiationService: IInstantiationService, - @IOpenerService openerService: IOpenerService + @IInstantiationService instantiationService: IInstantiationService ) { - super('update.showReleaseNotes', nls.localize('releaseNotes', "Release Notes"), returnValue, version, editorService, instantiationService, openerService); + super('update.showReleaseNotes', nls.localize('releaseNotes', "Release Notes"), returnValue, version, editorService, instantiationService); } } @@ -169,10 +167,9 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio id = ShowCurrentReleaseNotesAction.ID, label = ShowCurrentReleaseNotesAction.LABEL, @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IInstantiationService instantiationService: IInstantiationService, - @IOpenerService openerService: IOpenerService + @IInstantiationService instantiationService: IInstantiationService ) { - super(id, label, true, pkg.version, editorService, instantiationService, openerService); + super(id, label, true, pkg.version, editorService, instantiationService); } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index f028e5e8491..b1ef6c8fa37 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -187,7 +187,7 @@ export class WorkspaceConfigurationService implements IWorkspaceConfigurationSer this.cachedWorkspaceConfig = workspaceConfig; // Cache keys - const workspaceConfigKeys = []; + const workspaceConfigKeys: string[] = []; Object.keys(workspaceConfigFiles).forEach(path => { if (path === WORKSPACE_CONFIG_DEFAULT_PATH) { workspaceConfigKeys.push(...Object.keys(workspaceConfigFiles[path].raw)); diff --git a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts index aa4fd21fe51..193e17db95b 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -25,7 +25,6 @@ import URI from 'vs/base/common/uri'; import { FileService } from 'vs/workbench/services/files/node/fileService'; import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService'; import { ConfigurationTarget, IConfigurationEditingError, ConfigurationEditingErrorCode } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IFileService } from 'vs/platform/files/common/files'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -56,7 +55,6 @@ class TestDirtyTextFileService extends TestTextFileService { @IConfigurationService configurationService: IConfigurationService, @ITelemetryService telemetryService: ITelemetryService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IEditorGroupService editorGroupService: IEditorGroupService, @IFileService fileService: IFileService, @IUntitledEditorService untitledEditorService: IUntitledEditorService, @IInstantiationService instantiationService: IInstantiationService, @@ -64,7 +62,7 @@ class TestDirtyTextFileService extends TestTextFileService { @IBackupFileService backupFileService: IBackupFileService, @IWindowsService windowsService: IWindowsService ) { - super(lifecycleService, contextService, configurationService, telemetryService, editorService, editorGroupService, fileService, untitledEditorService, instantiationService, messageService, backupFileService, windowsService); + super(lifecycleService, contextService, configurationService, telemetryService, editorService, fileService, untitledEditorService, instantiationService, messageService, backupFileService, windowsService); } public isDirty(resource?: URI): boolean { diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index f214ca62645..71a230c677c 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -221,7 +221,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi const factory: { (): TPromise }[] = Object.keys(interactiveVariablesToSubstitutes).map(interactiveVariable => { return () => { - let commandId = null; + let commandId: string = null; commandId = interactiveVariablesMap ? interactiveVariablesMap[interactiveVariable] : null; if (!commandId) { // Just launch any command if the interactive variable is not contributed by the adapter #12735 diff --git a/src/vs/workbench/services/search/node/textSearch.ts b/src/vs/workbench/services/search/node/textSearch.ts index 65ef0a1121b..eb82da7bf10 100644 --- a/src/vs/workbench/services/search/node/textSearch.ts +++ b/src/vs/workbench/services/search/node/textSearch.ts @@ -121,7 +121,7 @@ export class Engine implements ISearchEngine { }; // Walk over the file system - let nextBatch = []; + let nextBatch: string[] = []; let nextBatchBytes = 0; const batchFlushBytes = 2 ** 20; // 1MB this.walker.walk(this.config.rootFolders, this.config.extraFiles, result => { diff --git a/src/vs/workbench/services/search/node/worker/searchWorker.ts b/src/vs/workbench/services/search/node/worker/searchWorker.ts index 2f5c52809fa..4f845374d15 100644 --- a/src/vs/workbench/services/search/node/worker/searchWorker.ts +++ b/src/vs/workbench/services/search/node/worker/searchWorker.ts @@ -177,7 +177,7 @@ export class SearchWorkerEngine { let lineNumber = 0; let lastBufferHadTraillingCR = false; - const decodeBuffer = (buffer: NodeBuffer, start, end): string => { + const decodeBuffer = (buffer: NodeBuffer, start: number, end: number): string => { if (options.encoding === UTF8 || options.encoding === UTF8_with_bom) { return buffer.toString(undefined, start, end); // much faster to use built in toString() when encoding is default } diff --git a/src/vs/workbench/services/telemetry/common/workspaceStats.ts b/src/vs/workbench/services/telemetry/common/workspaceStats.ts index 79ad84e73e9..7f64418ade1 100644 --- a/src/vs/workbench/services/telemetry/common/workspaceStats.ts +++ b/src/vs/workbench/services/telemetry/common/workspaceStats.ts @@ -60,7 +60,8 @@ function extractDomain(url: string): string { } export function getDomainsOfRemotes(text: string, whitelist: string[]): string[] { - let domains = new ArraySet(), match; + let domains = new ArraySet(); + let match: RegExpExecArray; while (match = RemoteMatcher.exec(text)) { let domain = extractDomain(match[1]); if (domain) { @@ -242,7 +243,7 @@ export class WorkspaceStats { ); } - private reportAzure(uri) { + private reportAzure(uri: URI) { const tags: Tags = Object.create(null); this.reportAzureNode(uri, tags).then((tags) => { return this.reportAzureJava(uri, tags); diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index c65c4a8fcc1..9da33446228 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -23,7 +23,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; @@ -61,7 +60,6 @@ export abstract class TextFileService implements ITextFileService { @IWorkspaceContextService private contextService: IWorkspaceContextService, @IConfigurationService private configurationService: IConfigurationService, @ITelemetryService private telemetryService: ITelemetryService, - @IEditorGroupService private editorGroupService: IEditorGroupService, @IFileService protected fileService: IFileService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IInstantiationService private instantiationService: IInstantiationService, diff --git a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts index 9455e4c12d7..31689440954 100644 --- a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts @@ -22,7 +22,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModelBuilder } from 'vs/editor/node/model/modelBuilder'; import product from 'vs/platform/node/product'; @@ -46,7 +45,6 @@ export class TextFileService extends AbstractTextFileService { @ITelemetryService telemetryService: ITelemetryService, @IConfigurationService configurationService: IConfigurationService, @IModeService private modeService: IModeService, - @IEditorGroupService editorGroupService: IEditorGroupService, @IWindowIPCService private windowService: IWindowIPCService, @IModelService private modelService: IModelService, @IEnvironmentService environmentService: IEnvironmentService, @@ -55,7 +53,7 @@ export class TextFileService extends AbstractTextFileService { @IStorageService private storageService: IStorageService, @IWindowsService windowsService: IWindowsService ) { - super(lifecycleService, contextService, configurationService, telemetryService, editorGroupService, fileService, untitledEditorService, instantiationService, messageService, environmentService, backupFileService, windowsService); + super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, environmentService, backupFileService, windowsService); } public resolveTextContent(resource: URI, options?: IResolveContentOptions): TPromise { diff --git a/src/vs/workbench/services/themes/electron-browser/stylesContributions.ts b/src/vs/workbench/services/themes/electron-browser/stylesContributions.ts index 27832128a7a..e6ed64d35cc 100644 --- a/src/vs/workbench/services/themes/electron-browser/stylesContributions.ts +++ b/src/vs/workbench/services/themes/electron-browser/stylesContributions.ts @@ -94,7 +94,7 @@ export class TokenStylesContribution { public contributeStyles(themeId: string, themeDocument: IThemeDocument, cssRules: string[]): void { let theme = new Theme(themeId, themeDocument); - theme.getSettings().forEach((s: IThemeSetting, index, arr) => { + theme.getSettings().forEach((s: IThemeSetting, index: number, arr: IThemeSetting[]) => { // @martin TS(2.0.2) - s.scope is already a string[] so no need for all this checking. // However will add a cast at split to keep semantic in case s.scope is wrongly typed. let scope: string | string[] = s.scope; @@ -127,7 +127,7 @@ export class TokenStylesContribution { //statements.push(`background-color: ${background};`); break; case 'fontStyle': - let segments = value.split(' '); + let segments: string[] = value.split(' '); segments.forEach(s => { switch (s) { case 'italic': diff --git a/src/vs/workbench/services/themes/electron-browser/themeService.ts b/src/vs/workbench/services/themes/electron-browser/themeService.ts index fc42eb47f2d..521268516b3 100644 --- a/src/vs/workbench/services/themes/electron-browser/themeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/themeService.ts @@ -434,7 +434,7 @@ export class ThemeService implements IThemeService { private _updateIconTheme(onApply: (theme: IInternalThemeData) => void): TPromise { return this.getFileIconThemes().then(allIconSets => { - let iconSetData; + let iconSetData: IInternalThemeData; for (let iconSet of allIconSets) { if (iconSet.id === this.currentIconTheme) { iconSetData = iconSet; @@ -533,7 +533,7 @@ function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, ic let fileExtensions = associations.fileExtensions; if (fileExtensions) { for (let fileExtension in fileExtensions) { - let selectors = []; + let selectors: string[] = []; let segments = fileExtension.toLowerCase().split('.'); for (let i = 0; i < segments.length; i++) { selectors.push(`.${escapeCSS(segments.slice(i).join('.'))}-ext-file-icon`); @@ -544,7 +544,7 @@ function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, ic let fileNames = associations.fileNames; if (fileNames) { for (let fileName in fileNames) { - let selectors = []; + let selectors: string[] = []; let segments = fileName.toLowerCase().split('.'); if (segments[0]) { selectors.push(`.${escapeCSS(segments[0])}-name-file-icon`); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index b21fbb11261..b3cb1743a4b 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -110,7 +110,6 @@ export class TestTextFileService extends TextFileService { @IConfigurationService configurationService: IConfigurationService, @ITelemetryService telemetryService: ITelemetryService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IEditorGroupService editorGroupService: IEditorGroupService, @IFileService fileService: IFileService, @IUntitledEditorService untitledEditorService: IUntitledEditorService, @IInstantiationService instantiationService: IInstantiationService, @@ -118,7 +117,7 @@ export class TestTextFileService extends TextFileService { @IBackupFileService backupFileService: IBackupFileService, @IWindowsService windowsService: IWindowsService ) { - super(lifecycleService, contextService, configurationService, telemetryService, editorGroupService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, windowsService); + super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, windowsService); } public setPromptPath(path: string): void {