From f7349ba525c480e90dd890f5f304c61a8dde1acd Mon Sep 17 00:00:00 2001 From: cleidigh Date: Tue, 31 Oct 2017 17:28:43 -0400 Subject: [PATCH 01/88] Fix logic for 1 editor Inc/Dec View command --- src/vs/workbench/browser/layout.ts | 34 ++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index e67ad9862b5..ada1860a349 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -700,7 +700,10 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal // change part size along the main axis public resizePart(part: Parts, sizeChange: number): void { - const visibleEditors = this.editorService.getVisibleEditors().length; + const visibleEditorCount = this.editorService.getVisibleEditors().length; + const isSidebarVisible = this.partService.isVisible(Parts.SIDEBAR_PART); + const isPanelVisible = this.partService.isVisible(Parts.PANEL_PART); + const panelPosition = this.partService.getPanelPosition(); const sizeChangePxWidth = this.workbenchSize.width * (sizeChange / 100); const sizeChangePxHeight = this.workbenchSize.height * (sizeChange / 100); @@ -710,24 +713,37 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal case Parts.SIDEBAR_PART: this.sidebarWidth = this.sidebarWidth + sizeChangePxWidth; // Sidebar can not become smaller than MIN_PART_WIDTH - if (this.layoutEditorGroupsVertically && (this.workbenchSize.width - this.sidebarWidth < visibleEditors * MIN_EDITOR_PART_WIDTH)) { - this.sidebarWidth = (this.workbenchSize.width - visibleEditors * MIN_EDITOR_PART_WIDTH); + if (this.layoutEditorGroupsVertically && (this.workbenchSize.width - this.sidebarWidth < visibleEditorCount * MIN_EDITOR_PART_WIDTH)) { + this.sidebarWidth = (this.workbenchSize.width - visibleEditorCount * MIN_EDITOR_PART_WIDTH); } doLayout = true; break; case Parts.PANEL_PART: - this.panelHeight = this.panelHeight + sizeChangePxHeight; - this.panelWidth = this.panelWidth + sizeChangePxWidth; + if (panelPosition === Position.BOTTOM) { + this.panelHeight = this.panelHeight + sizeChangePxHeight; + } else if (panelPosition === Position.RIGHT) { + this.panelWidth = this.panelWidth + sizeChangePxWidth; + } + doLayout = true; break; case Parts.EDITOR_PART: // If we have one editor we can cheat and resize sidebar with the negative delta - const visibleEditorCount = this.editorService.getVisibleEditors().length; - + // If the sidebar is not visible and panel is, resize panel main axis with negative Delta if (visibleEditorCount === 1) { - this.sidebarWidth = this.sidebarWidth - sizeChangePxWidth; - doLayout = true; + if (isSidebarVisible) { + this.sidebarWidth = this.sidebarWidth - sizeChangePxWidth; + doLayout = true; + } else if (isPanelVisible) { + if (panelPosition === Position.BOTTOM) { + this.panelHeight = this.panelHeight - sizeChangePxHeight; + } else if (panelPosition === Position.RIGHT) { + this.panelWidth = this.panelWidth - sizeChangePxWidth; + } + doLayout = true; + } + } else { const stacks = this.editorGroupService.getStacksModel(); const activeGroup = stacks.positionOfGroup(stacks.activeGroup); From 6387ea60fd0ce1ec8cf99253120740405954bdd7 Mon Sep 17 00:00:00 2001 From: Anton Vildyaev Date: Mon, 6 Nov 2017 13:11:14 +0100 Subject: [PATCH 02/88] Fix 37385 by introducing addition configuration setting --- src/vs/workbench/parts/debug/common/debug.ts | 7 +++++++ .../parts/debug/electron-browser/debug.contribution.ts | 3 ++- .../workbench/parts/debug/electron-browser/debugService.ts | 7 +++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 7683e3d99e3..8121fc42e81 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -47,6 +47,11 @@ export const INTERNAL_CONSOLE_OPTIONS_SCHEMA = { default: 'openOnFirstSessionStart', description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.") }; +export const DEBUG_VIEWLET_OPTIONS_SCHEMA = { + enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], + default: 'openOnFirstSessionStart', + description: nls.localize('debugViewletOptions', "Controls whether debug viewlet should be open on debugging session start.") +}; // raw @@ -323,6 +328,7 @@ export interface IDebugConfiguration { inlineValues: boolean; hideActionBar: boolean; internalConsoleOptions: string; + debugViewletOptions: string; } export interface IGlobalConfig { @@ -336,6 +342,7 @@ export interface IEnvConfig { type: string; request: string; internalConsoleOptions?: string; + debugViewletOptions?: string; preLaunchTask?: string; __restart?: any; __sessionId?: string; diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index f4b58609845..8ac9c2cef88 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -20,7 +20,7 @@ import { VariablesView, WatchExpressionsView, CallStackView, BreakpointsView } f import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA, - CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID + CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, DEBUG_VIEWLET_OPTIONS_SCHEMA } from 'vs/workbench/parts/debug/common/debug'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; @@ -188,6 +188,7 @@ configurationRegistry.registerConfiguration({ default: false }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, + 'debug.debugViewletOptions': DEBUG_VIEWLET_OPTIONS_SCHEMA, 'launch': { type: 'object', description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"), diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 8c2ce64e770..0ef356ad48d 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -872,8 +872,11 @@ export class DebugService implements debug.IDebugService { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } - if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY)) { - // We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden + const debugViewletOptions = configuration.debugViewletOptions || this.configurationService.getConfiguration('debug').debugViewletOptions; + // Open debug viewlet based on the visibility of the side bar and debugViewletOptions setting + if ((this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) + && ((debugViewletOptions === 'openOnSessionStart') + || ((debugViewletOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState)) { this.viewModel.changedWorkbenchViewState = true; this.viewletService.openViewlet(debug.VIEWLET_ID); } From d08a3ebc963b6669c1def144c8f0962335ab9405 Mon Sep 17 00:00:00 2001 From: Anton Vildyaev Date: Mon, 6 Nov 2017 13:58:20 +0100 Subject: [PATCH 03/88] fix compilation error --- src/vs/workbench/parts/debug/electron-browser/debugService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 0ef356ad48d..15c36fc56e5 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -876,7 +876,7 @@ export class DebugService implements debug.IDebugService { // Open debug viewlet based on the visibility of the side bar and debugViewletOptions setting if ((this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) && ((debugViewletOptions === 'openOnSessionStart') - || ((debugViewletOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState)) { + || (debugViewletOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState))) { this.viewModel.changedWorkbenchViewState = true; this.viewletService.openViewlet(debug.VIEWLET_ID); } From 813235c7f762f94d9a0a8411144a2e455b7d0a41 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 14:24:20 -0800 Subject: [PATCH 04/88] Move python extension to strict --- extensions/python/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/python/tsconfig.json b/extensions/python/tsconfig.json index a2b5bcdfddf..5df3e845c6e 100644 --- a/extensions/python/tsconfig.json +++ b/extensions/python/tsconfig.json @@ -5,7 +5,8 @@ "es2015" ], "module": "commonjs", - "outDir": "./out" + "outDir": "./out", + strict }, "include": [ "src/**/*" From 7cba0cd7ee2d28c4a3a443142b4316ecf890e163 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 14:26:08 -0800 Subject: [PATCH 05/88] Move python extension to strict --- extensions/python/tsconfig.json | 2 +- extensions/vscode-api-tests/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/python/tsconfig.json b/extensions/python/tsconfig.json index 5df3e845c6e..b16347a7524 100644 --- a/extensions/python/tsconfig.json +++ b/extensions/python/tsconfig.json @@ -6,7 +6,7 @@ ], "module": "commonjs", "outDir": "./out", - strict + "strict": true }, "include": [ "src/**/*" diff --git a/extensions/vscode-api-tests/tsconfig.json b/extensions/vscode-api-tests/tsconfig.json index 26c357e374b..610a5da7c03 100644 --- a/extensions/vscode-api-tests/tsconfig.json +++ b/extensions/vscode-api-tests/tsconfig.json @@ -7,7 +7,7 @@ "es2015" ], "sourceMap": true, - "strictNullChecks": true + "strict": true }, "include": [ "src/**/*" From ae0519c17e505f17327a8bd96e70a30569746469 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 14:30:07 -0800 Subject: [PATCH 06/88] Use const where ever possible in JS ext --- .../src/features/bowerJSONContribution.ts | 30 ++++++------ .../src/features/jsonContributions.ts | 46 +++++++++---------- .../src/features/packageJSONContribution.ts | 40 ++++++++-------- extensions/javascript/src/javascriptMain.ts | 2 +- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/extensions/javascript/src/features/bowerJSONContribution.ts b/extensions/javascript/src/features/bowerJSONContribution.ts index ffc26905082..31fee9fe089 100644 --- a/extensions/javascript/src/features/bowerJSONContribution.ts +++ b/extensions/javascript/src/features/bowerJSONContribution.ts @@ -31,7 +31,7 @@ export class BowerJSONContribution implements IJSONContribution { } public collectDefaultSuggestions(resource: string, collector: ISuggestionsCollector): Thenable { - let defaultValue = { + const defaultValue = { 'name': '${1:name}', 'description': '${2:description}', 'authors': ['${3:author}'], @@ -39,7 +39,7 @@ export class BowerJSONContribution implements IJSONContribution { 'main': '${5:pathToMain}', 'dependencies': {} }; - let proposal = new CompletionItem(localize('json.bower.default', 'Default bower.json')); + const proposal = new CompletionItem(localize('json.bower.default', 'Default bower.json')); proposal.kind = CompletionItemKind.Class; proposal.insertText = new SnippetString(JSON.stringify(defaultValue, null, '\t')); collector.add(proposal); @@ -49,27 +49,27 @@ export class BowerJSONContribution implements IJSONContribution { public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable | null { if ((location.matches(['dependencies']) || location.matches(['devDependencies']))) { if (currentWord.length > 0) { - let queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord); + const queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord); return this.xhr({ url: queryUrl }).then((success) => { if (success.status === 200) { try { - let obj = JSON.parse(success.responseText); + const obj = JSON.parse(success.responseText); if (Array.isArray(obj)) { - let results = <{ name: string; description: string; }[]>obj; + const results = <{ name: string; description: string; }[]>obj; for (let i = 0; i < results.length; i++) { - let name = results[i].name; - let description = results[i].description || ''; - let insertText = new SnippetString().appendText(JSON.stringify(name)); + const name = results[i].name; + const description = results[i].description || ''; + const insertText = new SnippetString().appendText(JSON.stringify(name)); if (addValue) { insertText.appendText(': ').appendPlaceholder('latest'); if (!isLast) { insertText.appendText(','); } } - let proposal = new CompletionItem(name); + const proposal = new CompletionItem(name); proposal.kind = CompletionItemKind.Property; proposal.insertText = insertText; proposal.filterText = JSON.stringify(name); @@ -91,7 +91,7 @@ export class BowerJSONContribution implements IJSONContribution { }); } else { this.topRanked.forEach((name) => { - let insertText = new SnippetString().appendText(JSON.stringify(name)); + const insertText = new SnippetString().appendText(JSON.stringify(name)); if (addValue) { insertText.appendText(': ').appendPlaceholder('latest'); if (!isLast) { @@ -99,7 +99,7 @@ export class BowerJSONContribution implements IJSONContribution { } } - let proposal = new CompletionItem(name); + const proposal = new CompletionItem(name); proposal.kind = CompletionItemKind.Property; proposal.insertText = insertText; proposal.filterText = JSON.stringify(name); @@ -116,7 +116,7 @@ export class BowerJSONContribution implements IJSONContribution { public collectValueSuggestions(resource: string, location: Location, collector: ISuggestionsCollector): Thenable { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) { // not implemented. Could be do done calling the bower command. Waiting for web API: https://github.com/bower/registry/issues/26 - let proposal = new CompletionItem(localize('json.bower.latest.version', 'latest')); + const proposal = new CompletionItem(localize('json.bower.latest.version', 'latest')); proposal.insertText = new SnippetString('"${1:latest}"'); proposal.filterText = '""'; proposal.kind = CompletionItemKind.Value; @@ -140,13 +140,13 @@ export class BowerJSONContribution implements IJSONContribution { } private getInfo(pack: string): Thenable { - let queryUrl = 'https://bower.herokuapp.com/packages/' + encodeURIComponent(pack); + const queryUrl = 'https://bower.herokuapp.com/packages/' + encodeURIComponent(pack); return this.xhr({ url: queryUrl }).then((success) => { try { - let obj = JSON.parse(success.responseText); + const obj = JSON.parse(success.responseText); if (obj && obj.url) { let url: string = obj.url; if (url.indexOf('git://') === 0) { @@ -168,7 +168,7 @@ export class BowerJSONContribution implements IJSONContribution { public getInfoContribution(resource: string, location: Location): Thenable | null { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) { - let pack = location.path[location.path.length - 1]; + const pack = location.path[location.path.length - 1]; if (typeof pack === 'string') { return this.getInfo(pack).then(documentation => { if (documentation) { diff --git a/extensions/javascript/src/features/jsonContributions.ts b/extensions/javascript/src/features/jsonContributions.ts index 1e31adad9d6..ffb9def3487 100644 --- a/extensions/javascript/src/features/jsonContributions.ts +++ b/extensions/javascript/src/features/jsonContributions.ts @@ -32,10 +32,10 @@ export interface IJSONContribution { } export function addJSONProviders(xhr: XHRRequest): Disposable { - let contributions = [new PackageJSONContribution(xhr), new BowerJSONContribution(xhr)]; - let subscriptions: Disposable[] = []; + const contributions = [new PackageJSONContribution(xhr), new BowerJSONContribution(xhr)]; + const subscriptions: Disposable[] = []; contributions.forEach(contribution => { - let selector = contribution.getDocumentSelector(); + const selector = contribution.getDocumentSelector(); subscriptions.push(languages.registerCompletionItemProvider(selector, new JSONCompletionItemProvider(contribution), '"', ':')); subscriptions.push(languages.registerHoverProvider(selector, new JSONHoverProvider(contribution))); }); @@ -48,19 +48,19 @@ export class JSONHoverProvider implements HoverProvider { } public provideHover(document: TextDocument, position: Position, token: CancellationToken): Thenable | null { - let fileName = basename(document.fileName); - let offset = document.offsetAt(position); - let location = getLocation(document.getText(), offset); + const fileName = basename(document.fileName); + const offset = document.offsetAt(position); + const location = getLocation(document.getText(), offset); if (!location.previousNode) { return null; } const node = location.previousNode; if (node && node.offset <= offset && offset <= node.offset + node.length) { - let promise = this.jsonContribution.getInfoContribution(fileName, location); + const promise = this.jsonContribution.getInfoContribution(fileName, location); if (promise) { return promise.then(htmlContent => { - let range = new Range(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); - let result: Hover = { + const range = new Range(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); + const result: Hover = { contents: htmlContent || [], range: range }; @@ -79,7 +79,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { public resolveCompletionItem(item: CompletionItem, token: CancellationToken): Thenable { if (this.jsonContribution.resolveSuggestion) { - let resolver = this.jsonContribution.resolveSuggestion(item); + const resolver = this.jsonContribution.resolveSuggestion(item); if (resolver) { return resolver; } @@ -89,26 +89,26 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Thenable | null { - let fileName = basename(document.fileName); + const fileName = basename(document.fileName); - let currentWord = this.getCurrentWord(document, position); + const currentWord = this.getCurrentWord(document, position); let overwriteRange: Range; - let items: CompletionItem[] = []; + const items: CompletionItem[] = []; let isIncomplete = false; - let offset = document.offsetAt(position); - let location = getLocation(document.getText(), offset); + const offset = document.offsetAt(position); + const location = getLocation(document.getText(), offset); - let node = location.previousNode; + const node = location.previousNode; if (node && node.offset <= offset && offset <= node.offset + node.length && (node.type === 'property' || node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { overwriteRange = new Range(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); } else { overwriteRange = new Range(document.positionAt(offset - currentWord.length), position); } - let proposed: { [key: string]: boolean } = {}; - let collector: ISuggestionsCollector = { + const proposed: { [key: string]: boolean } = {}; + const collector: ISuggestionsCollector = { add: (suggestion: CompletionItem) => { if (!proposed[suggestion.label]) { proposed[suggestion.label] = true; @@ -124,8 +124,8 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { let collectPromise: Thenable | null = null; if (location.isAtPropertyKey) { - let addValue = !location.previousNode || !location.previousNode.columnOffset; - let isLast = this.isLast(document, position); + const addValue = !location.previousNode || !location.previousNode.columnOffset; + const isLast = this.isLast(document, position); collectPromise = this.jsonContribution.collectPropertySuggestions(fileName, location, currentWord, addValue, isLast, collector); } else { if (location.path.length === 0) { @@ -146,8 +146,8 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { } private getCurrentWord(document: TextDocument, position: Position) { - var i = position.character - 1; - var text = document.lineAt(position.line).text; + let i = position.character - 1; + const text = document.lineAt(position.line).text; while (i >= 0 && ' \t\n\r\v":{[,'.indexOf(text.charAt(i)) === -1) { i--; } @@ -155,7 +155,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { } private isLast(document: TextDocument, position: Position): boolean { - let scanner = createScanner(document.getText(), true); + const scanner = createScanner(document.getText(), true); scanner.setPosition(document.offsetAt(position)); let nextToken = scanner.scan(); if (nextToken === SyntaxKind.StringLiteral && scanner.getTokenError() === ScanError.UnexpectedEndOfString) { diff --git a/extensions/javascript/src/features/packageJSONContribution.ts b/extensions/javascript/src/features/packageJSONContribution.ts index 3f891ee46ee..cba2dcd6673 100644 --- a/extensions/javascript/src/features/packageJSONContribution.ts +++ b/extensions/javascript/src/features/packageJSONContribution.ts @@ -13,7 +13,7 @@ import { textToMarkedString } from './markedTextUtil'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); -let LIMIT = 40; +const LIMIT = 40; export class PackageJSONContribution implements IJSONContribution { @@ -32,7 +32,7 @@ export class PackageJSONContribution implements IJSONContribution { } public collectDefaultSuggestions(fileName: string, result: ISuggestionsCollector): Thenable { - let defaultValue = { + const defaultValue = { 'name': '${1:name}', 'description': '${2:description}', 'authors': '${3:author}', @@ -40,7 +40,7 @@ export class PackageJSONContribution implements IJSONContribution { 'main': '${5:pathToMain}', 'dependencies': {} }; - let proposal = new CompletionItem(localize('json.package.default', 'Default package.json')); + const proposal = new CompletionItem(localize('json.package.default', 'Default package.json')); proposal.kind = CompletionItemKind.Module; proposal.insertText = new SnippetString(JSON.stringify(defaultValue, null, '\t')); result.add(proposal); @@ -65,21 +65,21 @@ export class PackageJSONContribution implements IJSONContribution { }).then((success) => { if (success.status === 200) { try { - let obj = JSON.parse(success.responseText); + const obj = JSON.parse(success.responseText); if (obj && Array.isArray(obj.rows)) { - let results = <{ key: string[]; }[]>obj.rows; + const results = <{ key: string[]; }[]>obj.rows; for (let i = 0; i < results.length; i++) { - let keys = results[i].key; + const keys = results[i].key; if (Array.isArray(keys) && keys.length > 0) { - let name = keys[0]; - let insertText = new SnippetString().appendText(JSON.stringify(name)); + const name = keys[0]; + const insertText = new SnippetString().appendText(JSON.stringify(name)); if (addValue) { insertText.appendText(': "').appendTabstop().appendText('"'); if (!isLast) { insertText.appendText(','); } } - let proposal = new CompletionItem(name); + const proposal = new CompletionItem(name); proposal.kind = CompletionItemKind.Property; proposal.insertText = insertText; proposal.filterText = JSON.stringify(name); @@ -104,14 +104,14 @@ export class PackageJSONContribution implements IJSONContribution { }); } else { this.mostDependedOn.forEach((name) => { - let insertText = new SnippetString().appendText(JSON.stringify(name)); + const insertText = new SnippetString().appendText(JSON.stringify(name)); if (addValue) { insertText.appendText(': "').appendTabstop().appendText('"'); if (!isLast) { insertText.appendText(','); } } - let proposal = new CompletionItem(name); + const proposal = new CompletionItem(name); proposal.kind = CompletionItemKind.Property; proposal.insertText = insertText; proposal.filterText = JSON.stringify(name); @@ -131,15 +131,15 @@ export class PackageJSONContribution implements IJSONContribution { result: ISuggestionsCollector ): Thenable | null { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) { - let currentKey = location.path[location.path.length - 1]; + const currentKey = location.path[location.path.length - 1]; if (typeof currentKey === 'string') { - let queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@'); + const queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@'); return this.xhr({ url: queryUrl }).then((success) => { try { - let obj = JSON.parse(success.responseText); - let latest = obj && obj['dist-tags'] && obj['dist-tags']['latest']; + const obj = JSON.parse(success.responseText); + const latest = obj && obj['dist-tags'] && obj['dist-tags']['latest']; if (latest) { let name = JSON.stringify(latest); let proposal = new CompletionItem(name); @@ -192,18 +192,18 @@ export class PackageJSONContribution implements IJSONContribution { private getInfo(pack: string): Thenable { - let queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@'); + const queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@'); return this.xhr({ url: queryUrl }).then((success) => { try { - let obj = JSON.parse(success.responseText); + const obj = JSON.parse(success.responseText); if (obj) { - let result: string[] = []; + const result: string[] = []; if (obj.description) { result.push(obj.description); } - let latest = obj && obj['dist-tags'] && obj['dist-tags']['latest']; + const latest = obj && obj['dist-tags'] && obj['dist-tags']['latest']; if (latest) { result.push(localize('json.npm.version.hover', 'Latest version: {0}', latest)); } @@ -220,7 +220,7 @@ export class PackageJSONContribution implements IJSONContribution { public getInfoContribution(fileName: string, location: Location): Thenable | null { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) { - let pack = location.path[location.path.length - 1]; + const pack = location.path[location.path.length - 1]; if (typeof pack === 'string') { return this.getInfo(pack).then(infos => { if (infos.length) { diff --git a/extensions/javascript/src/javascriptMain.ts b/extensions/javascript/src/javascriptMain.ts index 5c982339cd5..11b6a610195 100644 --- a/extensions/javascript/src/javascriptMain.ts +++ b/extensions/javascript/src/javascriptMain.ts @@ -22,6 +22,6 @@ export function activate(context: ExtensionContext): any { } function configureHttpRequest() { - let httpSettings = workspace.getConfiguration('http'); + const httpSettings = workspace.getConfiguration('http'); httpRequest.configure(httpSettings.get('proxy', ''), httpSettings.get('proxyStrictSSL', true)); } From e5b9b820ef7ac52f8f0088aa4a4f2f17be6884df Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 14:32:01 -0800 Subject: [PATCH 07/88] Move vscode-api-tests to strict --- extensions/vscode-api-tests/src/languages.test.ts | 8 ++++---- extensions/vscode-api-tests/src/window.test.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/vscode-api-tests/src/languages.test.ts b/extensions/vscode-api-tests/src/languages.test.ts index 321b1b772f2..01dea3ddc3f 100644 --- a/extensions/vscode-api-tests/src/languages.test.ts +++ b/extensions/vscode-api-tests/src/languages.test.ts @@ -78,12 +78,12 @@ suite('languages namespace tests', () => { }); return workspace.openTextDocument(uri).then(doc => { - return commands.executeCommand('vscode.executeCompletionItemProvider', uri, new Position(1, 0)); - }).then((result: CompletionList) => { + return commands.executeCommand('vscode.executeCompletionItemProvider', uri, new Position(1, 0)); + }).then((result: CompletionList | undefined) => { r1.dispose(); assert.ok(ran); - console.log(result.items); - assert.equal(result.items[0].label, 'foo'); + console.log(result!.items); + assert.equal(result!.items[0].label, 'foo'); }); }); }); diff --git a/extensions/vscode-api-tests/src/window.test.ts b/extensions/vscode-api-tests/src/window.test.ts index c197808fd9e..2a2f92c90e7 100644 --- a/extensions/vscode-api-tests/src/window.test.ts +++ b/extensions/vscode-api-tests/src/window.test.ts @@ -350,7 +350,7 @@ suite('window namespace tests', () => { }); test('showWorkspaceFolderPick', function () { - const p = (window).showWorkspaceFolderPick(undefined); + const p = window.showWorkspaceFolderPick(undefined); return commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem').then(() => { return p.then(workspace => { From 6bab0e0cc0f401877bdcab2d7a6fc7dc0fd3fd7c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 14:20:53 -0800 Subject: [PATCH 08/88] Move PHP extension to strict mode Compile the PHP extension with strict mode TS. Mostly adding annotations where values can be null or undefined. --- .../src/features/completionItemProvider.ts | 6 ++--- extensions/php/src/features/hoverProvider.ts | 4 +-- .../php/src/features/signatureHelpProvider.ts | 4 +-- extensions/php/src/features/utils/async.ts | 26 +++++++++---------- .../php/src/features/validationProvider.ts | 22 +++++++++------- extensions/php/tsconfig.json | 3 ++- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/extensions/php/src/features/completionItemProvider.ts b/extensions/php/src/features/completionItemProvider.ts index a430aa3f154..3d918dc4cf5 100644 --- a/extensions/php/src/features/completionItemProvider.ts +++ b/extensions/php/src/features/completionItemProvider.ts @@ -27,7 +27,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider } var added: any = {}; - var createNewProposal = function (kind: CompletionItemKind, name: string, entry: phpGlobals.IEntry): CompletionItem { + var createNewProposal = function (kind: CompletionItemKind, name: string, entry: phpGlobals.IEntry | null): CompletionItem { var proposal: CompletionItem = new CompletionItem(name); proposal.kind = kind; if (entry) { @@ -85,7 +85,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider var text = document.getText(); if (prefix[0] === '$') { var variableMatch = /\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/g; - var match: RegExpExecArray = null; + var match: RegExpExecArray | null = null; while (match = variableMatch.exec(text)) { var word = match[0]; if (!added[word]) { @@ -95,7 +95,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider } } var functionMatch = /function\s+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*\(/g; - var match: RegExpExecArray = null; + var match: RegExpExecArray | null = null; while (match = functionMatch.exec(text)) { var word = match[1]; if (!added[word]) { diff --git a/extensions/php/src/features/hoverProvider.ts b/extensions/php/src/features/hoverProvider.ts index 1e300e2fccd..2e0a137ec0a 100644 --- a/extensions/php/src/features/hoverProvider.ts +++ b/extensions/php/src/features/hoverProvider.ts @@ -11,10 +11,10 @@ import { textToMarkedString } from './utils/markedTextUtil'; export default class PHPHoverProvider implements HoverProvider { - public provideHover(document: TextDocument, position: Position, token: CancellationToken): Hover { + public provideHover(document: TextDocument, position: Position, token: CancellationToken): Hover | undefined { let enable = workspace.getConfiguration('php').get('suggest.basic', true); if (!enable) { - return null; + return; } let wordRange = document.getWordRangeAtPosition(position); diff --git a/extensions/php/src/features/signatureHelpProvider.ts b/extensions/php/src/features/signatureHelpProvider.ts index b52392cfca4..42c14b8066a 100644 --- a/extensions/php/src/features/signatureHelpProvider.ts +++ b/extensions/php/src/features/signatureHelpProvider.ts @@ -69,7 +69,7 @@ class BackwardIterator { export default class PHPSignatureHelpProvider implements SignatureHelpProvider { - public provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): Promise { + public provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): Promise | null { let enable = workspace.getConfiguration('php').get('suggest.basic', true); if (!enable) { return null; @@ -95,7 +95,7 @@ export default class PHPSignatureHelpProvider implements SignatureHelpProvider { let signatureInfo = new SignatureInformation(ident + paramsString, entry.description); var re = /\w*\s+\&?\$[\w_\.]+|void/g; - var match: RegExpExecArray = null; + var match: RegExpExecArray | null = null; while ((match = re.exec(paramsString)) !== null) { signatureInfo.parameters.push({ label: match[0], documentation: '' }); } diff --git a/extensions/php/src/features/utils/async.ts b/extensions/php/src/features/utils/async.ts index f9c86930453..5093f7c3eba 100644 --- a/extensions/php/src/features/utils/async.ts +++ b/extensions/php/src/features/utils/async.ts @@ -29,9 +29,9 @@ export interface ITask { */ export class Throttler { - private activePromise: Promise; - private queuedPromise: Promise; - private queuedPromiseFactory: ITask>; + private activePromise: Promise | null; + private queuedPromise: Promise | null; + private queuedPromiseFactory: ITask> | null; constructor() { this.activePromise = null; @@ -47,26 +47,26 @@ export class Throttler { var onComplete = () => { this.queuedPromise = null; - var result = this.queue(this.queuedPromiseFactory); + var result = this.queue(this.queuedPromiseFactory!); this.queuedPromiseFactory = null; return result; }; this.queuedPromise = new Promise((resolve, reject) => { - this.activePromise.then(onComplete, onComplete).then(resolve); + this.activePromise!.then(onComplete, onComplete).then(resolve); }); } return new Promise((resolve, reject) => { - this.queuedPromise.then(resolve, reject); + this.queuedPromise!.then(resolve, reject); }); } this.activePromise = promiseFactory(); return new Promise((resolve, reject) => { - this.activePromise.then((result: T) => { + this.activePromise!.then((result: T) => { this.activePromise = null; resolve(result); }, (err: any) => { @@ -103,10 +103,10 @@ export class Throttler { export class Delayer { public defaultDelay: number; - private timeout: NodeJS.Timer; - private completionPromise: Promise; - private onResolve: (value: T | Thenable) => void; - private task: ITask; + private timeout: NodeJS.Timer | null; + private completionPromise: Promise | null; + private onResolve: ((value: T | Thenable | undefined) => void) | null; + private task: ITask | null; constructor(defaultDelay: number) { this.defaultDelay = defaultDelay; @@ -127,7 +127,7 @@ export class Delayer { this.completionPromise = null; this.onResolve = null; - var result = this.task(); + var result = this.task!(); this.task = null; return result; @@ -136,7 +136,7 @@ export class Delayer { this.timeout = setTimeout(() => { this.timeout = null; - this.onResolve(null); + this.onResolve!(undefined); }, delay); return this.completionPromise; diff --git a/extensions/php/src/features/validationProvider.ts b/extensions/php/src/features/validationProvider.ts index 712164af0f9..0a26bbd5a9b 100644 --- a/extensions/php/src/features/validationProvider.ts +++ b/extensions/php/src/features/validationProvider.ts @@ -16,7 +16,7 @@ let localize = nls.loadMessageBundle(); export class LineDecoder { private stringDecoder: NodeStringDecoder; - private remaining: string; + private remaining: string | null; constructor(encoding: string = 'utf8') { this.stringDecoder = new StringDecoder(encoding); @@ -55,7 +55,7 @@ export class LineDecoder { return result; } - public end(): string { + public end(): string | null { return this.remaining; } } @@ -88,17 +88,17 @@ export default class PHPValidationProvider { private static FileArgs: string[] = ['-l', '-n', '-d', 'display_errors=On', '-d', 'log_errors=Off', '-f']; private validationEnabled: boolean; - private executableIsUserDefined: boolean; - private executable: string; + private executableIsUserDefined: boolean | undefined; + private executable: string | undefined; private trigger: RunTrigger; private pauseValidation: boolean; - private documentListener: vscode.Disposable; + private documentListener: vscode.Disposable | null; private diagnosticCollection: vscode.DiagnosticCollection; private delayers: { [key: string]: ThrottledDelayer }; constructor(private workspaceStore: vscode.Memento) { - this.executable = null; + this.executable = undefined; this.validationEnabled = true; this.trigger = RunTrigger.onSave; this.pauseValidation = false; @@ -145,7 +145,7 @@ export default class PHPValidationProvider { } this.trigger = RunTrigger.from(section.get('validate.run', RunTrigger.strings.onSave)); } - if (this.executableIsUserDefined !== true && this.workspaceStore.get(CheckedExecutablePath, undefined) !== void 0) { + if (this.executableIsUserDefined !== true && this.workspaceStore.get(CheckedExecutablePath, undefined) !== void 0) { vscode.commands.executeCommand('setContext', 'php.untrustValidationExecutableContext', true); } this.delayers = Object.create(null); @@ -195,7 +195,7 @@ export default class PHPValidationProvider { }; if (this.executableIsUserDefined !== void 0 && !this.executableIsUserDefined) { - let checkedExecutablePath = this.workspaceStore.get(CheckedExecutablePath, undefined); + let checkedExecutablePath = this.workspaceStore.get(CheckedExecutablePath, undefined); if (!checkedExecutablePath || checkedExecutablePath !== this.executable) { vscode.window.showInformationMessage( localize('php.useExecutablePath', 'Do you allow {0} (defined as a workspace setting) to be executed to lint PHP files?', this.executable), @@ -286,7 +286,7 @@ export default class PHPValidationProvider { } private showError(error: any, executable: string): void { - let message: string = null; + let message: string | null = null; if (error.code === 'ENOENT') { if (this.executable) { message = localize('wrongExecutable', 'Cannot validate since {0} is not a valid php executable. Use the setting \'php.validate.executablePath\' to configure the PHP executable.', executable); @@ -296,6 +296,8 @@ export default class PHPValidationProvider { } else { message = error.message ? error.message : localize('unknownReason', 'Failed to run php using path: {0}. Reason is unknown.', executable); } - vscode.window.showInformationMessage(message); + if (message) { + vscode.window.showInformationMessage(message); + } } } diff --git a/extensions/php/tsconfig.json b/extensions/php/tsconfig.json index a2b5bcdfddf..b16347a7524 100644 --- a/extensions/php/tsconfig.json +++ b/extensions/php/tsconfig.json @@ -5,7 +5,8 @@ "es2015" ], "module": "commonjs", - "outDir": "./out" + "outDir": "./out", + "strict": true }, "include": [ "src/**/*" From 494be3640192bba50f57014283970259c54fed8a Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 6 Nov 2017 15:46:41 -0800 Subject: [PATCH 09/88] Remove Python for upcoming rename (#37745) --- .../parts/welcome/page/electron-browser/welcomePage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index 7967cacab4e..e989f800640 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -122,8 +122,8 @@ interface ExtensionSuggestion { const extensionPacks: ExtensionSuggestion[] = [ { name: localize('welcomePage.javaScript', "JavaScript"), id: 'dbaeumer.vscode-eslint' }, { name: localize('welcomePage.typeScript', "TypeScript"), id: 'eg2.tslint' }, - { name: localize('welcomePage.python', "Python"), id: 'donjayamanne.python' }, - // { name: localize('welcomePage.go', "Go"), id: 'lukehoban.go' }, + // { name: localize('welcomePage.python', "Python"), id: 'donjayamanne.python' }, + { name: localize('welcomePage.go', "Go"), id: 'lukehoban.go' }, { name: localize('welcomePage.php', "PHP"), id: 'felixfbecker.php-pack' }, { name: localize('welcomePage.azure', "Azure"), title: localize('welcomePage.showAzureExtensions', "Show Azure extensions"), id: 'workbench.extensions.action.showAzureExtensions', isCommand: true }, { name: localize('welcomePage.docker', "Docker"), id: 'PeterJausovec.vscode-docker' }, From de93fea90510dc7c449dbbb83cd07e7a9509cb27 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 16:16:26 -0800 Subject: [PATCH 10/88] Fix some strict function mode tests in queryBuilder TS cannot properly infer the types in this case --- .../search/test/common/queryBuilder.test.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/search/test/common/queryBuilder.test.ts b/src/vs/workbench/parts/search/test/common/queryBuilder.test.ts index 4cf542b63a9..5f5fa458e07 100644 --- a/src/vs/workbench/parts/search/test/common/queryBuilder.test.ts +++ b/src/vs/workbench/parts/search/test/common/queryBuilder.test.ts @@ -356,12 +356,12 @@ suite('QueryBuilder', () => { includePattern); } - function testIncludesDataItem([includePattern, expectedResult]): void { - testIncludes(includePattern, expectedResult); + function testIncludesDataItem([includePattern, expectedResult]: [string, ISearchPathsResult]): void { + testIncludes(includePattern, expectedResult); } test('absolute includes', () => { - [ + const cases: [string, ISearchPathsResult][] = [ [ fixPath('/foo/bar'), { @@ -425,11 +425,12 @@ suite('QueryBuilder', () => { }] } ] - ].forEach(testIncludesDataItem); + ]; + cases.forEach(testIncludesDataItem); }); test('relative includes w/single root folder', () => { - [ + const cases: [string, ISearchPathsResult][] = [ [ './a', { @@ -468,7 +469,8 @@ suite('QueryBuilder', () => { }] } ], - ].forEach(testIncludesDataItem); + ]; + cases.forEach(testIncludesDataItem); }); test('relative includes w/two root folders', () => { @@ -476,7 +478,7 @@ suite('QueryBuilder', () => { mockWorkspace.folders = toWorkspaceFolders([{ path: ROOT_1_URI.fsPath }, { path: getUri(ROOT_2).fsPath }]); mockWorkspace.configuration = uri.file(fixPath('config')); - [ + const cases: [string, ISearchPathsResult][] = [ [ './root1', { @@ -507,7 +509,8 @@ suite('QueryBuilder', () => { }] } ] - ].forEach(testIncludesDataItem); + ]; + cases.forEach(testIncludesDataItem); }); test('relative includes w/multiple ambiguous root folders', () => { @@ -516,7 +519,7 @@ suite('QueryBuilder', () => { mockWorkspace.folders = toWorkspaceFolders([{ path: ROOT_1_URI.fsPath }, { path: getUri(ROOT_2).fsPath }, { path: getUri(ROOT_3).fsPath }]); mockWorkspace.configuration = uri.file(fixPath('/config')); - [ + const cases: [string, ISearchPathsResult][] = [ [ '', { @@ -579,7 +582,8 @@ suite('QueryBuilder', () => { }] } ] - ].forEach(testIncludesDataItem); + ]; + cases.forEach(testIncludesDataItem); }); }); }); From 7b3929a893ebd969bc9a57020cde520e46f04ae9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 16:17:29 -0800 Subject: [PATCH 11/88] Fix a few callback casts for strictFunctions With TS 2.6's strict functions mode, you cannot use a subclass in place of a parent parameter type in a callback --- .../files/test/browser/fileEditorInput.test.ts | 14 +++++++------- .../parts/search/browser/searchActions.ts | 16 ++++++++-------- .../test/textFileEditorModelManager.test.ts | 6 +++--- .../test/textModelResolverService.test.ts | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts index 4f19a7f53e8..63cf176c46d 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts @@ -86,16 +86,16 @@ suite('Files - FileEditorInput', () => { resolvedModelA.dispose(); - return inputToResolve.resolve(true).then((resolved: TextFileEditorModel) => { + return inputToResolve.resolve(true).then(resolved => { assert(resolvedModelA !== resolved); // Different instance, because input got disposed - let stat = resolved.getStat(); - return inputToResolve.resolve(true).then((resolved: TextFileEditorModel) => { - assert(stat !== resolved.getStat()); // Different stat, because resolve always goes to the server for refresh + let stat = (resolved as TextFileEditorModel).getStat(); + return inputToResolve.resolve(true).then(resolved => { + assert(stat !== (resolved as TextFileEditorModel).getStat()); // Different stat, because resolve always goes to the server for refresh - stat = resolved.getStat(); - return inputToResolve.resolve(false).then((resolved: TextFileEditorModel) => { - assert(stat === resolved.getStat()); // Same stat, because not refreshed + stat = (resolved as TextFileEditorModel).getStat(); + return inputToResolve.resolve(false).then(resolved => { + assert(stat === (resolved as TextFileEditorModel).getStat()); // Same stat, because not refreshed done(); }); diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/parts/search/browser/searchActions.ts index 55e8c831da5..d8c3d9d3cbe 100644 --- a/src/vs/workbench/parts/search/browser/searchActions.ts +++ b/src/vs/workbench/parts/search/browser/searchActions.ts @@ -369,8 +369,8 @@ export class FindInWorkspaceAction extends Action { } public run(event?: any): TPromise { - return this.viewletService.openViewlet(Constants.VIEWLET_ID, true).then((viewlet: SearchViewlet) => { - viewlet.searchInFolder(null); + return this.viewletService.openViewlet(Constants.VIEWLET_ID, true).then(viewlet => { + (viewlet as SearchViewlet).searchInFolder(null); }); } } @@ -406,9 +406,9 @@ export const findInFolderCommand = (accessor: ServicesAccessor, resource?: URI) } } - viewletService.openViewlet(Constants.VIEWLET_ID, true).then((viewlet: SearchViewlet) => { + viewletService.openViewlet(Constants.VIEWLET_ID, true).then(viewlet => { if (resource) { - viewlet.searchInFolder(resource); + (viewlet as SearchViewlet).searchInFolder(resource); } }).done(null, errors.onUnexpectedError); }; @@ -480,8 +480,8 @@ export class FocusNextSearchResultAction extends Action { } public run(): TPromise { - return this.viewletService.openViewlet(Constants.VIEWLET_ID).then((searchViewlet: SearchViewlet) => { - searchViewlet.selectNextMatch(); + return this.viewletService.openViewlet(Constants.VIEWLET_ID).then(searchViewlet => { + (searchViewlet as SearchViewlet).selectNextMatch(); }); } } @@ -495,8 +495,8 @@ export class FocusPreviousSearchResultAction extends Action { } public run(): TPromise { - return this.viewletService.openViewlet(Constants.VIEWLET_ID).then((searchViewlet: SearchViewlet) => { - searchViewlet.selectPreviousMatch(); + return this.viewletService.openViewlet(Constants.VIEWLET_ID).then(searchViewlet => { + (searchViewlet as SearchViewlet).selectPreviousMatch(); }); } } diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts b/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts index 45f1ce8d60f..99275a3e567 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts @@ -322,15 +322,15 @@ suite('Files - TextFileEditorModelManager', () => { const resource = toResource('/path/index_something.txt'); - manager.loadOrCreate(resource, { encoding: 'utf8' }).done((model: TextFileEditorModel) => { + manager.loadOrCreate(resource, { encoding: 'utf8' }).done(model => { model.textEditorModel.setValue('make dirty'); - manager.disposeModel(model); + manager.disposeModel(model as TextFileEditorModel); assert.ok(!model.isDisposed()); model.revert(true); - manager.disposeModel(model); + manager.disposeModel(model as TextFileEditorModel); assert.ok(model.isDisposed()); manager.dispose(); diff --git a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts index 9ae8a6fd4ba..968623410fd 100644 --- a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts +++ b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts @@ -71,9 +71,9 @@ suite('Workbench - TextModelResolverService', () => { let resource = URI.from({ scheme: 'test', authority: null, path: 'thePath' }); let input: ResourceEditorInput = instantiationService.createInstance(ResourceEditorInput, 'The Name', 'The Description', resource); - input.resolve().then((model: ResourceEditorModel) => { + input.resolve().then(model => { assert.ok(model); - assert.equal(model.getValue(), 'Hello Test'); + assert.equal((model as ResourceEditorModel).getValue(), 'Hello Test'); let disposed = false; once(model.onDispose)(() => { From f11f9aac5f060f7bf8338afbf68400ea9d7d8ff1 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 17:28:34 -0800 Subject: [PATCH 12/88] Enable noImplicitAny and noUnused in js extension --- .../src/features/bowerJSONContribution.ts | 11 ++++++----- .../javascript/src/features/jsonContributions.ts | 6 +++--- .../src/features/packageJSONContribution.ts | 13 +++++++------ extensions/javascript/src/javascriptMain.ts | 2 +- extensions/javascript/tsconfig.json | 4 ++++ 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/extensions/javascript/src/features/bowerJSONContribution.ts b/extensions/javascript/src/features/bowerJSONContribution.ts index 31fee9fe089..72c2d848710 100644 --- a/extensions/javascript/src/features/bowerJSONContribution.ts +++ b/extensions/javascript/src/features/bowerJSONContribution.ts @@ -30,7 +30,7 @@ export class BowerJSONContribution implements IJSONContribution { return [{ language: 'json', pattern: '**/bower.json' }, { language: 'json', pattern: '**/.bower.json' }]; } - public collectDefaultSuggestions(resource: string, collector: ISuggestionsCollector): Thenable { + public collectDefaultSuggestions(_resource: string, collector: ISuggestionsCollector): Thenable { const defaultValue = { 'name': '${1:name}', 'description': '${2:description}', @@ -46,7 +46,7 @@ export class BowerJSONContribution implements IJSONContribution { return Promise.resolve(null); } - public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable | null { + public collectPropertySuggestions(_resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable | null { if ((location.matches(['dependencies']) || location.matches(['devDependencies']))) { if (currentWord.length > 0) { const queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord); @@ -85,6 +85,7 @@ export class BowerJSONContribution implements IJSONContribution { collector.error(localize('json.bower.error.repoaccess', 'Request to the bower repository failed: {0}', success.responseText)); return 0; } + return undefined; }, (error) => { collector.error(localize('json.bower.error.repoaccess', 'Request to the bower repository failed: {0}', error.responseText)); return 0; @@ -113,7 +114,7 @@ export class BowerJSONContribution implements IJSONContribution { return null; } - public collectValueSuggestions(resource: string, location: Location, collector: ISuggestionsCollector): Thenable { + public collectValueSuggestions(_resource: string, location: Location, collector: ISuggestionsCollector): Thenable { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) { // not implemented. Could be do done calling the bower command. Waiting for web API: https://github.com/bower/registry/issues/26 const proposal = new CompletionItem(localize('json.bower.latest.version', 'latest')); @@ -161,12 +162,12 @@ export class BowerJSONContribution implements IJSONContribution { // ignore } return void 0; - }, (error) => { + }, () => { return void 0; }); } - public getInfoContribution(resource: string, location: Location): Thenable | null { + public getInfoContribution(_resource: string, location: Location): Thenable | null { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) { const pack = location.path[location.path.length - 1]; if (typeof pack === 'string') { diff --git a/extensions/javascript/src/features/jsonContributions.ts b/extensions/javascript/src/features/jsonContributions.ts index ffb9def3487..81f8a66f2c2 100644 --- a/extensions/javascript/src/features/jsonContributions.ts +++ b/extensions/javascript/src/features/jsonContributions.ts @@ -47,7 +47,7 @@ export class JSONHoverProvider implements HoverProvider { constructor(private jsonContribution: IJSONContribution) { } - public provideHover(document: TextDocument, position: Position, token: CancellationToken): Thenable | null { + public provideHover(document: TextDocument, position: Position, _token: CancellationToken): Thenable | null { const fileName = basename(document.fileName); const offset = document.offsetAt(position); const location = getLocation(document.getText(), offset); @@ -77,7 +77,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { constructor(private jsonContribution: IJSONContribution) { } - public resolveCompletionItem(item: CompletionItem, token: CancellationToken): Thenable { + public resolveCompletionItem(item: CompletionItem, _token: CancellationToken): Thenable { if (this.jsonContribution.resolveSuggestion) { const resolver = this.jsonContribution.resolveSuggestion(item); if (resolver) { @@ -87,7 +87,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { return Promise.resolve(item); } - public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Thenable | null { + public provideCompletionItems(document: TextDocument, position: Position, _token: CancellationToken): Thenable | null { const fileName = basename(document.fileName); diff --git a/extensions/javascript/src/features/packageJSONContribution.ts b/extensions/javascript/src/features/packageJSONContribution.ts index cba2dcd6673..6abf5f65394 100644 --- a/extensions/javascript/src/features/packageJSONContribution.ts +++ b/extensions/javascript/src/features/packageJSONContribution.ts @@ -31,7 +31,7 @@ export class PackageJSONContribution implements IJSONContribution { public constructor(private xhr: XHRRequest) { } - public collectDefaultSuggestions(fileName: string, result: ISuggestionsCollector): Thenable { + public collectDefaultSuggestions(_fileName: string, result: ISuggestionsCollector): Thenable { const defaultValue = { 'name': '${1:name}', 'description': '${2:description}', @@ -48,7 +48,7 @@ export class PackageJSONContribution implements IJSONContribution { } public collectPropertySuggestions( - resource: string, + _resource: string, location: Location, currentWord: string, addValue: boolean, @@ -98,6 +98,7 @@ export class PackageJSONContribution implements IJSONContribution { collector.error(localize('json.npm.error.repoaccess', 'Request to the NPM repository failed: {0}', success.responseText)); return 0; } + return undefined; }, (error) => { collector.error(localize('json.npm.error.repoaccess', 'Request to the NPM repository failed: {0}', error.responseText)); return 0; @@ -126,7 +127,7 @@ export class PackageJSONContribution implements IJSONContribution { } public collectValueSuggestions( - fileName: string, + _fileName: string, location: Location, result: ISuggestionsCollector ): Thenable | null { @@ -166,7 +167,7 @@ export class PackageJSONContribution implements IJSONContribution { // ignore } return 0; - }, (error) => { + }, () => { return 0; }); } @@ -213,12 +214,12 @@ export class PackageJSONContribution implements IJSONContribution { // ignore } return []; - }, (error) => { + }, () => { return []; }); } - public getInfoContribution(fileName: string, location: Location): Thenable | null { + public getInfoContribution(_fileName: string, location: Location): Thenable | null { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) { const pack = location.path[location.path.length - 1]; if (typeof pack === 'string') { diff --git a/extensions/javascript/src/javascriptMain.ts b/extensions/javascript/src/javascriptMain.ts index 11b6a610195..ed2552b87f0 100644 --- a/extensions/javascript/src/javascriptMain.ts +++ b/extensions/javascript/src/javascriptMain.ts @@ -16,7 +16,7 @@ export function activate(context: ExtensionContext): any { nls.config({ locale: env.language }); configureHttpRequest(); - workspace.onDidChangeConfiguration(e => configureHttpRequest()); + workspace.onDidChangeConfiguration(() => configureHttpRequest()); context.subscriptions.push(addJSONProviders(httpRequest.xhr)); } diff --git a/extensions/javascript/tsconfig.json b/extensions/javascript/tsconfig.json index c0601facf73..32325af1b23 100644 --- a/extensions/javascript/tsconfig.json +++ b/extensions/javascript/tsconfig.json @@ -6,6 +6,10 @@ "lib": [ "es2015" ], + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "strict": true }, "include": [ From 3f9457a75003de5c813701e1c1653238c74fdeaf Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 6 Nov 2017 20:46:09 -0800 Subject: [PATCH 13/88] Add setting to specify auto-ingesting settings search feedback --- src/vs/workbench/electron-browser/main.contribution.ts | 6 ++++++ .../parts/preferences/browser/preferencesRenderers.ts | 10 +++++++--- .../workbench/parts/preferences/common/preferences.ts | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 35d0909e560..91a80298351 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -253,6 +253,12 @@ if (product.quality !== 'stable') { 'description': 'Indicates the amount to boost the "literal" component of the query. Temporary.', 'default': 10 }; + + workbenchProperties['workbench.settings.experimentalFuzzySearchAutoIngestFeedback'] = { + 'type': 'boolean', + 'description': 'Indicates whether feedback from this client should be automatically ingested.', + 'default': false + }; } if (isMacintosh) { diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index 07c1b5285be..cd0373e12a0 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -16,7 +16,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { Range, IRange } from 'vs/editor/common/core/range'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IPreferencesService, ISettingsGroup, ISetting, IPreferencesEditorModel, IFilterResult, ISettingsEditorModel, IScoredResults } from 'vs/workbench/parts/preferences/common/preferences'; +import { IPreferencesService, ISettingsGroup, ISetting, IPreferencesEditorModel, IFilterResult, ISettingsEditorModel, IScoredResults, IWorkbenchSettingsConfiguration } from 'vs/workbench/parts/preferences/common/preferences'; import { SettingsEditorModel, DefaultSettingsEditorModel, WorkspaceConfigurationEditorModel } from 'vs/workbench/parts/preferences/common/preferencesModels'; import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { IContextMenuService, ContextSubMenu } from 'vs/platform/contextview/browser/contextView'; @@ -562,7 +562,8 @@ export class FeedbackWidgetRenderer extends Disposable { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @ITelemetryService private telemetryService: ITelemetryService, @IMessageService private messageService: IMessageService, - @IEnvironmentService private environmentService: IEnvironmentService + @IEnvironmentService private environmentService: IEnvironmentService, + @IConfigurationService private configurationService: IConfigurationService ) { super(); } @@ -638,6 +639,8 @@ export class FeedbackWidgetRenderer extends Disposable { const altsAdded = expectedQuery.alts && expectedQuery.alts[0] && (expectedQuery.alts[0][0] !== FeedbackWidgetRenderer.DEFAULT_ALTS[0] || expectedQuery.alts[0][1] !== FeedbackWidgetRenderer.DEFAULT_ALTS[1]); const alts = altsAdded ? expectedQuery.alts : undefined; + const workbenchSettings = this.configurationService.getConfiguration().workbench.settings; + const autoIngest = workbenchSettings.experimentalFuzzySearchAutoIngestFeedback; /* __GDPR__ "settingsSearchResultFeedback" : { @@ -659,7 +662,8 @@ export class FeedbackWidgetRenderer extends Disposable { duration: result.metadata.duration, timestamp: result.metadata.timestamp, buildNumber: this.environmentService.debugSearch, - alts + alts, + autoIngest }); } diff --git a/src/vs/workbench/parts/preferences/common/preferences.ts b/src/vs/workbench/parts/preferences/common/preferences.ts index 9e102bf5051..1490704ca4a 100644 --- a/src/vs/workbench/parts/preferences/common/preferences.ts +++ b/src/vs/workbench/parts/preferences/common/preferences.ts @@ -23,6 +23,7 @@ export interface IWorkbenchSettingsConfiguration { experimentalFuzzySearchEndpoint: string; experimentalFuzzySearchKey: string; experimentalFuzzySearchBoost: number; + experimentalFuzzySearchAutoIngestFeedback: boolean; } }; } From 1ed949e72a9ce2af9b7aa796450457b2f2f94c17 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 07:53:26 +0100 Subject: [PATCH 14/88] Explorer: loading progress shows without delay on startup (fixes #37622) --- .../services/progress/browser/progressService.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index aebb56b7a0c..9a94a0d8908 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -17,6 +17,8 @@ interface ProgressState { worked?: number; done?: boolean; whilePromise?: TPromise; + whileStart?: number; + whileDelay?: number; } export abstract class ScopedService { @@ -87,7 +89,15 @@ export class WorkbenchProgressService extends ScopedService implements IProgress // Replay Infinite Progress from Promise if (this.progressState.whilePromise) { - this.doShowWhile(); + let delay: number; + if (this.progressState.whileDelay > 0) { + const remainingDelay = this.progressState.whileDelay - (Date.now() - this.progressState.whileStart); + if (remainingDelay > 0) { + delay = remainingDelay; + } + } + + this.doShowWhile(delay); } // Replay Infinite Progress @@ -113,6 +123,8 @@ export class WorkbenchProgressService extends ScopedService implements IProgress this.progressState.worked = void 0; this.progressState.total = void 0; this.progressState.whilePromise = void 0; + this.progressState.whileStart = void 0; + this.progressState.whileDelay = void 0; } public show(infinite: boolean, delay?: number): IProgressRunner; @@ -218,6 +230,8 @@ export class WorkbenchProgressService extends ScopedService implements IProgress // Keep Promise in State this.progressState.whilePromise = promise; + this.progressState.whileDelay = delay || 0; + this.progressState.whileStart = Date.now(); let stop = () => { From 479910d9a416154151930ae1a8bc0254ece32ac7 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 7 Nov 2017 10:56:05 +0100 Subject: [PATCH 15/88] undo late extension host launch, #37751 --- .../services/extensions/electron-browser/extensionService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index afbd40e9494..e973d3b7e91 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -103,9 +103,9 @@ export class ExtensionService implements IExtensionService { toPromise(filterEvent(lifecycleService.onDidChangePhase, phase => phase === LifecyclePhase.Running)).then(() => { // delay extension host creation and extension scanning // until after the editors/panels are restored - this._startExtensionHostProcess([]); - this._scanAndHandleExtensions(); }); + this._startExtensionHostProcess([]); + this._scanAndHandleExtensions(); } public restartExtensionHost(): void { From 32a8a5c2abdcfdb52cbb9edb3583a9a58b09c5ba Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 7 Nov 2017 11:11:00 +0100 Subject: [PATCH 16/88] debug: process.session.root can be undefined fixes #37559 --- src/vs/workbench/parts/debug/electron-browser/debugService.ts | 4 ++-- src/vs/workbench/parts/debug/node/debugAdapter.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 8c2ce64e770..4072a3ae6ee 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -411,7 +411,7 @@ export class DebugService implements debug.IDebugService { this.toDisposeOnSessionEnd.get(session.getId()).push(session.onDidExitAdapter(event => { // 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905 if (strings.equalsIgnoreCase(process.configuration.type, 'extensionhost') && this.sessionStates.get(session.getId()) === debug.State.Running && - process && this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && process.configuration.noDebug) { + process && process.session.root && process.configuration.noDebug) { this.broadcastService.broadcast({ channel: EXTENSION_CLOSE_EXTHOST_BROADCAST_CHANNEL, payload: [process.session.root.uri.fsPath] @@ -902,7 +902,7 @@ export class DebugService implements debug.IDebugService { watchExpressionsCount: this.model.getWatchExpressions().length, extensionName: `${adapter.extensionDescription.publisher}.${adapter.extensionDescription.name}`, isBuiltin: adapter.extensionDescription.isBuiltin, - launchJsonExists: this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && !!this.configurationService.getConfiguration('launch', { resource: root.uri }) + launchJsonExists: root && !!this.configurationService.getConfiguration('launch', { resource: root.uri }) }); }).then(() => process, (error: any) => { if (error instanceof Error && error.message === 'Canceled') { diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index 0bfdffe4fa2..4e8cf56e0e7 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -35,7 +35,7 @@ export class Adapter { public getAdapterExecutable(root: IWorkspaceFolder, verifyAgainstFS = true): TPromise { - if (this.rawAdapter.adapterExecutableCommand) { + if (this.rawAdapter.adapterExecutableCommand && root) { return this.commandService.executeCommand(this.rawAdapter.adapterExecutableCommand, root.uri.toString()).then(ad => { return this.verifyAdapterDetails(ad, verifyAgainstFS); }); From 636be803c6c8d717effef79825cdc8567acff283 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 11:11:18 +0100 Subject: [PATCH 17/88] inline electron references (#37766) --- src/vs/platform/windows/common/windows.ts | 69 ++++++++++++++++++-- src/vs/platform/windows/common/windowsIpc.ts | 6 +- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 80a76149dee..8b1a745eb63 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -22,7 +22,7 @@ export interface INativeOpenDialogOptions { windowId?: number; forceNewWindow?: boolean; - dialogOptions?: Electron.OpenDialogOptions; + dialogOptions?: OpenDialogOptions; telemetryEventName?: string; telemetryExtraData?: ITelemetryData; @@ -33,6 +33,63 @@ export interface IEnterWorkspaceResult { backupPath: string; } +export interface CrashReporterStartOptions { + companyName?: string; + submitURL: string; + productName?: string; + uploadToServer?: boolean; + ignoreSystemCrashHandler?: boolean; + extra?: any; + crashesDirectory?: string; +} + +export interface OpenDialogOptions { + title?: string; + defaultPath?: string; + buttonLabel?: string; + filters?: FileFilter[]; + properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>; + message?: string; +} + +export interface FileFilter { + extensions: string[]; + name: string; +} + +export interface MessageBoxOptions { + type?: string; + buttons?: string[]; + defaultId?: number; + title?: string; + message: string; + detail?: string; + checkboxLabel?: string; + checkboxChecked?: boolean; + cancelId?: number; + noLink?: boolean; + normalizeAccessKeys?: boolean; +} + +export interface SaveDialogOptions { + title?: string; + defaultPath?: string; + buttonLabel?: string; + filters?: FileFilter[]; + message?: string; + nameFieldLabel?: string; + showsTagField?: boolean; +} + +export interface OpenDialogOptions { + title?: string; + defaultPath?: string; + buttonLabel?: string; + filters?: FileFilter[]; + properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>; + message?: string; +} + export interface IWindowsService { _serviceBrand: any; @@ -96,7 +153,7 @@ export interface IWindowsService { openExternal(url: string): TPromise; // TODO: this is a bit backwards - startCrashReporter(config: Electron.CrashReporterStartOptions): TPromise; + startCrashReporter(config: CrashReporterStartOptions): TPromise; } export const IWindowService = createDecorator('windowService'); @@ -136,10 +193,10 @@ export interface IWindowService { unmaximizeWindow(): TPromise; onWindowTitleDoubleClick(): TPromise; show(): TPromise; - showMessageBoxSync(options: Electron.MessageBoxOptions): number; - showMessageBox(options: Electron.MessageBoxOptions): TPromise; - showSaveDialog(options: Electron.SaveDialogOptions, callback?: (fileName: string) => void): string; - showOpenDialog(options: Electron.OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; + showMessageBoxSync(options: MessageBoxOptions): number; + showMessageBox(options: MessageBoxOptions): TPromise; + showSaveDialog(options: SaveDialogOptions, callback?: (fileName: string) => void): string; + showOpenDialog(options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; } export type MenuBarVisibility = 'default' | 'visible' | 'toggle' | 'hidden'; diff --git a/src/vs/platform/windows/common/windowsIpc.ts b/src/vs/platform/windows/common/windowsIpc.ts index 1fae89198a3..1541d7bb99c 100644 --- a/src/vs/platform/windows/common/windowsIpc.ts +++ b/src/vs/platform/windows/common/windowsIpc.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import Event, { buffer } from 'vs/base/common/event'; import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; -import { IWindowsService, INativeOpenDialogOptions, IEnterWorkspaceResult } from './windows'; +import { IWindowsService, INativeOpenDialogOptions, IEnterWorkspaceResult, CrashReporterStartOptions } from 'vs/platform/windows/common/windows'; import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { IRecentlyOpened } from 'vs/platform/history/common/history'; import { ICommandAction } from 'vs/platform/actions/common/actions'; @@ -59,7 +59,7 @@ export interface IWindowsChannel extends IChannel { call(command: 'log', arg: [string, string[]]): TPromise; call(command: 'showItemInFolder', arg: string): TPromise; call(command: 'openExternal', arg: string): TPromise; - call(command: 'startCrashReporter', arg: Electron.CrashReporterStartOptions): TPromise; + call(command: 'startCrashReporter', arg: CrashReporterStartOptions): TPromise; call(command: string, arg?: any): TPromise; } @@ -320,7 +320,7 @@ export class WindowsChannelClient implements IWindowsService { return this.channel.call('openExternal', url); } - startCrashReporter(config: Electron.CrashReporterStartOptions): TPromise { + startCrashReporter(config: CrashReporterStartOptions): TPromise { return this.channel.call('startCrashReporter', config); } From 968934c141223d252de6b5ba6257c52fc7a94bed Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 11:59:26 +0100 Subject: [PATCH 18/88] Speed up `registerTextMime` (fixes #37521) --- src/vs/base/common/mime.ts | 4 ++-- .../editor/common/services/languagesRegistry.ts | 17 ++++++++++------- .../editor/common/services/modeServiceImpl.ts | 4 ++-- .../mode/common/workbenchModeService.ts | 6 ++++-- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/vs/base/common/mime.ts b/src/vs/base/common/mime.ts index 6868a298966..ff9872c075d 100644 --- a/src/vs/base/common/mime.ts +++ b/src/vs/base/common/mime.ts @@ -37,7 +37,7 @@ let userRegisteredAssociations: ITextMimeAssociationItem[] = []; /** * Associate a text mime to the registry. */ -export function registerTextMime(association: ITextMimeAssociation): void { +export function registerTextMime(association: ITextMimeAssociation, warnOnOverwrite = false): void { // Register const associationItem = toTextMimeAssociationItem(association); @@ -49,7 +49,7 @@ export function registerTextMime(association: ITextMimeAssociation): void { } // Check for conflicts unless this is a user configured association - if (!associationItem.userConfigured) { + if (warnOnOverwrite && !associationItem.userConfigured) { registeredAssociations.forEach(a => { if (a.mime === associationItem.mime || a.userConfigured) { return; // same mime or userConfigured is ok diff --git a/src/vs/editor/common/services/languagesRegistry.ts b/src/vs/editor/common/services/languagesRegistry.ts index 0159f694c70..33a9ecd1c6f 100644 --- a/src/vs/editor/common/services/languagesRegistry.ts +++ b/src/vs/editor/common/services/languagesRegistry.ts @@ -36,13 +36,16 @@ export class LanguagesRegistry { private _nameMap: { [name: string]: LanguageIdentifier; }; private _lowercaseNameMap: { [name: string]: LanguageIdentifier; }; - constructor(useModesRegistry = true) { + private _warnOnOverwrite: boolean; + + constructor(useModesRegistry = true, warnOnOverwrite = false) { this._nextLanguageId = 1; this._languages = {}; this._mimeTypesMap = {}; this._nameMap = {}; this._lowercaseNameMap = {}; this._languageIds = []; + this._warnOnOverwrite = warnOnOverwrite; if (useModesRegistry) { this._registerLanguages(ModesRegistry.getLanguages()); @@ -100,10 +103,10 @@ export class LanguagesRegistry { this._languages[langId] = resolvedLanguage; } - LanguagesRegistry._mergeLanguage(resolvedLanguage, lang); + this._mergeLanguage(resolvedLanguage, lang); } - private static _mergeLanguage(resolvedLanguage: IResolvedLanguage, lang: ILanguageExtensionPoint): void { + private _mergeLanguage(resolvedLanguage: IResolvedLanguage, lang: ILanguageExtensionPoint): void { const langId = lang.id; let primaryMime: string = null; @@ -124,21 +127,21 @@ export class LanguagesRegistry { if (Array.isArray(lang.extensions)) { for (let extension of lang.extensions) { - mime.registerTextMime({ id: langId, mime: primaryMime, extension: extension }); + mime.registerTextMime({ id: langId, mime: primaryMime, extension: extension }, this._warnOnOverwrite); resolvedLanguage.extensions.push(extension); } } if (Array.isArray(lang.filenames)) { for (let filename of lang.filenames) { - mime.registerTextMime({ id: langId, mime: primaryMime, filename: filename }); + mime.registerTextMime({ id: langId, mime: primaryMime, filename: filename }, this._warnOnOverwrite); resolvedLanguage.filenames.push(filename); } } if (Array.isArray(lang.filenamePatterns)) { for (let filenamePattern of lang.filenamePatterns) { - mime.registerTextMime({ id: langId, mime: primaryMime, filepattern: filenamePattern }); + mime.registerTextMime({ id: langId, mime: primaryMime, filepattern: filenamePattern }, this._warnOnOverwrite); } } @@ -150,7 +153,7 @@ export class LanguagesRegistry { try { let firstLineRegex = new RegExp(firstLineRegexStr); if (!strings.regExpLeadsToEndlessLoop(firstLineRegex)) { - mime.registerTextMime({ id: langId, mime: primaryMime, firstline: firstLineRegex }); + mime.registerTextMime({ id: langId, mime: primaryMime, firstline: firstLineRegex }, this._warnOnOverwrite); } } catch (err) { // Most likely, the regex was bad diff --git a/src/vs/editor/common/services/modeServiceImpl.ts b/src/vs/editor/common/services/modeServiceImpl.ts index d75ed1aafb6..70cfd572e22 100644 --- a/src/vs/editor/common/services/modeServiceImpl.ts +++ b/src/vs/editor/common/services/modeServiceImpl.ts @@ -21,10 +21,10 @@ export class ModeServiceImpl implements IModeService { private readonly _onDidCreateMode: Emitter = new Emitter(); public readonly onDidCreateMode: Event = this._onDidCreateMode.event; - constructor() { + constructor(warnOnOverwrite = false) { this._instantiatedModes = {}; - this._registry = new LanguagesRegistry(); + this._registry = new LanguagesRegistry(true, warnOnOverwrite); } protected _onReady(): TPromise { diff --git a/src/vs/workbench/services/mode/common/workbenchModeService.ts b/src/vs/workbench/services/mode/common/workbenchModeService.ts index 62023d035bb..621e9a5f65e 100644 --- a/src/vs/workbench/services/mode/common/workbenchModeService.ts +++ b/src/vs/workbench/services/mode/common/workbenchModeService.ts @@ -16,6 +16,7 @@ import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; import { ILanguageExtensionPoint, IValidLanguageExtensionPoint } from 'vs/editor/common/services/modeService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; export const languagesExtPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint('languages', [], { description: nls.localize('vscode.extension.contributes.languages', 'Contributes language declarations.'), @@ -84,9 +85,10 @@ export class WorkbenchModeServiceImpl extends ModeServiceImpl { constructor( @IExtensionService extensionService: IExtensionService, - @IConfigurationService configurationService: IConfigurationService + @IConfigurationService configurationService: IConfigurationService, + @IEnvironmentService environmentService: IEnvironmentService ) { - super(); + super(environmentService.verbose || environmentService.isExtensionDevelopment || !environmentService.isBuilt); this._configurationService = configurationService; this._extensionService = extensionService; From 56111c9cc6b1d8035f54f25ae1f2312c835636e1 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 7 Nov 2017 11:53:59 +0100 Subject: [PATCH 19/88] update to tslint5 --- .vscode/tasks.json | 6 ++-- build/gulpfile.hygiene.js | 29 ++++++++++--------- .../lib/tslint/noUnexternalizedStringsRule.js | 14 +++++---- .../lib/tslint/noUnexternalizedStringsRule.ts | 14 +++++---- package.json | 4 +-- tslint.json | 7 +++-- 6 files changed, 40 insertions(+), 34 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 45d4995aa65..2239597b1f3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -33,11 +33,11 @@ "task": "tslint", "label": "Run tslint", "problemMatcher": [ - "$tslint4" + "$tslint5" ] }, { - "taskName": "Run tests", + "label": "Run tests", "type": "shell", "command": "./scripts/test.sh", "windows": { @@ -50,7 +50,7 @@ } }, { - "taskName": "Run Dev", + "label": "Run Dev", "type": "shell", "command": "./scripts/code.sh", "windows": { diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 27137a20781..056dc86065e 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -123,7 +123,8 @@ const tslintFilter = [ '!**/node_modules/**', '!extensions/typescript/test/colorize-fixtures/**', '!extensions/vscode-api-tests/testWorkspace/**', - '!extensions/**/*.test.ts' + '!extensions/**/*.test.ts', + '!extensions/html/server/lib/jquery.d.ts' ]; const copyrightHeader = [ @@ -133,17 +134,6 @@ const copyrightHeader = [ ' *--------------------------------------------------------------------------------------------*/' ].join('\n'); -function reportFailures(failures) { - failures.forEach(failure => { - const name = failure.name || failure.fileName; - const position = failure.startPosition; - const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; - const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; - - console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); - }); -} - gulp.task('eslint', () => { return vfs.src(all, { base: '.', follow: true, allowEmpty: true }) .pipe(filter(eslintFilter)) @@ -153,12 +143,12 @@ gulp.task('eslint', () => { }); gulp.task('tslint', () => { - const options = { summarizeFailureOutput: true }; + const options = { emitError: false }; return vfs.src(all, { base: '.', follow: true, allowEmpty: true }) .pipe(filter(tslintFilter)) .pipe(gulptslint({ rulesDirectory: 'build/lib/tslint' })) - .pipe(gulptslint.report(reportFailures, options)); + .pipe(gulptslint.report(options)); }); const hygiene = exports.hygiene = (some, options) => { @@ -219,6 +209,17 @@ const hygiene = exports.hygiene = (some, options) => { cb(err); }); }); + + function reportFailures(failures) { + failures.forEach(failure => { + const name = failure.name || failure.fileName; + const position = failure.startPosition; + const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; + const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; + + console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); + }); + } const tsl = es.through(function (file) { const configuration = tslint.Configuration.findConfiguration(null, '.'); diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js index d1d3c76b8ea..2925f0a0c63 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.js +++ b/build/lib/tslint/noUnexternalizedStringsRule.js @@ -88,10 +88,11 @@ var NoUnexternalizedStringsRuleWalker = /** @class */ (function (_super) { var info = this.findDescribingParent(node); // Ignore strings in import and export nodes. if (info && info.isImport && doubleQuoted) { - this.addFailureAtNode(node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, new Lint.Fix(NoUnexternalizedStringsRuleWalker.ImportFailureMessage, [ - this.createReplacement(node.getStart(), 1, '\''), - this.createReplacement(node.getStart() + text.length - 1, 1, '\''), - ])); + var fix = [ + Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''), + Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''), + ]; + this.addFailureAtNode(node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, fix); return; } var callInfo = info ? info.callInfo : null; @@ -101,8 +102,9 @@ var NoUnexternalizedStringsRuleWalker = /** @class */ (function (_super) { } if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { var s = node.getText(); - var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"); - var fix = new Lint.Fix('Unexternalitzed string', [replacement]); + var fix = [ + Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"), + ]; this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix)); return; } diff --git a/build/lib/tslint/noUnexternalizedStringsRule.ts b/build/lib/tslint/noUnexternalizedStringsRule.ts index 172db4d6b12..7b12df97596 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.ts +++ b/build/lib/tslint/noUnexternalizedStringsRule.ts @@ -104,13 +104,14 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { let info = this.findDescribingParent(node); // Ignore strings in import and export nodes. if (info && info.isImport && doubleQuoted) { + const fix = [ + Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''), + Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''), + ]; this.addFailureAtNode( node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, - new Lint.Fix(NoUnexternalizedStringsRuleWalker.ImportFailureMessage, [ - this.createReplacement(node.getStart(), 1, '\''), - this.createReplacement(node.getStart() + text.length - 1, 1, '\''), - ]) + fix ); return; } @@ -122,8 +123,9 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { const s = node.getText(); - const replacement = new Lint.Replacement(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`); - const fix = new Lint.Fix('Unexternalitzed string', [replacement]); + const fix = [ + Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`), + ]; this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`, fix)); return; } diff --git a/package.json b/package.json index bf4175a7465..97d41337a00 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "gulp-shell": "^0.5.2", "gulp-sourcemaps": "^1.11.0", "gulp-tsb": "2.0.4", - "gulp-tslint": "^7.0.1", + "gulp-tslint": "^8.1.2", "gulp-uglify": "^3.0.0", "gulp-util": "^3.0.6", "gulp-vinyl-zip": "^1.2.2", @@ -107,7 +107,7 @@ "rimraf": "^2.2.8", "sinon": "^1.17.2", "source-map": "^0.4.4", - "tslint": "^4.3.1", + "tslint": "^5.8.0", "typescript": "2.6.1", "typescript-formatter": "4.0.1", "uglify-es": "^3.0.18", diff --git a/tslint.json b/tslint.json index a1d03a430f6..e5f6005ed78 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,7 @@ "no-string-throw": true, "no-unused-expression": true, "no-duplicate-variable": true, - "no-unused-variable": true, + // "no-unused-variable": true, // requires type information in tslint > v4 "curly": true, "class-name": true, "semicolon": [ @@ -430,5 +430,6 @@ ], "duplicate-imports": true, "translation-remind": true - } -} + }, + "defaultSeverity": "warning" +} \ No newline at end of file From b94569fe0d40866fe49fcf541aafef2125bc22e5 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 7 Nov 2017 12:07:09 +0100 Subject: [PATCH 20/88] tslint5 adoption - fix semicolon rule --- .../extension-editing/src/extensionLinter.ts | 2 +- extensions/html/server/src/modes/cssMode.ts | 2 +- .../html/server/src/modes/embeddedSupport.ts | 2 +- .../html/server/src/modes/formatting.ts | 2 +- extensions/html/server/src/modes/htmlMode.ts | 2 +- .../html/server/src/modes/javascriptMode.ts | 6 +++--- .../src/features/bowerJSONContribution.ts | 2 +- .../src/features/packageJSONContribution.ts | 2 +- extensions/json/client/src/jsonMain.ts | 4 ++-- .../src/documentMergeConflict.ts | 2 +- extensions/typescript/src/typescriptMain.ts | 2 +- .../typescript/src/typescriptServiceClient.ts | 1 + src/vs/base/browser/keyboardEvent.ts | 2 +- src/vs/base/common/parsers.ts | 8 ++++---- src/vs/base/common/uri.ts | 2 +- src/vs/base/node/event.ts | 2 +- .../base/parts/ipc/test/node/testService.ts | 4 ++-- .../test/common/quickOpenScorer.test.ts | 2 +- .../parts/tree/test/browser/treeModel.test.ts | 2 +- src/vs/base/test/common/types.test.ts | 2 +- src/vs/code/electron-main/app.ts | 1 + src/vs/code/electron-main/window.ts | 6 +++--- .../browser/controller/pointerHandler.ts | 2 +- .../editor/common/controller/coreCommands.ts | 4 ++-- .../common/controller/cursorMoveCommands.ts | 8 ++++---- src/vs/editor/common/editorContextKeys.ts | 2 +- src/vs/editor/common/model/indentRanges.ts | 2 +- src/vs/editor/common/model/intervalTree.ts | 2 +- .../common/modes/supports/indentRules.ts | 2 +- .../services/resourceConfigurationImpl.ts | 4 ++-- .../editor/contrib/folding/browser/folding.ts | 2 +- .../contrib/folding/common/foldingModel.ts | 6 +++--- .../folding/common/hiddenRangeModel.ts | 4 ++-- .../browser/snippetController2.old.test.ts | 2 +- .../standalone/browser/simpleServices.ts | 8 ++++---- .../test/common/mocks/mockCodeEditor.ts | 2 +- .../configuration/common/configuration.ts | 2 +- .../common/configurationModels.ts | 4 ++-- .../common/configurationRegistry.ts | 2 +- .../node/configurationService.ts | 16 +++++++-------- .../test/common/instantiationServiceMock.ts | 20 +++++++++---------- src/vs/platform/theme/common/styler.ts | 2 +- src/vs/platform/update/common/updateIpc.ts | 2 +- src/vs/platform/windows/common/windowsIpc.ts | 2 +- .../workspaces/common/workspacesIpc.ts | 2 +- .../mainThreadDocumentsAndEditors.ts | 4 ++-- src/vs/workbench/api/node/extHost.protocol.ts | 2 +- .../workbench/api/node/extHostCredentials.ts | 2 +- src/vs/workbench/api/node/extHostTask.ts | 2 +- .../api/node/extHostTypeConverters.ts | 2 +- .../parts/activitybar/activitybarPart.ts | 2 +- src/vs/workbench/parts/debug/common/debug.ts | 2 +- .../debug/electron-browser/debugService.ts | 2 +- .../debug/electron-browser/terminalSupport.ts | 2 +- .../parts/debug/node/debugAdapter.ts | 2 +- .../parts/files/browser/fileCommands.ts | 10 +++++----- .../parts/html/browser/webviewFindWidget.ts | 2 +- .../browser/preferencesRenderers.ts | 2 +- .../parts/search/browser/replaceService.ts | 6 +++--- .../parts/search/browser/searchActions.ts | 4 ++-- .../tasks/common/taskDefinitionRegistry.ts | 2 +- .../electron-browser/task.contribution.ts | 6 +++--- .../electron-browser/terminalTaskSystem.ts | 4 ++-- .../parts/tasks/node/taskConfiguration.ts | 2 +- .../electron-browser/terminalFindWidget.ts | 2 +- .../electron-browser/terminalLinkHandler.ts | 2 +- .../electron-browser/terminalService.ts | 2 +- .../page/electron-browser/welcomePage.ts | 2 +- .../common/configurationExtensionPoint.ts | 2 +- .../node/configurationEditingService.ts | 4 ++-- .../node/configurationService.ts | 18 ++++++++--------- .../configuration/node/jsonEditingService.ts | 4 ++-- .../electron-browser/extensionPoints.ts | 2 +- .../services/files/test/node/watcher.test.ts | 2 +- .../services/search/node/fileSearch.ts | 2 +- .../services/telemetry/node/workspaceStats.ts | 2 +- .../electron-browser/workbenchThemeService.ts | 6 +++--- .../viewlet/browser/viewletService.ts | 4 ++-- .../api/extHostConfiguration.test.ts | 2 +- .../api/extHostDiagnostics.test.ts | 3 ++- .../api/extHostTreeViews.test.ts | 2 +- .../api/mainThreadDocumentsAndEditors.test.ts | 2 +- .../api/mainThreadEditors.test.ts | 2 +- .../quickopen.perf.integrationTest.ts | 2 +- .../textsearch.perf.integrationTest.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 2 +- .../src/areas/activitybar/activityBar.ts | 2 +- test/smoke/src/areas/preferences/settings.ts | 2 +- test/smoke/src/areas/problems/problems.ts | 2 +- test/smoke/src/spectron/application.ts | 2 +- 90 files changed, 152 insertions(+), 149 deletions(-) diff --git a/extensions/extension-editing/src/extensionLinter.ts b/extensions/extension-editing/src/extensionLinter.ts index 66e82c78191..1c3bb839786 100644 --- a/extensions/extension-editing/src/extensionLinter.ts +++ b/extensions/extension-editing/src/extensionLinter.ts @@ -227,7 +227,7 @@ export class ExtensionLinter { } this.diagnosticsCollection.set(document.uri, diagnostics); - }; + } } private locateToken(text: string, begin: number, end: number, token: MarkdownItType.Token, content: string) { diff --git a/extensions/html/server/src/modes/cssMode.ts b/extensions/html/server/src/modes/cssMode.ts index 42125569e6c..f787b9c2742 100644 --- a/extensions/html/server/src/modes/cssMode.ts +++ b/extensions/html/server/src/modes/cssMode.ts @@ -68,4 +68,4 @@ export function getCSSMode(documentRegions: LanguageModelCache(entry.isWriteAccess ? DocumentHighlightKind.Write : DocumentHighlightKind.Text) }; }); - }; + } return null; }, findDocumentSymbols(document: TextDocument): SymbolInformation[] { @@ -286,7 +286,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache this.applyEdit(type, editor, edit)); } diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index 009247e7961..3a88be3df25 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -154,7 +154,7 @@ export function activate(context: ExtensionContext): void { return true; } return false; - }; + } const openListener = workspace.onDidOpenTextDocument(didOpenTextDocument); for (let textDocument of workspace.textDocuments) { if (didOpenTextDocument(textDocument)) { diff --git a/extensions/typescript/src/typescriptServiceClient.ts b/extensions/typescript/src/typescriptServiceClient.ts index 60c1adbf66e..fb4f732e7ce 100644 --- a/extensions/typescript/src/typescriptServiceClient.ts +++ b/extensions/typescript/src/typescriptServiceClient.ts @@ -375,6 +375,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient this.isRestarting = false; }); + // tslint:disable-next-line:no-unused-expression new Reader( childProcess.stdout, (msg) => { this.dispatchMessage(msg); }, diff --git a/src/vs/base/browser/keyboardEvent.ts b/src/vs/base/browser/keyboardEvent.ts index 6f90f1b1b07..22b92dbb28f 100644 --- a/src/vs/base/browser/keyboardEvent.ts +++ b/src/vs/base/browser/keyboardEvent.ts @@ -163,7 +163,7 @@ function extractKeyCode(e: KeyboardEvent): KeyCode { return KeyCodeUtils.fromString(char); } return KEY_CODE_MAP[e.keyCode] || KeyCode.Unknown; -}; +} export interface IKeyboardEvent { readonly browserEvent: KeyboardEvent; diff --git a/src/vs/base/common/parsers.ts b/src/vs/base/common/parsers.ts index 0aa919598e2..7bb73ab3399 100644 --- a/src/vs/base/common/parsers.ts +++ b/src/vs/base/common/parsers.ts @@ -50,10 +50,10 @@ export interface IProblemReporter { } export class NullProblemReporter implements IProblemReporter { - info(message: string): void { }; - warn(message: string): void { }; - error(message: string): void { }; - fatal(message: string): void { }; + info(message: string): void { } + warn(message: string): void { } + error(message: string): void { } + fatal(message: string): void { } status: ValidationStatus = new ValidationStatus(); } diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index f6dcab7e786..d99a0e403db 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -450,7 +450,7 @@ function _asFormatted(uri: URI, skipEncoding: boolean): string { } parts.push(encoder(path.substring(lastIdx, idx)), _slash); lastIdx = idx + 1; - }; + } } if (query) { parts.push('?', encoder(query)); diff --git a/src/vs/base/node/event.ts b/src/vs/base/node/event.ts index 3cc1c275122..b522285db02 100644 --- a/src/vs/base/node/event.ts +++ b/src/vs/base/node/event.ts @@ -15,4 +15,4 @@ export function fromEventEmitter(emitter: EventEmitter, eventName: string, ma const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); return result.event; -}; +} diff --git a/src/vs/base/parts/ipc/test/node/testService.ts b/src/vs/base/parts/ipc/test/node/testService.ts index 36c2120d22f..0a970bfe735 100644 --- a/src/vs/base/parts/ipc/test/node/testService.ts +++ b/src/vs/base/parts/ipc/test/node/testService.ts @@ -61,7 +61,7 @@ export class TestService implements ITestService { } progress(batch); process.nextTick(send); - }; + } process.nextTick(send); }); } @@ -94,7 +94,7 @@ export class TestChannel implements ITestChannel { export class TestServiceClient implements ITestService { private _onMarco: Event; - get onMarco(): Event { return this._onMarco; }; + get onMarco(): Event { return this._onMarco; } constructor(private channel: ITestChannel) { this._onMarco = eventFromCall(channel, 'event:marco'); diff --git a/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts b/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts index 9710b98a982..464967ff845 100644 --- a/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts +++ b/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts @@ -210,7 +210,7 @@ suite('Quick Open Scorer', () => { }); test('scoreItem - avoid match scattering (bug #36119)', function () { - const resource = URI.file('projects/ui/cula/ats/target.mk');; + const resource = URI.file('projects/ui/cula/ats/target.mk'); const pathRes = scoreItem(resource, 'tcltarget.mk', true, ResourceAccessor, cache); assert.ok(pathRes.score); diff --git a/src/vs/base/parts/tree/test/browser/treeModel.test.ts b/src/vs/base/parts/tree/test/browser/treeModel.test.ts index 07ac8c71a4d..e7e24b16be9 100644 --- a/src/vs/base/parts/tree/test/browser/treeModel.test.ts +++ b/src/vs/base/parts/tree/test/browser/treeModel.test.ts @@ -1741,7 +1741,7 @@ suite('TreeModel - bugs', () => { }).done(() => { // teardown - while (listeners.length > 0) { listeners.pop()(); }; + while (listeners.length > 0) { listeners.pop()(); } listeners = null; model.dispose(); model = null; diff --git a/src/vs/base/test/common/types.test.ts b/src/vs/base/test/common/types.test.ts index 81c3be204fd..07d8804bdaf 100644 --- a/src/vs/base/test/common/types.test.ts +++ b/src/vs/base/test/common/types.test.ts @@ -184,7 +184,7 @@ suite('Types', () => { function isFoo(f) { } assert.throws(() => types.validateConstraints([new foo()], [isFoo])); - function isFoo2(f) { return true; }; + function isFoo2(f) { return true; } types.validateConstraints([new foo()], [isFoo2]); assert.throws(() => types.validateConstraints([1, true], [types.isNumber, types.isString])); diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 31834208d4b..1c564e54f18 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -393,6 +393,7 @@ export class CodeApplication { // Ensure Windows foreground love module try { + // tslint:disable-next-line:no-unused-expression require.__$__nodeRequire('windows-foreground-love'); } catch (e) { if (!this.environmentService.isBuilt) { diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index d06769cc905..4a11a3a662f 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -458,7 +458,7 @@ export class CodeWindow implements ICodeWindow { this._win.removeAllListeners('swipe'); } } - }; + } private registerNavigationListenerOn(command: 'swipe' | 'app-command', back: 'left' | 'browser-backward', forward: 'right' | 'browser-forward', acrossEditors: boolean) { this._win.on(command as 'swipe' /* | 'app-command' */, (e: Electron.Event, cmd: string) => { @@ -833,7 +833,7 @@ export class CodeWindow implements ICodeWindow { if (notify) { this.send('vscode:showInfoMessage', nls.localize('hiddenMenuBar', "You can still access the menu bar by pressing the **Alt** key.")); - }; + } break; case ('hidden'): @@ -847,7 +847,7 @@ export class CodeWindow implements ICodeWindow { this._win.setAutoHideMenuBar(false); }); break; - }; + } } public onWindowTitleDoubleClick(): void { diff --git a/src/vs/editor/browser/controller/pointerHandler.ts b/src/vs/editor/browser/controller/pointerHandler.ts index 35b948c6634..2c7548ff84b 100644 --- a/src/vs/editor/browser/controller/pointerHandler.ts +++ b/src/vs/editor/browser/controller/pointerHandler.ts @@ -28,7 +28,7 @@ function gestureChangeEventMerger(lastEvent: IThrottledGestureEvent, currentEven r.translationX += lastEvent.translationX; } return r; -}; +} /** * Basically IE10 and IE11 diff --git a/src/vs/editor/common/controller/coreCommands.ts b/src/vs/editor/common/controller/coreCommands.ts index 33661420850..37335e80e77 100644 --- a/src/vs/editor/common/controller/coreCommands.ts +++ b/src/vs/editor/common/controller/coreCommands.ts @@ -114,7 +114,7 @@ export namespace EditorScroll_ { value?: number; revealCursor?: boolean; select?: boolean; - }; + } export function parse(args: RawArguments): ParsedArguments { let direction: Direction; @@ -224,7 +224,7 @@ export namespace RevealLine_ { export interface RawArguments { lineNumber?: number; at?: string; - }; + } /** * Values for reveal line 'at' argument diff --git a/src/vs/editor/common/controller/cursorMoveCommands.ts b/src/vs/editor/common/controller/cursorMoveCommands.ts index a0f5c443432..c3320572991 100644 --- a/src/vs/editor/common/controller/cursorMoveCommands.ts +++ b/src/vs/editor/common/controller/cursorMoveCommands.ts @@ -670,7 +670,7 @@ export namespace CursorMove { select?: boolean; by?: string; value?: number; - }; + } export function parse(args: RawArguments): ParsedArguments { if (!args.to) { @@ -753,7 +753,7 @@ export namespace CursorMove { unit: Unit; select: boolean; value: number; - }; + } export const enum Direction { Left, @@ -772,7 +772,7 @@ export namespace CursorMove { ViewPortBottom, ViewPortIfOutside, - }; + } export const enum Unit { None, @@ -780,6 +780,6 @@ export namespace CursorMove { WrappedLine, Character, HalfLine, - }; + } } diff --git a/src/vs/editor/common/editorContextKeys.ts b/src/vs/editor/common/editorContextKeys.ts index 8843cf821d4..c17abc56f0f 100644 --- a/src/vs/editor/common/editorContextKeys.ts +++ b/src/vs/editor/common/editorContextKeys.ts @@ -42,4 +42,4 @@ export namespace EditorContextKeys { export const hasDocumentFormattingProvider = new RawContextKey('editorHasDocumentFormattingProvider', undefined); export const hasDocumentSelectionFormattingProvider = new RawContextKey('editorHasDocumentSelectionFormattingProvider', undefined); export const hasSignatureHelpProvider = new RawContextKey('editorHasSignatureHelpProvider', undefined); -}; +} diff --git a/src/vs/editor/common/model/indentRanges.ts b/src/vs/editor/common/model/indentRanges.ts index 8217f69b354..a3fdce186ba 100644 --- a/src/vs/editor/common/model/indentRanges.ts +++ b/src/vs/editor/common/model/indentRanges.ts @@ -191,7 +191,7 @@ export class RangesCollector { } -interface PreviousRegion { indent: number; line: number; marker: boolean; }; +interface PreviousRegion { indent: number; line: number; marker: boolean; } export function computeRanges(model: ITextModel, offSide: boolean, markers?: FoldingMarkers, foldingRegionsLimit = MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT): IndentRanges { const tabSize = model.getOptions().tabSize; diff --git a/src/vs/editor/common/model/intervalTree.ts b/src/vs/editor/common/model/intervalTree.ts index c07fdd33ba2..7fa9b78ce63 100644 --- a/src/vs/editor/common/model/intervalTree.ts +++ b/src/vs/editor/common/model/intervalTree.ts @@ -425,7 +425,7 @@ function adjustMarkerBeforeColumn(markerOffset: number, markerStickToPreviousCha return true; } return markerStickToPreviousCharacter; -}; +} /** * This is a lot more complicated than strictly necessary to maintain the same behaviour diff --git a/src/vs/editor/common/modes/supports/indentRules.ts b/src/vs/editor/common/modes/supports/indentRules.ts index b88860741b1..607c3ad1be3 100644 --- a/src/vs/editor/common/modes/supports/indentRules.ts +++ b/src/vs/editor/common/modes/supports/indentRules.ts @@ -12,7 +12,7 @@ export const enum IndentConsts { DECREASE_MASK = 0b00000010, INDENT_NEXTLINE_MASK = 0b00000100, UNINDENT_MASK = 0b00001000, -}; +} export class IndentRulesSupport { diff --git a/src/vs/editor/common/services/resourceConfigurationImpl.ts b/src/vs/editor/common/services/resourceConfigurationImpl.ts index 6124db46a06..00c24a097a8 100644 --- a/src/vs/editor/common/services/resourceConfigurationImpl.ts +++ b/src/vs/editor/common/services/resourceConfigurationImpl.ts @@ -28,8 +28,8 @@ export class TextResourceConfigurationService extends Disposable implements ITex this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(e))); } - getConfiguration(resource: URI, section?: string): T - getConfiguration(resource: URI, at?: IPosition, section?: string): T + getConfiguration(resource: URI, section?: string): T; + getConfiguration(resource: URI, at?: IPosition, section?: string): T; getConfiguration(resource: URI, arg2?: any, arg3?: any): T { const position: IPosition = Position.isIPosition(arg2) ? arg2 : null; const section: string = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0); diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index 05adf3343c6..d453e0e5d3b 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -565,4 +565,4 @@ for (let i = 1; i <= 9; i++) { } }) ); -}; +} diff --git a/src/vs/editor/contrib/folding/common/foldingModel.ts b/src/vs/editor/contrib/folding/common/foldingModel.ts index f0eb43ed984..fbf7c034ec1 100644 --- a/src/vs/editor/contrib/folding/common/foldingModel.ts +++ b/src/vs/editor/contrib/folding/common/foldingModel.ts @@ -32,8 +32,8 @@ export class FoldingModel { private _updateEventEmitter = new Emitter(); - public get regions(): FoldingRegion[] { return this._regions; }; - public get onDidChange(): Event { return this._updateEventEmitter.event; }; + public get regions(): FoldingRegion[] { return this._regions; } + public get onDidChange(): Event { return this._updateEventEmitter.event; } public get textModel() { return this._textModel; } constructor(textModel: IModel, decorationProvider: IDecorationProvider) { @@ -198,7 +198,7 @@ export class FoldingModel { let index = this._ranges.findRange(lineNumber); if (index >= 0) { return this._regions[index]; - }; + } } return null; } diff --git a/src/vs/editor/contrib/folding/common/hiddenRangeModel.ts b/src/vs/editor/contrib/folding/common/hiddenRangeModel.ts index aa008c4a74d..0f8b93af245 100644 --- a/src/vs/editor/contrib/folding/common/hiddenRangeModel.ts +++ b/src/vs/editor/contrib/folding/common/hiddenRangeModel.ts @@ -16,7 +16,7 @@ export class HiddenRangeModel { private _foldingModelListener: IDisposable; private _updateEventEmitter = new Emitter(); - public get onDidChange(): Event { return this._updateEventEmitter.event; }; + public get onDidChange(): Event { return this._updateEventEmitter.event; } public get hiddenRanges() { return this._hiddenRanges; } public constructor(model: FoldingModel) { @@ -50,7 +50,7 @@ export class HiddenRangeModel { updateHiddenAreas = true; newHiddenAreas.push(new Range(range.startLineNumber + 1, 1, range.endLineNumber, 1)); } - }; + } if (updateHiddenAreas || i < this._hiddenRanges.length) { this.applyHiddenRanges(newHiddenAreas); } diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts index fc12236bd33..cffb2fd232f 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts @@ -40,7 +40,7 @@ suite('SnippetController', () => { '\t', '}' ]; - }; + } withMockCodeEditor(lines, {}, (editor, cursor) => { editor.getModel().updateOptions({ diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 7b0a82667a1..a6c1766d569 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -458,10 +458,10 @@ export class SimpleConfigurationService implements IConfigurationService { return this._configuration; } - getConfiguration(): T - getConfiguration(section: string): T - getConfiguration(overrides: IConfigurationOverrides): T - getConfiguration(section: string, overrides: IConfigurationOverrides): T + getConfiguration(): T; + getConfiguration(section: string): T; + getConfiguration(overrides: IConfigurationOverrides): T; + getConfiguration(section: string, overrides: IConfigurationOverrides): T; getConfiguration(arg1?: any, arg2?: any): any { const section = typeof arg1 === 'string' ? arg1 : void 0; const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; diff --git a/src/vs/editor/test/common/mocks/mockCodeEditor.ts b/src/vs/editor/test/common/mocks/mockCodeEditor.ts index 33621c3d209..599112cbb1c 100644 --- a/src/vs/editor/test/common/mocks/mockCodeEditor.ts +++ b/src/vs/editor/test/common/mocks/mockCodeEditor.ts @@ -29,7 +29,7 @@ export class MockCodeEditor extends CommonCodeEditor { public focus(): void { } public isFocused(): boolean { return this._isFocused; } - public hasWidgetFocus(): boolean { return true; }; + public hasWidgetFocus(): boolean { return true; } protected _enableEmptySelectionClipboard(): boolean { return false; } protected _scheduleAtNextAnimationFrame(callback: () => void): IDisposable { throw new Error('Notimplemented'); } diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 0fb11cd76f5..6ebb51245d6 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -153,7 +153,7 @@ export function addToValueTree(settingsTreeRoot: any, key: string, value: any, c return; } curr = obj; - }; + } if (typeof curr === 'object') { curr[last] = value; // workaround https://github.com/Microsoft/vscode/issues/13606 diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index 4385e72b323..1b58dec25db 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -529,8 +529,8 @@ export class ConfigurationChangeEvent extends AbstractConfigurationChangeEvent i return this._changedConfigurationByResource; } - change(event: ConfigurationChangeEvent): ConfigurationChangeEvent - change(keys: string[], resource?: URI): ConfigurationChangeEvent + change(event: ConfigurationChangeEvent): ConfigurationChangeEvent; + change(keys: string[], resource?: URI): ConfigurationChangeEvent; change(arg1: any, arg2?: any): ConfigurationChangeEvent { if (arg1 instanceof ConfigurationChangeEvent) { this._changedConfiguration = this._changedConfiguration.merge(arg1._changedConfiguration); diff --git a/src/vs/platform/configuration/common/configurationRegistry.ts b/src/vs/platform/configuration/common/configurationRegistry.ts index 7861b3428dd..f0eb0575667 100644 --- a/src/vs/platform/configuration/common/configurationRegistry.ts +++ b/src/vs/platform/configuration/common/configurationRegistry.ts @@ -232,7 +232,7 @@ class ConfigurationRegistry implements IConfigurationRegistry { if (subNodes) { subNodes.forEach(register); } - }; + } register(configuration); } diff --git a/src/vs/platform/configuration/node/configurationService.ts b/src/vs/platform/configuration/node/configurationService.ts index 43ad33bce80..baa6c14f8d0 100644 --- a/src/vs/platform/configuration/node/configurationService.ts +++ b/src/vs/platform/configuration/node/configurationService.ts @@ -56,10 +56,10 @@ export class ConfigurationService extends Disposable implements IConfigurationSe return this.configuration.toData(); } - getConfiguration(): T - getConfiguration(section: string): T - getConfiguration(overrides: IConfigurationOverrides): T - getConfiguration(section: string, overrides: IConfigurationOverrides): T + getConfiguration(): T; + getConfiguration(section: string): T; + getConfiguration(overrides: IConfigurationOverrides): T; + getConfiguration(section: string, overrides: IConfigurationOverrides): T; getConfiguration(arg1?: any, arg2?: any): any { const section = typeof arg1 === 'string' ? arg1 : void 0; const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; @@ -70,10 +70,10 @@ export class ConfigurationService extends Disposable implements IConfigurationSe return this.configuration.getValue(key, overrides, null); } - updateValue(key: string, value: any): TPromise - updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise - updateValue(key: string, value: any, target: ConfigurationTarget): TPromise - updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise + updateValue(key: string, value: any): TPromise; + updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise; + updateValue(key: string, value: any, target: ConfigurationTarget): TPromise; + updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise; updateValue(key: string, value: any, arg3?: any, arg4?: any): TPromise { return TPromise.wrapError(new Error('not supported')); } diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index fc7287a3167..440d84448e1 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -39,11 +39,11 @@ export class TestInstantiationService extends InstantiationService { return this._create(service, { mock: true }); } - public stub(service?: ServiceIdentifier, ctor?: any): T - public stub(service?: ServiceIdentifier, obj?: any): T - public stub(service?: ServiceIdentifier, ctor?: any, property?: string, value?: any): sinon.SinonStub - public stub(service?: ServiceIdentifier, obj?: any, property?: string, value?: any): sinon.SinonStub - public stub(service?: ServiceIdentifier, property?: string, value?: any): sinon.SinonStub + public stub(service?: ServiceIdentifier, ctor?: any): T; + public stub(service?: ServiceIdentifier, obj?: any): T; + public stub(service?: ServiceIdentifier, ctor?: any, property?: string, value?: any): sinon.SinonStub; + public stub(service?: ServiceIdentifier, obj?: any, property?: string, value?: any): sinon.SinonStub; + public stub(service?: ServiceIdentifier, property?: string, value?: any): sinon.SinonStub; public stub(serviceIdentifier?: ServiceIdentifier, arg2?: any, arg3?: string, arg4?: any): sinon.SinonStub { let service = typeof arg2 !== 'string' ? arg2 : void 0; let serviceMock: IServiceMock = { id: serviceIdentifier, service: service }; @@ -70,9 +70,9 @@ export class TestInstantiationService extends InstantiationService { return stubObject; } - public stubPromise(service?: ServiceIdentifier, fnProperty?: string, value?: any): T | sinon.SinonStub - public stubPromise(service?: ServiceIdentifier, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub - public stubPromise(service?: ServiceIdentifier, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub + public stubPromise(service?: ServiceIdentifier, fnProperty?: string, value?: any): T | sinon.SinonStub; + public stubPromise(service?: ServiceIdentifier, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub; + public stubPromise(service?: ServiceIdentifier, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub; public stubPromise(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub { arg3 = typeof arg2 === 'string' ? TPromise.as(arg3) : arg3; arg4 = typeof arg2 !== 'string' && typeof arg3 === 'string' ? TPromise.as(arg4) : arg4; @@ -85,8 +85,8 @@ export class TestInstantiationService extends InstantiationService { return spy; } - private _create(serviceMock: IServiceMock, options: SinonOptions, reset?: boolean): any - private _create(ctor: any, options: SinonOptions): any + private _create(serviceMock: IServiceMock, options: SinonOptions, reset?: boolean): any; + private _create(ctor: any, options: SinonOptions): any; private _create(arg1: any, options: SinonOptions, reset: boolean = false): any { if (this.isServiceMock(arg1)) { let service = this._getOrCreateService(arg1, options, reset); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index 03ae2a5dc63..0e7ca7a5177 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -133,7 +133,7 @@ export interface IQuickOpenStyleOverrides extends IListStyleOverrides, IInputBox widgetShadow?: ColorIdentifier; pickerGroupForeground?: ColorIdentifier; pickerGroupBorder?: ColorIdentifier; -}; +} export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeService, style?: IQuickOpenStyleOverrides): IDisposable { return attachStyler(themeService, { diff --git a/src/vs/platform/update/common/updateIpc.ts b/src/vs/platform/update/common/updateIpc.ts index 0dd76ca51f6..bd42c38e018 100644 --- a/src/vs/platform/update/common/updateIpc.ts +++ b/src/vs/platform/update/common/updateIpc.ts @@ -63,7 +63,7 @@ export class UpdateChannelClient implements IUpdateService { get onStateChange(): Event { return this._onStateChange.event; } private _state: State = State.Uninitialized; - get state(): State { return this._state; }; + get state(): State { return this._state; } constructor(private channel: IUpdateChannel) { // always set this._state as the state changes diff --git a/src/vs/platform/windows/common/windowsIpc.ts b/src/vs/platform/windows/common/windowsIpc.ts index 1541d7bb99c..2000965fadf 100644 --- a/src/vs/platform/windows/common/windowsIpc.ts +++ b/src/vs/platform/windows/common/windowsIpc.ts @@ -101,7 +101,7 @@ export class WindowsChannel implements IWindowsChannel { } return this.service.createAndEnterWorkspace(arg[0], folders, arg[2]); - }; + } case 'saveAndEnterWorkspace': return this.service.saveAndEnterWorkspace(arg[0], arg[1]); case 'toggleFullScreen': return this.service.toggleFullScreen(arg); case 'setRepresentedFilename': return this.service.setRepresentedFilename(arg[0], arg[1]); diff --git a/src/vs/platform/workspaces/common/workspacesIpc.ts b/src/vs/platform/workspaces/common/workspacesIpc.ts index 859de28bbd7..981405a1190 100644 --- a/src/vs/platform/workspaces/common/workspacesIpc.ts +++ b/src/vs/platform/workspaces/common/workspacesIpc.ts @@ -34,7 +34,7 @@ export class WorkspacesChannel implements IWorkspacesChannel { } return this.service.createWorkspace(folders); - }; + } } return void 0; diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts index 56d4e237cd7..be7ea0e06c6 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts @@ -64,7 +64,7 @@ namespace delta { } }); return { removed, added }; - }; + } export function ofMaps(before: Map, after: Map): { removed: V[], added: V[] } { const removed: V[] = []; @@ -80,7 +80,7 @@ namespace delta { } }); return { removed, added }; - }; + } } class EditorSnapshot { diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index ea75a41995c..be6a4e437c7 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -574,7 +574,7 @@ export namespace IdObject { } export type IWorkspaceSymbol = IdObject & modes.SymbolInformation; -export interface IWorkspaceSymbols extends IdObject { symbols: IWorkspaceSymbol[]; }; +export interface IWorkspaceSymbols extends IdObject { symbols: IWorkspaceSymbol[]; } export interface ExtHostLanguageFeaturesShape { $provideDocumentSymbols(handle: number, resource: URI): TPromise; diff --git a/src/vs/workbench/api/node/extHostCredentials.ts b/src/vs/workbench/api/node/extHostCredentials.ts index de7a8ef0181..26f31d13803 100644 --- a/src/vs/workbench/api/node/extHostCredentials.ts +++ b/src/vs/workbench/api/node/extHostCredentials.ts @@ -13,7 +13,7 @@ export class ExtHostCredentials implements ExtHostCredentialsShape { constructor(mainContext: IMainContext) { this._proxy = mainContext.get(MainContext.MainThreadCredentials); - }; + } readSecret(service: string, account: string): Thenable { return this._proxy.$readSecret(service, account); diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 60e89ff1ea6..993a4011fed 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -431,7 +431,7 @@ export class ExtHostTask implements ExtHostTaskShape { this._extHostWorkspace = extHostWorkspace; this._handleCounter = 0; this._handlers = new Map(); - }; + } public registerTaskProvider(extension: IExtensionDescription, provider: vscode.TaskProvider): vscode.Disposable { if (!provider) { diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index 295c065c43c..787ea4d739d 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -410,7 +410,7 @@ export namespace Suggest { return result; } -}; +} export namespace ParameterInformation { export function from(info: types.ParameterInformation): modes.ParameterInformation { diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 0046b57dc47..32771c179fd 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -181,7 +181,7 @@ export class ActivitybarPart extends Part { } public getPinned(): string[] { - return this.viewletService.getViewlets().map(v => v.id).filter(id => this.compositeBar.isPinned(id));; + return this.viewletService.getViewlets().map(v => v.id).filter(id => this.compositeBar.isPinned(id)); } /** diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 7683e3d99e3..5793bfb489f 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -304,7 +304,7 @@ export interface IModel extends ITreeElement { onDidChangeCallStack: Event; onDidChangeWatchExpressions: Event; onDidChangeReplElements: Event; -}; +} // Debug enums diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 4072a3ae6ee..dd792db112a 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -63,7 +63,7 @@ const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions'; interface StartSessionResult { status: 'ok' | 'initialConfiguration' | 'saveConfiguration'; content?: string; -}; +} export class DebugService implements debug.IDebugService { public _serviceBrand: any; diff --git a/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts b/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts index 3456d7b4f41..df6f2affc77 100644 --- a/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts +++ b/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts @@ -11,7 +11,7 @@ import { ITerminalService, ITerminalInstance, ITerminalConfiguration } from 'vs/ import { ITerminalService as IExternalTerminalService } from 'vs/workbench/parts/execution/common/execution'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -const enum ShellType { cmd, powershell, bash }; +const enum ShellType { cmd, powershell, bash } export class TerminalSupport { diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index 4e8cf56e0e7..ff2a326182b 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -165,7 +165,7 @@ export class Adapter { } return TPromise.as(content); - }; + } public getSchemaAttributes(): IJSONSchema[] { if (!this.rawAdapter.configurationAttributes) { diff --git a/src/vs/workbench/parts/files/browser/fileCommands.ts b/src/vs/workbench/parts/files/browser/fileCommands.ts index 35926676f8a..8a0a4629dc2 100644 --- a/src/vs/workbench/parts/files/browser/fileCommands.ts +++ b/src/vs/workbench/parts/files/browser/fileCommands.ts @@ -140,7 +140,7 @@ function withVisibleExplorer(accessor: ServicesAccessor): TPromise; -}; +} export function withFocusedFilesExplorerViewItem(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree, item: FileStat }> { return withFocusedFilesExplorer(accessor).then(res => { @@ -155,7 +155,7 @@ export function withFocusedFilesExplorerViewItem(accessor: ServicesAccessor): TP return { explorer, tree, item: tree.getFocus() }; }); -}; +} export function withFocusedFilesExplorer(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree }> { return withVisibleExplorer(accessor).then(explorer => { @@ -172,7 +172,7 @@ export function withFocusedFilesExplorer(accessor: ServicesAccessor): TPromise<{ return { explorer, tree }; }); -}; +} function withFocusedOpenEditorsViewItem(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree, item: OpenEditor }> { return withVisibleExplorer(accessor).then(explorer => { @@ -190,7 +190,7 @@ function withFocusedOpenEditorsViewItem(accessor: ServicesAccessor): TPromise<{ return { explorer, tree, item: focus }; }); -}; +} function withFocusedExplorerItem(accessor: ServicesAccessor): TPromise { return withFocusedFilesExplorerViewItem(accessor).then(res => { @@ -206,7 +206,7 @@ function withFocusedExplorerItem(accessor: ServicesAccessor): TPromise { runActionOnFocusedFilesExplorerViewItem(accessor, 'renameFile'); diff --git a/src/vs/workbench/parts/html/browser/webviewFindWidget.ts b/src/vs/workbench/parts/html/browser/webviewFindWidget.ts index fe9ecaa3fef..3f35b6d15b6 100644 --- a/src/vs/workbench/parts/html/browser/webviewFindWidget.ts +++ b/src/vs/workbench/parts/html/browser/webviewFindWidget.ts @@ -25,7 +25,7 @@ export class WebviewFindWidget extends SimpleFindWidget { if (this.webview !== null && val) { this.webview.find(val, { findNext: true, forward: !previous }); } - }; + } public hide() { super.hide(); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index cd0373e12a0..70ad86aba2c 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -432,7 +432,7 @@ class DefaultSettingsHeaderRenderer extends Disposable { export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider { private _onHiddenAreasChanged: Emitter = new Emitter(); - get onHiddenAreasChanged(): Event { return this._onHiddenAreasChanged.event; }; + get onHiddenAreasChanged(): Event { return this._onHiddenAreasChanged.event; } private settingsGroups: ISettingsGroup[]; private hiddenGroups: ISettingsGroup[] = []; diff --git a/src/vs/workbench/parts/search/browser/replaceService.ts b/src/vs/workbench/parts/search/browser/replaceService.ts index 2a302d947ea..226a49595c7 100644 --- a/src/vs/workbench/parts/search/browser/replaceService.ts +++ b/src/vs/workbench/parts/search/browser/replaceService.ts @@ -105,9 +105,9 @@ export class ReplaceService implements IReplaceService { ) { } - public replace(match: Match): TPromise - public replace(files: FileMatch[], progress?: IProgressRunner): TPromise - public replace(match: FileMatchOrMatch, progress?: IProgressRunner, resource?: URI): TPromise + public replace(match: Match): TPromise; + public replace(files: FileMatch[], progress?: IProgressRunner): TPromise; + public replace(match: FileMatchOrMatch, progress?: IProgressRunner, resource?: URI): TPromise; public replace(arg: any, progress: IProgressRunner = null, resource: URI = null): TPromise { let bulkEdit: BulkEdit = createBulkEdit(this.textModelResolverService, null, this.fileService); diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/parts/search/browser/searchActions.ts index d8c3d9d3cbe..65b57f6a739 100644 --- a/src/vs/workbench/parts/search/browser/searchActions.ts +++ b/src/vs/workbench/parts/search/browser/searchActions.ts @@ -518,10 +518,10 @@ export abstract class AbstractSearchAndReplaceAction extends Action { let navigator: INavigator = this.getNavigatorAt(element, viewer); if (element instanceof FolderMatch) { // If file match is removed then next element is the next file match - while (!!navigator.next() && !(navigator.current() instanceof FolderMatch)) { }; + while (!!navigator.next() && !(navigator.current() instanceof FolderMatch)) { } } else if (element instanceof FileMatch) { // If file match is removed then next element is the next file match - while (!!navigator.next() && !(navigator.current() instanceof FileMatch)) { }; + while (!!navigator.next() && !(navigator.current() instanceof FileMatch)) { } } else { navigator.next(); } diff --git a/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts b/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts index ce52f2c6536..77406c82d73 100644 --- a/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts +++ b/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts @@ -101,7 +101,7 @@ class TaskDefinitionRegistryImpl implements ITaskDefinitionRegistry { this.taskTypes[type.taskType] = type; } } - }; + } } catch (error) { } resolve(undefined); diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 7d1628523d9..165317fb9b5 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -806,14 +806,14 @@ class TaskService extends EventEmitter implements ITaskService { if (Task.matches(task, alias)) { return task; } - }; + } return undefined; }); } public tasks(): TPromise { return this.getGroupedTasks().then(result => result.all()); - }; + } public createSorter(): TaskSorter { return new TaskSorter(this.contextService.getWorkspace() ? this.contextService.getWorkspace().folders : []); @@ -1124,7 +1124,7 @@ class TaskService extends EventEmitter implements ITaskService { } promise = this.writeConfiguration(workspaceFolder, 'tasks.tasks', fileConfig.tasks); } - }; + } if (!promise) { return TPromise.as(undefined); } diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 84731255e73..88de5627bf8 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -152,7 +152,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { let activeTerminal = this.activeTasks[Task.getMapKey(task)]; if (!activeTerminal) { return TPromise.as({ success: false, task: undefined }); - }; + } return new TPromise((resolve, reject) => { let terminal = activeTerminal.terminal; const onExit = terminal.onExit(() => { @@ -397,7 +397,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { let waitOnExit: boolean | string = false; if (task.command.presentation.reveal !== RevealKind.Never || !task.isBackground) { waitOnExit = nls.localize('reuseTerminal', 'Terminal will be reused by tasks, press any key to close it.'); - }; + } let shellLaunchConfig: IShellLaunchConfig = undefined; let isShellCommand = task.command.runtime === RuntimeType.Shell; if (isShellCommand) { diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts index a98744c2025..1324eb06c92 100644 --- a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts +++ b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts @@ -1649,7 +1649,7 @@ export interface IProblemReporter extends IProblemReporterBase { } class NullProblemReporter extends NullProblemReporterBase implements IProblemReporter { - clearOutput(): void { }; + clearOutput(): void { } } class UUIDMap { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts index 7ffa860ab6a..43202651a4d 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts @@ -30,7 +30,7 @@ export class TerminalFindWidget extends SimpleFindWidget { instance.findNext(val); } } - }; + } public hide() { super.hide(); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index 8650646c7ad..cc13cbf8554 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -298,4 +298,4 @@ export class TerminalLinkHandler { export interface LineColumnInfo { lineNumber?: string; columnNumber?: string; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index 66d5340d584..e68cc0b5173 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -27,7 +27,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; export class TerminalService extends AbstractTerminalService implements ITerminalService { private _configHelper: TerminalConfigHelper; - public get configHelper(): ITerminalConfigHelper { return this._configHelper; }; + public get configHelper(): ITerminalConfigHelper { return this._configHelper; } constructor( @IContextKeyService _contextKeyService: IContextKeyService, diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index e989f800640..86da1d7bd3b 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -358,7 +358,7 @@ class WelcomePage { this.updateInstalledExtensions(container, installedExtensions); break; } - }; + } })); } diff --git a/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts b/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts index 2742eddbc95..5525cc06c01 100644 --- a/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts @@ -78,7 +78,7 @@ configurationExtPoint.setHandler(extensions => { configuration.id = id; configurations.push(configuration); - }; + } for (let extension of extensions) { const value = extension.value; diff --git a/src/vs/workbench/services/configuration/node/configurationEditingService.ts b/src/vs/workbench/services/configuration/node/configurationEditingService.ts index 7bcb81beb7a..24dce179514 100644 --- a/src/vs/workbench/services/configuration/node/configurationEditingService.ts +++ b/src/vs/workbench/services/configuration/node/configurationEditingService.ts @@ -308,7 +308,7 @@ export class ConfigurationEditingService { return nls.localize('errorInvalidConfigurationFolder', "Unable to write into folder settings. Please open **Folder Settings** file under **{0}** folder to correct errors/warnings in it and try again.", workspaceFolderName); } return ''; - }; + } case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: { if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) { return nls.localize('errorTasksConfigurationFileDirty', "Unable to write into tasks file because the file is dirty. Please save the **Tasks Configuration** file and try again."); @@ -326,7 +326,7 @@ export class ConfigurationEditingService { return nls.localize('errorConfigurationFileDirtyFolder', "Unable to write into folder settings because the file is dirty. Please save the **Folder Settings** file under **{0}** folder and try again.", workspaceFolderName); } return ''; - }; + } } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index b105f745aab..eb798445520 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -222,10 +222,10 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat return this._configuration.toData(); } - getConfiguration(): T - getConfiguration(section: string): T - getConfiguration(overrides: IConfigurationOverrides): T - getConfiguration(section: string, overrides: IConfigurationOverrides): T + getConfiguration(): T; + getConfiguration(section: string): T; + getConfiguration(overrides: IConfigurationOverrides): T; + getConfiguration(section: string, overrides: IConfigurationOverrides): T; getConfiguration(arg1?: any, arg2?: any): any { const section = typeof arg1 === 'string' ? arg1 : void 0; const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : void 0; @@ -236,11 +236,11 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat return this._configuration.getValue(key, overrides); } - updateValue(key: string, value: any): TPromise - updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise - updateValue(key: string, value: any, target: ConfigurationTarget): TPromise - updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise - updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): TPromise + updateValue(key: string, value: any): TPromise; + updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise; + updateValue(key: string, value: any, target: ConfigurationTarget): TPromise; + updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise; + updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): TPromise; updateValue(key: string, value: any, arg3?: any, arg4?: any, donotNotifyError?: any): TPromise { assert.ok(this.configurationEditingService, 'Workbench is not initialized yet'); const overrides = isConfigurationOverrides(arg3) ? arg3 : void 0; diff --git a/src/vs/workbench/services/configuration/node/jsonEditingService.ts b/src/vs/workbench/services/configuration/node/jsonEditingService.ts index edd33ee7881..c2786248c14 100644 --- a/src/vs/workbench/services/configuration/node/jsonEditingService.ts +++ b/src/vs/workbench/services/configuration/node/jsonEditingService.ts @@ -126,10 +126,10 @@ export class JSONEditingService implements IJSONEditingService { // User issues case JSONEditingErrorCode.ERROR_INVALID_FILE: { return nls.localize('errorInvalidFile', "Unable to write into the file. Please open the file to correct errors/warnings in the file and try again."); - }; + } case JSONEditingErrorCode.ERROR_FILE_DIRTY: { return nls.localize('errorFileDirty', "Unable to write into the file because the file is dirty. Please save the file and try again."); - }; + } } } } \ No newline at end of file diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts b/src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts index 7e08926c197..4204b5715a1 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts @@ -201,7 +201,7 @@ class ExtensionManifestNLSReplacer extends ExtensionManifestHandler { if (literal.hasOwnProperty(key)) { processEntry(literal, key); } - }; + } } } diff --git a/src/vs/workbench/services/files/test/node/watcher.test.ts b/src/vs/workbench/services/files/test/node/watcher.test.ts index a8c6b9ee80b..705595868cf 100644 --- a/src/vs/workbench/services/files/test/node/watcher.test.ts +++ b/src/vs/workbench/services/files/test/node/watcher.test.ts @@ -44,7 +44,7 @@ enum Path { UNIX, WINDOWS, UNC -}; +} suite('Watcher', () => { diff --git a/src/vs/workbench/services/search/node/fileSearch.ts b/src/vs/workbench/services/search/node/fileSearch.ts index 02e7c5e570c..372fab93bdf 100644 --- a/src/vs/workbench/services/search/node/fileSearch.ts +++ b/src/vs/workbench/services/search/node/fileSearch.ts @@ -493,7 +493,7 @@ export class FileWalker { if (self.isLimitHit) { break; } - }; + } } matchDirectory(rootEntries); } diff --git a/src/vs/workbench/services/telemetry/node/workspaceStats.ts b/src/vs/workbench/services/telemetry/node/workspaceStats.ts index e81862ca195..8c122d88bdb 100644 --- a/src/vs/workbench/services/telemetry/node/workspaceStats.ts +++ b/src/vs/workbench/services/telemetry/node/workspaceStats.ts @@ -412,5 +412,5 @@ export class WorkspaceStats { this.reportRemotes(uris); this.reportAzure(uris); } - }; + } } diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 572299fd514..5dd51a71206 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -178,7 +178,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { }, err => { if (err && err.code === 'ENOENT') { return TPromise.as(null); // ignore, user config file doesn't exist yet - }; + } return TPromise.wrapError(err); }); } @@ -346,7 +346,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.storageService.store(PERSISTED_THEME_STORAGE_KEY, newTheme.toStorageData()); return this.writeColorThemeConfiguration(settingsTarget); - }; + } private writeColorThemeConfiguration(settingsTarget: ConfigurationTarget): TPromise { if (!types.isUndefinedOrNull(settingsTarget)) { @@ -588,7 +588,7 @@ function tokenGroupSettings(description: string) { colorThemeSchema.tokenColorizationSettingSchema ] }; -}; +} configurationRegistry.registerConfiguration({ id: 'editor', diff --git a/src/vs/workbench/services/viewlet/browser/viewletService.ts b/src/vs/workbench/services/viewlet/browser/viewletService.ts index 3af0a697b6f..39cc03bd556 100644 --- a/src/vs/workbench/services/viewlet/browser/viewletService.ts +++ b/src/vs/workbench/services/viewlet/browser/viewletService.ts @@ -25,8 +25,8 @@ export class ViewletService implements IViewletService { private extensionViewletsLoaded: TPromise; private extensionViewletsLoadedPromiseComplete: ValueCallback; - public get onDidViewletOpen(): Event { return this.sidebarPart.onDidViewletOpen; }; - public get onDidViewletClose(): Event { return this.sidebarPart.onDidViewletClose; }; + public get onDidViewletOpen(): Event { return this.sidebarPart.onDidViewletOpen; } + public get onDidViewletClose(): Event { return this.sidebarPart.onDidViewletClose; } constructor( sidebarPart: SidebarPart, diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts index 5014719ddb2..bbe463f0080 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts @@ -25,7 +25,7 @@ suite('ExtHostConfiguration', function () { this.lastArgs = [target, key, value]; return TPromise.as(void 0); } - }; + } function createExtHostConfiguration(contents: any = Object.create(null), shape?: MainThreadConfigurationShape) { if (!shape) { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts index 76aa419a4b5..b0fee510b50 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts @@ -24,7 +24,7 @@ suite('ExtHostDiagnostics', () => { $clear(owner: string): TPromise { return TPromise.as(null); } - }; + } test('disposeCheck', function () { @@ -35,6 +35,7 @@ suite('ExtHostDiagnostics', () => { assert.throws(() => collection.name); assert.throws(() => collection.clear()); assert.throws(() => collection.delete(URI.parse('aa:bb'))); + // tslint:disable-next-line:semicolon assert.throws(() => collection.forEach(() => { ; })); assert.throws(() => collection.get(URI.parse('aa:bb'))); assert.throws(() => collection.has(URI.parse('aa:bb'))); diff --git a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts index 1426bcdef75..f1824c5c95d 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts @@ -31,7 +31,7 @@ suite('ExtHostConfiguration', function () { $refresh(viewId: string, itemHandles: number[]): void { this.onRefresh.fire(itemHandles); } - }; + } let testObject: ExtHostTreeViews; let target: RecordingShape; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index 7fd5cb0883e..aa0b3e1f76b 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -36,7 +36,7 @@ suite('MainThreadDocumentsAndEditors', () => { modelService = new ModelServiceImpl(null, configService); codeEditorService = new MockCodeEditorService(); textFileService = new class extends mock() { - isDirty() { return false; }; + isDirty() { return false; } models = { onModelSaved: Event.None, onModelReverted: Event.None, diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts index b470742526b..ab9454d1177 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts @@ -36,7 +36,7 @@ suite('MainThreadEditors', () => { modelService = new ModelServiceImpl(null, configService); const codeEditorService = new MockCodeEditorService(); const textFileService = new class extends mock() { - isDirty() { return false; }; + isDirty() { return false; } models = { onModelSaved: Event.None, onModelReverted: Event.None, diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index f811c0727c3..e0fc023cb81 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -178,7 +178,7 @@ class TestTelemetryService implements ITelemetryService { machineId: 'someValue.machineId' }); } -}; +} class TestExperimentService implements IExperimentService { diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts index 0cc049bd232..056f00fdbd0 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts @@ -166,4 +166,4 @@ class TestTelemetryService implements ITelemetryService { machineId: 'someValue.machineId' }); } -}; +} diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 3d0c198bc98..de7264925b4 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -880,7 +880,7 @@ export class TestBackupFileService implements IBackupFileService { public discardAllWorkspaceBackups(): TPromise { return TPromise.as(void 0); } -}; +} export class TestWindowService implements IWindowService { diff --git a/test/smoke/src/areas/activitybar/activityBar.ts b/test/smoke/src/areas/activitybar/activityBar.ts index ada2cb9c5b6..894eef36f9f 100644 --- a/test/smoke/src/areas/activitybar/activityBar.ts +++ b/test/smoke/src/areas/activitybar/activityBar.ts @@ -9,7 +9,7 @@ import { SpectronApplication } from '../../spectron/application'; export enum ActivityBarPosition { LEFT = 0, RIGHT = 1 -}; +} export class ActivityBar { diff --git a/test/smoke/src/areas/preferences/settings.ts b/test/smoke/src/areas/preferences/settings.ts index 37352e30c8e..657d71357e9 100644 --- a/test/smoke/src/areas/preferences/settings.ts +++ b/test/smoke/src/areas/preferences/settings.ts @@ -10,7 +10,7 @@ import { SpectronApplication } from '../../spectron/application'; export enum ActivityBarPosition { LEFT = 0, RIGHT = 1 -}; +} const SEARCH_INPUT = '.settings-search-input input'; const EDITOR = '.editable-preferences-editor-container .monaco-editor textarea'; diff --git a/test/smoke/src/areas/problems/problems.ts b/test/smoke/src/areas/problems/problems.ts index ed1ea406c1a..f28697e5e81 100644 --- a/test/smoke/src/areas/problems/problems.ts +++ b/test/smoke/src/areas/problems/problems.ts @@ -8,7 +8,7 @@ import { SpectronApplication } from '../../spectron/application'; export enum ProblemSeverity { WARNING = 0, ERROR = 1 -}; +} export class Problems { diff --git a/test/smoke/src/spectron/application.ts b/test/smoke/src/spectron/application.ts index 18f5cfb5413..22c1c23010d 100644 --- a/test/smoke/src/spectron/application.ts +++ b/test/smoke/src/spectron/application.ts @@ -332,6 +332,6 @@ export class SpectronApplication { return 'Meta'; default: return key.length === 1 ? key : key.charAt(0).toUpperCase() + key.slice(1); - }; + } } } From ab17bb71f608a8b2aed76913668691314e3eb16f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 7 Nov 2017 12:23:32 +0100 Subject: [PATCH 21/88] add a new lifecycle event `Restoring` which is set when the editors/viewlets are being restored (start). also in the lifecycle service replace `onDidChangePhase` with `when` --- src/vs/platform/lifecycle/common/lifecycle.ts | 14 ++++---- .../common/editor/textEditorModel.ts | 8 ++--- src/vs/workbench/electron-browser/shell.ts | 2 +- .../workbench/electron-browser/workbench.ts | 6 ++-- .../performance.contribution.ts | 3 +- .../electron-browser/extensionService.ts | 7 ++-- .../electron-browser/lifecycleService.ts | 36 ++++++++++++++----- .../workbench/test/workbenchTestServices.ts | 11 +++--- 8 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src/vs/platform/lifecycle/common/lifecycle.ts b/src/vs/platform/lifecycle/common/lifecycle.ts index 0a413c08ce9..3f2cd9cde69 100644 --- a/src/vs/platform/lifecycle/common/lifecycle.ts +++ b/src/vs/platform/lifecycle/common/lifecycle.ts @@ -47,8 +47,9 @@ export enum StartupKind { export enum LifecyclePhase { Starting = 1, - Running = 2, - ShuttingDown = 3 + Restoring = 2, + Running = 3, + ShuttingDown = 4 } /** @@ -70,9 +71,10 @@ export interface ILifecycleService { readonly phase: LifecyclePhase; /** - * An event that fire when the lifecycle phase has changed + * Returns a promise that resolves when a certain lifecycle phase + * has started. */ - readonly onDidChangePhase: Event; + when(phase: LifecyclePhase): Thenable; /** * Fired before shutdown happens. Allows listeners to veto against the @@ -92,8 +94,8 @@ export interface ILifecycleService { export const NullLifecycleService: ILifecycleService = { _serviceBrand: null, phase: LifecyclePhase.Running, + when() { return Promise.resolve(); }, startupKind: StartupKind.NewWindow, - onDidChangePhase: Event.None, onWillShutdown: Event.None, onShutdown: Event.None }; @@ -127,4 +129,4 @@ export function handleVetos(vetos: (boolean | TPromise)[], onError: (er } return TPromise.join(promises).then(() => lazyValue); -} \ No newline at end of file +} diff --git a/src/vs/workbench/common/editor/textEditorModel.ts b/src/vs/workbench/common/editor/textEditorModel.ts index 37c60e19f44..3a600630689 100644 --- a/src/vs/workbench/common/editor/textEditorModel.ts +++ b/src/vs/workbench/common/editor/textEditorModel.ts @@ -70,11 +70,7 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd protected createTextEditorModel(value: string | IRawTextSource, resource?: URI, modeId?: string): TPromise { const firstLineText = this.getFirstLineText(value); const mode = this.getOrCreateMode(this.modeService, modeId, firstLineText); - - // To avoid flickering, give the mode at most 50ms to load. If the mode doesn't load in 50ms, proceed creating the model with a mode promise - return TPromise.any([TPromise.timeout(50), mode]).then(() => { - return this.doCreateTextEditorModel(value, mode, resource); - }); + return TPromise.as(this.doCreateTextEditorModel(value, mode, resource)); } private doCreateTextEditorModel(value: string | IRawTextSource, mode: TPromise, resource: URI): EditorModel { @@ -166,4 +162,4 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd super.dispose(); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index d66e577ad6a..2c03fa098e8 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -165,7 +165,7 @@ export class WorkbenchShell { const [instantiationService, serviceCollection] = this.initServiceCollection(parent.getHTMLElement()); // Workbench - this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.configuration, serviceCollection); + this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.configuration, serviceCollection, this.lifecycleService); this.workbench.startup({ onWorkbenchStarted: (info: IWorkbenchStartedInfo) => { diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 75d3cc04331..342283b8fdc 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -79,7 +79,8 @@ import { ProgressService2 } from 'vs/workbench/services/progress/browser/progres import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; +import { ShutdownReason, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { LifecycleService } from 'vs/workbench/services/lifecycle/electron-browser/lifecycleService'; import { IWindowService, IWindowConfiguration as IWindowSettings, IWindowConfiguration, IPath } from 'vs/platform/windows/common/windows'; import { IMessageService } from 'vs/platform/message/common/message'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; @@ -217,10 +218,10 @@ export class Workbench implements IPartService { container: HTMLElement, configuration: IWindowConfiguration, serviceCollection: ServiceCollection, + private lifecycleService: LifecycleService, @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IStorageService private storageService: IStorageService, - @ILifecycleService private lifecycleService: ILifecycleService, @IMessageService private messageService: IMessageService, @IConfigurationService private configurationService: WorkspaceService, @ITelemetryService private telemetryService: ITelemetryService, @@ -339,6 +340,7 @@ export class Workbench implements IPartService { const editorRestoreClock = time('restore:editors'); const restoredEditors: string[] = []; compositeAndEditorPromises.push(this.resolveEditorsToOpen().then(inputs => { + this.lifecycleService.phase = LifecyclePhase.Restoring; let editorOpenPromise: TPromise; if (inputs.length) { editorOpenPromise = this.editorService.openEditors(inputs.map(input => { return { input, position: EditorPosition.ONE }; })); diff --git a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts index fffca3a3e5e..d860eb770b9 100644 --- a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts +++ b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts @@ -17,7 +17,6 @@ import { ReportPerformanceIssueAction } from 'vs/workbench/electron-browser/acti import { TPromise } from 'vs/base/common/winjs.base'; import { join } from 'path'; import { localize } from 'vs/nls'; -import { toPromise, filterEvent } from 'vs/base/common/event'; import { readdir } from 'vs/base/node/pfs'; import { stopProfiling } from 'vs/base/node/profiler'; @@ -33,8 +32,8 @@ class StartupProfiler implements IWorkbenchContribution { ) { // wait for everything to be ready TPromise.join([ + lifecycleService.when(LifecyclePhase.Running), extensionService.onReady(), - toPromise(filterEvent(lifecycleService.onDidChangePhase, phase => phase === LifecyclePhase.Running)), ]).then(() => { this._stopProfiling(); }); diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index e973d3b7e91..8e19e2df434 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -33,7 +33,6 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; import { Action } from 'vs/base/common/actions'; import { IDisposable } from 'vs/base/common/lifecycle'; import { mark, time } from 'vs/base/common/performance'; -import { toPromise, filterEvent } from 'vs/base/common/event'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; const SystemExtensionsRoot = path.normalize(path.join(URI.parse(require.toUrl('')).fsPath, '..', 'extensions')); @@ -100,12 +99,12 @@ export class ExtensionService implements IExtensionService { this._extensionHostProcessCustomers = []; this._extensionHostProcessProxy = null; - toPromise(filterEvent(lifecycleService.onDidChangePhase, phase => phase === LifecyclePhase.Running)).then(() => { + lifecycleService.when(LifecyclePhase.Restoring).then(() => { // delay extension host creation and extension scanning // until after the editors/panels are restored + this._startExtensionHostProcess([]); + this._scanAndHandleExtensions(); }); - this._startExtensionHostProcess([]); - this._scanAndHandleExtensions(); } public restartExtensionHost(): void { diff --git a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts index 99e62bc0aa6..3c73d835251 100644 --- a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts +++ b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts @@ -13,6 +13,8 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { ipcRenderer as ipc } from 'electron'; import Event, { Emitter } from 'vs/base/common/event'; import { IWindowService } from 'vs/platform/windows/common/windows'; +import { mark } from 'vs/base/common/performance'; +import { Barrier } from 'vs/workbench/services/extensions/node/barrier'; export class LifecycleService implements ILifecycleService { @@ -20,12 +22,12 @@ export class LifecycleService implements ILifecycleService { public _serviceBrand: any; - private readonly _onDidChangePhase = new Emitter(); private readonly _onWillShutdown = new Emitter(); private readonly _onShutdown = new Emitter(); private readonly _startupKind: StartupKind; private _phase: LifecyclePhase = LifecyclePhase.Starting; + private _phaseWhen = new Map(); constructor( @IMessageService private _messageService: IMessageService, @@ -50,20 +52,38 @@ export class LifecycleService implements ILifecycleService { } public set phase(value: LifecyclePhase) { - if (this._phase !== value) { - this._phase = value; - this._onDidChangePhase.fire(value); + if (value < this.phase) { + throw new Error('Lifecycle cannot go backwards'); } + if (this._phase === value) { + return; + } + + this._phase = value; + mark(`LifecyclePhase/${LifecyclePhase[value]}`); + + if (this._phaseWhen.has(this._phase)) { + this._phaseWhen.get(this._phase).open(); + this._phaseWhen.delete(this._phase); + } + } + + public when(phase: LifecyclePhase): Thenable { + if (phase <= this._phase) { + return Promise.resolve(); + } + let barrier = this._phaseWhen.get(phase); + if (!barrier) { + barrier = new Barrier(); + this._phaseWhen.set(phase, barrier); + } + return barrier.wait(); } public get startupKind(): StartupKind { return this._startupKind; } - public get onDidChangePhase(): Event { - return this._onDidChangePhase.event; - } - public get onWillShutdown(): Event { return this._onWillShutdown.event; } diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index de7264925b4..56398e4ceb4 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -60,6 +60,7 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res import { IPosition } from 'vs/editor/common/core/position'; import { ICommandAction } from 'vs/platform/actions/common/actions'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; +import { notImplemented } from 'vs/base/common/errors'; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { return instantiationService.createInstance(FileEditorInput, resource, void 0); @@ -1008,10 +1009,12 @@ export class TestLifecycleService implements ILifecycleService { public phase: LifecyclePhase; public startupKind: StartupKind; - private _onDidChangePhase = new Emitter(); private _onWillShutdown = new Emitter(); private _onShutdown = new Emitter(); + when(): Thenable { + throw notImplemented(); + }; public fireShutdown(reason = ShutdownReason.QUIT): void { this._onShutdown.fire(reason); @@ -1021,10 +1024,6 @@ export class TestLifecycleService implements ILifecycleService { this._onWillShutdown.fire(event); } - public get onDidChangePhase(): Event { - return this._onDidChangePhase.event; - } - public get onWillShutdown(): Event { return this._onWillShutdown.event; } @@ -1250,4 +1249,4 @@ export class TestHashService implements IHashService { export function getRandomTestPath(tmpdir: string, ...segments: string[]): string { return paths.join(tmpdir, ...segments, generateUuid()); -} \ No newline at end of file +} From 8bf5e263749b2ff2de6e867a33e47ae61f41c54e Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Tue, 7 Nov 2017 12:43:05 +0100 Subject: [PATCH 22/88] Fixes #7353: Running build task in Code approximately 50% slower than in terminal --- .../media/task.contribution.css | 4 +- .../electron-browser/task.contribution.ts | 39 +++++-------------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css index b0acde0d340..05c596a162b 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css +++ b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css @@ -32,8 +32,7 @@ vertical-align: top; } -.task-statusbar-item-progress { - width: 6px; +.task-statusbar-item-building { height: 18px; padding: 0px 2px 0px 2px; display: inline-block; @@ -44,7 +43,6 @@ .task-statusbar-item-label { display: inline-block; cursor: pointer; - padding: 0 5px 0 0; } .task-statusbar-item-label > .task-statusbar-item-label-counter { diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 165317fb9b5..7fb9ff90337 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -136,9 +136,7 @@ class ViewTerminalAction extends Action { } class BuildStatusBarItem extends Themable implements IStatusbarItem { - private intervalToken: any; private activeCount: number; - private static progressChars: string = '|/-\\'; private icons: HTMLElement[]; constructor( @@ -174,7 +172,6 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { let callOnDispose: IDisposable[] = []; const element = document.createElement('div'); - const progress = document.createElement('div'); const label = document.createElement('a'); const errorIcon = document.createElement('div'); const warningIcon = document.createElement('div'); @@ -182,14 +179,10 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { const error = document.createElement('div'); const warning = document.createElement('div'); const info = document.createElement('div'); + const building = document.createElement('div'); Dom.addClass(element, 'task-statusbar-item'); - Dom.addClass(progress, 'task-statusbar-item-progress'); - element.appendChild(progress); - progress.innerHTML = BuildStatusBarItem.progressChars[0]; - $(progress).hide(); - Dom.addClass(label, 'task-statusbar-item-label'); element.appendChild(label); element.title = nls.localize('problems', "Problems"); @@ -222,6 +215,12 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { label.appendChild(info); $(info).hide(); + Dom.addClass(building, 'task-statusbar-item-building'); + element.appendChild(building); + building.innerHTML = nls.localize('building', 'Building...'); + $(building).hide(); + + callOnDispose.push(Dom.addDisposableListener(label, 'click', (e: MouseEvent) => { const panel = this.panelService.getActivePanel(); if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { @@ -261,17 +260,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { } this.activeCount++; if (this.activeCount === 1) { - let index = 1; - let chars = BuildStatusBarItem.progressChars; - progress.innerHTML = chars[0]; - this.intervalToken = setInterval(() => { - progress.innerHTML = chars[index]; - index++; - if (index >= chars.length) { - index = 0; - } - }, 50); - $(progress).show(); + $(building).show(); } })); @@ -284,11 +273,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { if (this.activeCount > 0) { this.activeCount--; if (this.activeCount === 0) { - $(progress).hide(); - if (this.intervalToken) { - clearInterval(this.intervalToken); - this.intervalToken = null; - } + $(building).hide(); } } })); @@ -298,11 +283,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { return; } if (this.activeCount !== 0) { - $(progress).hide(); - if (this.intervalToken) { - clearInterval(this.intervalToken); - this.intervalToken = null; - } + $(building).hide(); this.activeCount = 0; } })); From c1bfc0501434626d89df2bbbfcd1d77a65970aad Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 12:58:29 +0100 Subject: [PATCH 23/88] restore editor first (for #37541) --- src/vs/workbench/electron-browser/shell.ts | 31 ++- .../workbench/electron-browser/workbench.ts | 231 +++++++++--------- 2 files changed, 135 insertions(+), 127 deletions(-) diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index 2c03fa098e8..33a9e506427 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -166,20 +166,29 @@ export class WorkbenchShell { // Workbench this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.configuration, serviceCollection, this.lifecycleService); - this.workbench.startup({ - onWorkbenchStarted: (info: IWorkbenchStartedInfo) => { + try { + this.workbench.startup({ + onWorkbenchStarted: (info: IWorkbenchStartedInfo) => { - // run workbench started logic - this.onWorkbenchStarted(info); + // run workbench started logic + this.onWorkbenchStarted(info); - // start cached data manager - instantiationService.createInstance(NodeCachedDataManager); + // start cached data manager + instantiationService.createInstance(NodeCachedDataManager); - // Set lifecycle phase to `Runnning` so that other contributions - // can now do something - this.lifecycleService.phase = LifecyclePhase.Running; - } - }); + // Set lifecycle phase to `Runnning` so that other contributions + // can now do something + this.lifecycleService.phase = LifecyclePhase.Running; + } + }); + } catch (error) { + + // Print out error + console.error(toErrorMessage(error, true)); + + // Rethrow + throw error; + } // Window this.workbench.getInstantiationService().createInstance(ElectronWindow, this.container); diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 342283b8fdc..c91957498d4 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -269,136 +269,135 @@ export class Workbench implements IPartService { * once. Use the shutdown function to free up resources created by the workbench on startup. */ public startup(callbacks?: IWorkbenchCallbacks): void { - try { - this.workbenchStarted = true; - this.callbacks = callbacks; + this.workbenchStarted = true; + this.callbacks = callbacks; - // Create Workbench - this.createWorkbench(); + // Create Workbench + this.createWorkbench(); - // Install some global actions - this.createGlobalActions(); + // Install some global actions + this.createGlobalActions(); - // Services - this.initServices(); - if (this.callbacks && this.callbacks.onServicesCreated) { - this.callbacks.onServicesCreated(); + // Services + this.initServices(); + if (this.callbacks && this.callbacks.onServicesCreated) { + this.callbacks.onServicesCreated(); + } + + // Contexts + this.messagesVisibleContext = MessagesVisibleContext.bindTo(this.contextKeyService); + this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.contextKeyService); + this.inZenMode = InZenModeContext.bindTo(this.contextKeyService); + this.sideBarVisibleContext = SidebarVisibleContext.bindTo(this.contextKeyService); + + // Register Listeners + this.registerListeners(); + + // Settings + this.initSettings(); + + // Create Workbench and Parts + this.renderWorkbench(); + + // Workbench Layout + this.createWorkbenchLayout(); + + // Restore Parts + this.restoreParts().done(startedInfo => { + this.workbenchCreated = true; + this.creationPromiseComplete(true); + + if (this.callbacks && this.callbacks.onWorkbenchStarted) { + this.callbacks.onWorkbenchStarted(startedInfo); + } + }); + } + + private restoreParts(): TPromise { + const restorePromises: TPromise[] = []; + + // Restore Editors + const editorRestoreStopWatch = StopWatch.create(); + const editorRestoreClock = time('restore:editors'); + const restoredEditors: string[] = []; + restorePromises.push(this.resolveEditorsToOpen().then(inputs => { + this.lifecycleService.phase = LifecyclePhase.Restoring; + + let editorOpenPromise: TPromise; + if (inputs.length) { + editorOpenPromise = this.editorService.openEditors(inputs.map(input => { return { input, position: EditorPosition.ONE }; })); + } else { + editorOpenPromise = this.editorPart.restoreEditors(); } - // Contexts - this.messagesVisibleContext = MessagesVisibleContext.bindTo(this.contextKeyService); - this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.contextKeyService); - this.inZenMode = InZenModeContext.bindTo(this.contextKeyService); - this.sideBarVisibleContext = SidebarVisibleContext.bindTo(this.contextKeyService); + return editorOpenPromise.then(editors => { + this.handleEditorBackground(); // make sure we show the proper background in the editor area - // Register Listeners - this.registerListeners(); + editorRestoreClock.stop(); + editorRestoreStopWatch.stop(); - // Settings - this.initSettings(); - - // Create Workbench and Parts - this.renderWorkbench(); - - // Workbench Layout - this.createWorkbenchLayout(); - - // Load composites and editors in parallel - const compositeAndEditorPromises: TPromise[] = []; - - // Restore last opened viewlet - let viewletRestoreStopWatch: StopWatch; - let viewletIdToRestore: string; - if (!this.sideBarHidden) { - this.sideBarVisibleContext.set(true); - - if (this.shouldRestoreLastOpenedViewlet()) { - viewletIdToRestore = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE); - } - - if (!viewletIdToRestore) { - viewletIdToRestore = this.viewletService.getDefaultViewletId(); - } - - viewletRestoreStopWatch = StopWatch.create(); - const viewletRestoreClock = time('restore:viewlet'); - compositeAndEditorPromises.push(this.viewletService.openViewlet(viewletIdToRestore).then(() => { - viewletRestoreStopWatch.stop(); - viewletRestoreClock.stop(); - })); - } - - // Load Panel - const panelRegistry = Registry.as(PanelExtensions.Panels); - const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, panelRegistry.getDefaultPanelId()); - if (!this.panelHidden && !!panelId) { - compositeAndEditorPromises.push(this.panelPart.openPanel(panelId, false)); - } - - // Load Editors - const editorRestoreStopWatch = StopWatch.create(); - const editorRestoreClock = time('restore:editors'); - const restoredEditors: string[] = []; - compositeAndEditorPromises.push(this.resolveEditorsToOpen().then(inputs => { - this.lifecycleService.phase = LifecyclePhase.Restoring; - let editorOpenPromise: TPromise; - if (inputs.length) { - editorOpenPromise = this.editorService.openEditors(inputs.map(input => { return { input, position: EditorPosition.ONE }; })); - } else { - editorOpenPromise = this.editorPart.restoreEditors(); - } - - return editorOpenPromise.then(editors => { - this.handleEditorBackground(); // make sure we show the proper background in the editor area - editorRestoreClock.stop(); - editorRestoreStopWatch.stop(); - for (const editor of editors) { - if (editor) { - if (editor.input) { - restoredEditors.push(editor.input.getName()); - } else { - restoredEditors.push(`other:${editor.getId()}`); - } + for (const editor of editors) { + if (editor) { + if (editor.input) { + restoredEditors.push(editor.input.getName()); + } else { + restoredEditors.push(`other:${editor.getId()}`); } } - }); - })); + } + }); + })); - if (this.storageService.getBoolean(Workbench.zenModeActiveSettingKey, StorageScope.WORKSPACE, false)) { - this.toggleZenMode(true); + // Restore Sidebar + let viewletRestoreStopWatch: StopWatch; + let viewletIdToRestore: string; + if (!this.sideBarHidden) { + this.sideBarVisibleContext.set(true); + + if (this.shouldRestoreLastOpenedViewlet()) { + viewletIdToRestore = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE); } - // Flag workbench as created once done - const workbenchDone = (error?: Error) => { - this.workbenchCreated = true; - this.creationPromiseComplete(true); + if (!viewletIdToRestore) { + viewletIdToRestore = this.viewletService.getDefaultViewletId(); + } - if (this.callbacks && this.callbacks.onWorkbenchStarted) { - this.callbacks.onWorkbenchStarted({ - customKeybindingsCount: this.keybindingService.customKeybindingsCount(), - restoreViewletDuration: viewletRestoreStopWatch ? Math.round(viewletRestoreStopWatch.elapsed()) : 0, - restoreEditorsDuration: Math.round(editorRestoreStopWatch.elapsed()), - pinnedViewlets: this.activitybarPart.getPinned(), - restoredViewlet: viewletIdToRestore, - restoredEditors - }); - } - - if (error) { - errors.onUnexpectedError(error); - } - }; - - // Join viewlet, panel and editor promises - TPromise.join(compositeAndEditorPromises).then(() => workbenchDone(), error => workbenchDone(error)); - } catch (error) { - - // Print out error - console.error(toErrorMessage(error, true)); - - // Rethrow - throw error; + viewletRestoreStopWatch = StopWatch.create(); + const viewletRestoreClock = time('restore:viewlet'); + restorePromises.push(this.viewletService.openViewlet(viewletIdToRestore).then(() => { + viewletRestoreStopWatch.stop(); + viewletRestoreClock.stop(); + })); } + + // Restore Panel + const panelRegistry = Registry.as(PanelExtensions.Panels); + const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, panelRegistry.getDefaultPanelId()); + if (!this.panelHidden && !!panelId) { + restorePromises.push(this.panelPart.openPanel(panelId, false)); + } + + // Restore Zen Mode if active + if (this.storageService.getBoolean(Workbench.zenModeActiveSettingKey, StorageScope.WORKSPACE, false)) { + this.toggleZenMode(true); + } + + const onRestored = (error?: Error): IWorkbenchStartedInfo => { + if (error) { + errors.onUnexpectedError(error); + } + + return { + customKeybindingsCount: this.keybindingService.customKeybindingsCount(), + restoreViewletDuration: viewletRestoreStopWatch ? Math.round(viewletRestoreStopWatch.elapsed()) : 0, + restoreEditorsDuration: Math.round(editorRestoreStopWatch.elapsed()), + pinnedViewlets: this.activitybarPart.getPinned(), + restoredViewlet: viewletIdToRestore, + restoredEditors + }; + }; + + return TPromise.join(restorePromises).then(() => onRestored(), error => onRestored(error)); } private createGlobalActions(): void { From c536efdfbc37259e5020a4eafa04d7de3971adce Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 7 Nov 2017 13:13:17 +0100 Subject: [PATCH 24/88] Enabled the noUnusedLocals and added @tsignore --- src/tsconfig.json | 1 + src/vs/base/browser/htmlContentRenderer.ts | 1 + src/vs/base/browser/ui/inputbox/inputBox.ts | 1 + src/vs/base/browser/ui/list/listWidget.ts | 1 + .../base/browser/ui/progressbar/progressbar.ts | 1 + src/vs/base/browser/ui/sash/sash.ts | 6 +++++- src/vs/base/browser/ui/selectBox/selectBox.ts | 1 + src/vs/base/browser/ui/splitview/panelview.ts | 1 + src/vs/base/browser/ui/splitview/splitview.ts | 2 +- src/vs/base/common/async.ts | 1 + src/vs/base/common/diff/diff2.ts | 1 + src/vs/base/common/paging.ts | 1 + src/vs/base/common/parsers.ts | 2 ++ src/vs/base/parts/ipc/common/ipc.electron.ts | 1 + .../parts/quickopen/common/quickOpenScorer.ts | 1 + src/vs/base/parts/tree/browser/treeImpl.ts | 1 + src/vs/base/parts/tree/browser/treeModel.ts | 2 +- src/vs/base/parts/tree/browser/treeView.ts | 2 +- .../parts/tree/test/browser/treeModel.test.ts | 4 ++-- .../contrib/nodeCachedDataCleaner.ts | 1 + src/vs/code/electron-main/app.ts | 1 + src/vs/code/electron-main/menus.ts | 1 + src/vs/code/electron-main/windows.ts | 2 ++ .../browser/controller/textAreaHandler.ts | 2 +- src/vs/editor/browser/view/viewImpl.ts | 1 + .../currentLineHighlight.ts | 1 + .../editor/browser/viewParts/rulers/rulers.ts | 1 + src/vs/editor/browser/widget/diffReview.ts | 2 ++ src/vs/editor/common/commonCodeEditor.ts | 2 +- .../editor/common/controller/coreCommands.ts | 2 +- src/vs/editor/common/core/uint.ts | 1 + src/vs/editor/common/modes/supports/onEnter.ts | 1 + .../common/services/editorWorkerServiceImpl.ts | 1 + .../common/viewLayout/viewLineRenderer.ts | 1 + .../bracketMatching/common/bracketMatching.ts | 1 + .../caretOperations/common/caretOperations.ts | 2 ++ .../caretOperations/common/transpose.ts | 1 + .../contrib/clipboard/browser/clipboard.ts | 4 ++++ .../contrib/codelens/browser/codelensWidget.ts | 1 + .../colorPicker/browser/colorPickerWidget.ts | 2 +- .../editor/contrib/comment/common/comment.ts | 4 ++++ .../contrib/contextmenu/browser/contextmenu.ts | 1 + .../editor/contrib/folding/browser/folding.ts | 6 ++++++ .../contrib/format/browser/formatActions.ts | 2 ++ .../browser/goToDeclarationMouse.ts | 1 + .../contrib/gotoError/browser/gotoError.ts | 2 ++ src/vs/editor/contrib/hover/browser/hover.ts | 1 + .../inPlaceReplace/common/inPlaceReplace.ts | 3 +++ .../contrib/indentation/common/indentation.ts | 1 + .../linesOperations/common/linesOperations.ts | 8 ++++++++ src/vs/editor/contrib/links/browser/links.ts | 2 ++ .../contrib/multicursor/common/multicursor.ts | 1 + .../contrib/smartSelect/common/smartSelect.ts | 2 ++ .../contrib/suggest/browser/suggestWidget.ts | 1 + .../wordHighlighter/common/wordHighlighter.ts | 2 ++ .../accessibilityHelp/accessibilityHelp.ts | 1 + .../browser/inspectTokens/inspectTokens.ts | 2 ++ .../standalone/browser/standaloneCodeEditor.ts | 2 ++ .../toggleHighContrast/toggleHighContrast.ts | 1 + .../test/browser/controller/imeTester.ts | 1 + .../browser/controller/textAreaState.test.ts | 1 + .../viewModel/viewModelDecorations.test.ts | 18 +++--------------- src/vs/platform/actions/common/menu.ts | 1 + .../backup/electron-main/backupMainService.ts | 1 + .../commands/test/commandService.test.ts | 1 + .../common/configurationModels.ts | 2 ++ .../common/extensionEnablementService.ts | 1 + .../node/extensionGalleryService.ts | 1 + .../node/extensionManagementService.ts | 1 + .../common/instantiationService.ts | 1 + .../test/common/instantiationServiceMock.ts | 2 ++ .../test/common/mockKeybindingService.ts | 1 + .../lifecycle/electron-main/lifecycleMain.ts | 1 + .../electron-browser/mainThreadCredentials.ts | 1 + .../electron-browser/mainThreadDocuments.ts | 1 + .../electron-browser/mainThreadHeapService.ts | 1 + .../mainThreadMessageService.ts | 1 + .../api/electron-browser/mainThreadSCM.ts | 2 ++ .../electron-browser/mainThreadTreeViews.ts | 2 ++ .../electron-browser/mainThreadWorkspace.ts | 2 ++ src/vs/workbench/api/node/extHost.api.impl.ts | 1 + .../api/node/extHostLanguageFeatures.ts | 2 ++ .../api/node/extHostMessageService.ts | 1 + src/vs/workbench/api/node/extHostTask.ts | 2 ++ src/vs/workbench/api/node/extHostTypes.ts | 1 + .../browser/actions/workspaceActions.ts | 1 + src/vs/workbench/browser/part.ts | 1 + .../parts/activitybar/activitybarPart.ts | 2 ++ .../parts/compositebar/compositeBarActions.ts | 3 +++ .../browser/parts/editor/editorActions.ts | 1 + .../browser/parts/editor/editorPicker.ts | 1 + .../browser/parts/editor/editorStatus.ts | 1 + .../browser/parts/editor/textEditor.ts | 2 ++ .../browser/parts/editor/webviewEditor.ts | 1 + .../parts/quickopen/quickOpenController.ts | 5 +++++ .../workbench/browser/parts/views/treeView.ts | 1 + .../browser/parts/views/viewsRegistry.ts | 1 + src/vs/workbench/browser/quickopen.ts | 1 + src/vs/workbench/electron-browser/actions.ts | 2 ++ src/vs/workbench/electron-browser/window.ts | 3 +++ src/vs/workbench/electron-browser/workbench.ts | 1 + .../cli/electron-browser/cli.contribution.ts | 2 ++ .../electron-browser/accessibility.ts | 1 + .../electron-browser/inspectKeybindings.ts | 1 + .../textMate/inspectTMScopes.ts | 1 + .../electron-browser/toggleWordWrap.ts | 2 ++ .../electron-browser/wordWrapMigration.ts | 1 + .../parts/debug/browser/debugActions.ts | 1 + .../parts/debug/browser/debugEditorActions.ts | 8 ++++++++ .../parts/debug/browser/debugQuickOpen.ts | 1 + .../parts/debug/browser/exceptionWidget.ts | 3 +++ .../parts/debug/browser/linkDetector.ts | 1 + .../debugConfigurationManager.ts | 3 +++ .../debug/electron-browser/debugService.ts | 3 +++ .../debug/electron-browser/debugViewer.ts | 5 +++++ .../parts/debug/electron-browser/debugViews.ts | 5 +++++ .../parts/debug/electron-browser/repl.ts | 3 +++ .../workbench/parts/debug/node/debugAdapter.ts | 1 + .../emmet/browser/actions/showEmmetCommands.ts | 1 + .../actions/expandAbbreviation.ts | 1 + .../extensions/browser/extensionEditor.ts | 6 ++++++ .../extensions/browser/extensionsActions.ts | 15 +++++++++++++++ .../parts/extensions/browser/extensionsList.ts | 1 + .../electron-browser/extensionsViewlet.ts | 2 ++ .../electron-browser/extensionsViews.ts | 3 +++ .../node/extensionsWorkbenchService.ts | 1 + .../files/browser/fileActions.contribution.ts | 2 ++ .../parts/files/browser/fileActions.ts | 5 +++++ .../files/browser/fileResultsNavigation.ts | 1 + .../parts/files/browser/files.contribution.ts | 1 + .../parts/files/browser/views/explorerView.ts | 2 ++ .../files/browser/views/explorerViewer.ts | 5 +++++ .../files/common/editors/fileEditorTracker.ts | 4 +++- .../parts/markers/browser/markersPanel.ts | 1 + .../markers/browser/markersPanelActions.ts | 1 + .../parts/markers/browser/markersTreeViewer.ts | 3 +++ .../parts/output/browser/outputServices.ts | 1 + .../preferences/browser/keybindingWidgets.ts | 1 + .../preferences/browser/keybindingsEditor.ts | 2 ++ .../preferences/browser/preferencesActions.ts | 1 + .../preferences/browser/preferencesEditor.ts | 6 ++++++ .../browser/preferencesRenderers.ts | 8 ++++++++ .../preferences/browser/preferencesService.ts | 2 ++ .../preferences/browser/preferencesWidgets.ts | 2 ++ .../common/keybindingsEditorModel.ts | 2 ++ .../preferences/common/preferencesModels.ts | 2 ++ .../parts/quickopen/browser/commandsHandler.ts | 4 ++++ .../relauncher.contribution.ts | 1 + .../scm/electron-browser/dirtydiffDecorator.ts | 8 ++++++++ .../parts/scm/electron-browser/scmMenus.ts | 1 + .../parts/search/browser/openFileHandler.ts | 1 + .../parts/search/browser/patternInputWidget.ts | 1 + .../parts/search/browser/replaceService.ts | 2 ++ .../search/browser/search.contribution.ts | 1 + .../parts/search/browser/searchActions.ts | 1 + .../parts/search/browser/searchResultsView.ts | 1 + .../parts/search/browser/searchViewlet.ts | 3 +++ .../parts/search/common/searchModel.ts | 2 ++ .../snippets/electron-browser/insertSnippet.ts | 1 + .../electron-browser/snippets.contribution.ts | 1 + .../languageSurveys.contribution.ts | 1 + .../workbench/parts/tasks/browser/quickOpen.ts | 1 + .../parts/tasks/common/problemCollectors.ts | 1 + .../electron-browser/task.contribution.ts | 14 ++++++++++++++ .../electron-browser/terminalTaskSystem.ts | 2 ++ .../parts/tasks/node/processTaskSystem.ts | 1 + .../parts/tasks/node/taskConfiguration.ts | 1 + .../terminal/browser/terminalQuickOpen.ts | 2 ++ .../terminal/browser/terminalWidgetManager.ts | 1 + .../electron-browser/terminalActions.ts | 3 +++ .../electron-browser/terminalConfigHelper.ts | 1 + .../electron-browser/terminalInstance.ts | 3 +++ .../electron-browser/terminalLinkHandler.ts | 1 + .../terminal/electron-browser/terminalPanel.ts | 2 ++ .../electron-browser/terminalService.ts | 1 + .../electron-browser/windowsShellHelper.ts | 2 ++ .../terminalConfigHelper.test.ts | 1 + .../electron-browser/themes.contribution.ts | 1 + .../parts/update/electron-browser/update.ts | 3 +++ .../watermark/electron-browser/watermark.ts | 1 + .../electron-browser/gettingStarted.ts | 1 + .../page/electron-browser/welcomePage.ts | 2 ++ .../electron-browser/walkThroughPart.ts | 3 +++ .../backup/test/node/backupFileService.test.ts | 1 + .../node/configurationEditingService.ts | 1 + .../configuration/node/configurationService.ts | 1 + .../node/configurationResolverService.ts | 2 ++ .../node/configurationResolverService.test.ts | 1 + .../editor/test/browser/editorService.test.ts | 1 + .../services/history/browser/history.ts | 1 + .../services/search/node/searchService.ts | 1 + .../common/textModelResolverService.ts | 1 + .../electron-browser/workbenchThemeService.ts | 1 + .../services/thread/common/threadService.ts | 1 + .../test/browser/actionRegistry.test.ts | 1 + .../parts/editor/editorStacksModel.test.ts | 1 + .../test/common/editor/editorDiffModel.test.ts | 2 ++ .../common/editor/rangeDecorations.test.ts | 3 +++ .../api/extHostApiCommands.test.ts | 1 + .../api/extHostLanguageFeatures.test.ts | 1 + .../api/mainThreadDocumentsAndEditors.test.ts | 1 + src/vs/workbench/test/workbenchTestServices.ts | 1 + 202 files changed, 380 insertions(+), 26 deletions(-) diff --git a/src/tsconfig.json b/src/tsconfig.json index ed888ce8a0f..177b075ce61 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -10,6 +10,7 @@ "experimentalDecorators": true, "declaration": true, "noImplicitReturns": true, + "noUnusedLocals": true, "baseUrl": ".", "typeRoots": [ "typings" diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index bf8dfd41504..61a1a593f92 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -50,6 +50,7 @@ export function renderFormattedText(formattedText: string, options: RenderOption export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions = {}): HTMLElement { const element = createElement(options); + //@ts-ignore unused local const { codeBlockRenderer, actionCallback } = options; // signal to code-block render that the diff --git a/src/vs/base/browser/ui/inputbox/inputBox.ts b/src/vs/base/browser/ui/inputbox/inputBox.ts index 378ec0c525d..c93367a5518 100644 --- a/src/vs/base/browser/ui/inputbox/inputBox.ts +++ b/src/vs/base/browser/ui/inputbox/inputBox.ts @@ -90,6 +90,7 @@ export class InputBox extends Widget { private placeholder: string; private ariaLabel: string; private validation: IInputValidator; + // @ts-ignore unused property private showValidationMessage: boolean; private state = 'idle'; private cachedHeight: number; diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 5742fa0dc35..df29b26b178 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -52,6 +52,7 @@ interface IRenderedElement { index: number; } +// @ts-ignore unused generic parameter class TraitRenderer implements IRenderer { private rendered: IRenderedElement[] = []; diff --git a/src/vs/base/browser/ui/progressbar/progressbar.ts b/src/vs/base/browser/ui/progressbar/progressbar.ts index ea34e06e1cb..ac24174cc72 100644 --- a/src/vs/base/browser/ui/progressbar/progressbar.ts +++ b/src/vs/base/browser/ui/progressbar/progressbar.ts @@ -40,6 +40,7 @@ export class ProgressBar { private toUnbind: IDisposable[]; private workedVal: number; private element: Builder; + // @ts-ignore unused property private animationRunning: boolean; private bit: HTMLElement; private totalWork: number; diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 4d35abcf1ac..cd0de3f9b84 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -51,6 +51,7 @@ export enum Orientation { export class Sash extends EventEmitter { private $e: Builder; + // @ts-ignore unused property private gesture: Gesture; private layoutProvider: ISashLayoutProvider; private isDisabled: boolean; @@ -140,8 +141,9 @@ export class Sash extends EventEmitter { let $window = $(window); let containerCSSClass = `${this.getOrientation()}-cursor-container${isMacintosh ? '-mac' : ''}`; - + // @ts-ignore unused local let lastCurrentX = startX; + // @ts-ignore unused local let lastCurrentY = startY; $window.on('mousemove', (e) => { @@ -191,7 +193,9 @@ export class Sash extends EventEmitter { currentY: startY }); + // @ts-ignore unused local let lastCurrentX = startX; + // @ts-ignore unused local let lastCurrentY = startY; listeners.push(DOM.addDisposableListener(this.$e.getHTMLElement(), EventType.Change, (event: GestureEvent) => { diff --git a/src/vs/base/browser/ui/selectBox/selectBox.ts b/src/vs/base/browser/ui/selectBox/selectBox.ts index 04a0d41fdb0..186ba115671 100644 --- a/src/vs/base/browser/ui/selectBox/selectBox.ts +++ b/src/vs/base/browser/ui/selectBox/selectBox.ts @@ -36,6 +36,7 @@ export class SelectBox extends Widget { private selectElement: HTMLSelectElement; private options: string[]; private selected: number; + // @ts-ignore unused property private container: HTMLElement; private _onDidSelect: Emitter; private toDispose: IDisposable[]; diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index 68cb92ea81f..746ef764007 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -338,6 +338,7 @@ export class PanelView implements IDisposable { readonly onDidSashChange: Event; + // @ts-ignore unused property constructor(private container: HTMLElement, options: IPanelViewOptions = {}) { this.dnd = !!options.dnd; this.el = append(container, $('.monaco-panel-view')); diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 5a94710ca9c..ac2c0d95c41 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -76,7 +76,7 @@ export class SplitView implements IDisposable { get length(): number { return this.viewItems.length; } - + // @ts-ignore unused property constructor(private container: HTMLElement, options: ISplitViewOptions = {}) { this.orientation = types.isUndefined(options.orientation) ? Orientation.VERTICAL : options.orientation; diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index e2120526002..cc2749f492a 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -510,6 +510,7 @@ export class Queue extends Limiter { * A helper to organize queues per resource. The ResourceQueue makes sure to manage queues per resource * by disposing them once the queue is empty. */ +// @ts-ignore unused generic parameter export class ResourceQueue { private queues: { [path: string]: Queue }; diff --git a/src/vs/base/common/diff/diff2.ts b/src/vs/base/common/diff/diff2.ts index d0b99788b9f..877ab0aff27 100644 --- a/src/vs/base/common/diff/diff2.ts +++ b/src/vs/base/common/diff/diff2.ts @@ -57,6 +57,7 @@ export class LcsDiff2 { private ids_for_x: number[]; private ids_for_y: number[]; + // @ts-ignore unused property private hashFunc: IHashFunction; private resultX: boolean[]; diff --git a/src/vs/base/common/paging.ts b/src/vs/base/common/paging.ts index de3319b5038..37153a4bcac 100644 --- a/src/vs/base/common/paging.ts +++ b/src/vs/base/common/paging.ts @@ -51,6 +51,7 @@ export class PagedModel implements IPagedModel { get length(): number { return this.pager.total; } + // @ts-ignore unused property constructor(private arg: IPager | T[], private pageTimeout: number = 500) { this.pager = isArray(arg) ? singlePagePager(arg) : arg; diff --git a/src/vs/base/common/parsers.ts b/src/vs/base/common/parsers.ts index 7bb73ab3399..7758e6ac629 100644 --- a/src/vs/base/common/parsers.ts +++ b/src/vs/base/common/parsers.ts @@ -163,6 +163,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables { } resolveAny(value: T): T; + // @ts-ignore unused generic parameter resolveAny(value: any): any { if (Types.isString(value)) { return this.resolveString(value); @@ -197,6 +198,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables { } private __resolveAnyLiteral(values: T): T; + // @ts-ignore unused generic parameter private __resolveAnyLiteral(values: any): any { let result: IStringDictionary | string[]> = Object.create(null); Object.keys(values).forEach(key => { diff --git a/src/vs/base/parts/ipc/common/ipc.electron.ts b/src/vs/base/parts/ipc/common/ipc.electron.ts index f9f773a330c..c69b7eac88b 100644 --- a/src/vs/base/parts/ipc/common/ipc.electron.ts +++ b/src/vs/base/parts/ipc/common/ipc.electron.ts @@ -18,6 +18,7 @@ export class Protocol implements IMessagePassingProtocol { private _onMessage: Event; get onMessage(): Event { return this._onMessage; } + // @ts-ignore unused property constructor(private sender: Sender, private onMessageEvent: Event) { const emitter = new Emitter(); onMessageEvent(msg => emitter.fire(msg)); diff --git a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts index 5636beb5f50..4ab821398e6 100644 --- a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts +++ b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts @@ -352,6 +352,7 @@ export function scoreItem(item: T, query: IPreparedQuery, fuzzy: boolean, acc return itemScore; } +// @ts-ignore unused generic parameter function doScoreItem(label: string, description: string, path: string, query: IPreparedQuery, fuzzy: boolean): IItemScore { // 1.) treat identity matches on full path highest diff --git a/src/vs/base/parts/tree/browser/treeImpl.ts b/src/vs/base/parts/tree/browser/treeImpl.ts index 14273a292ca..dae1fff48f2 100644 --- a/src/vs/base/parts/tree/browser/treeImpl.ts +++ b/src/vs/base/parts/tree/browser/treeImpl.ts @@ -64,6 +64,7 @@ const defaultStyles: _.ITreeStyles = { export class Tree extends Events.EventEmitter implements _.ITree { private container: HTMLElement; + // @ts-ignore unused property private configuration: _.ITreeConfiguration; private options: _.ITreeOptions; diff --git a/src/vs/base/parts/tree/browser/treeModel.ts b/src/vs/base/parts/tree/browser/treeModel.ts index f35afe2704e..c2119257743 100644 --- a/src/vs/base/parts/tree/browser/treeModel.ts +++ b/src/vs/base/parts/tree/browser/treeModel.ts @@ -205,7 +205,7 @@ export class Item extends Events.EventEmitter { public next: Item; public firstChild: Item; public lastChild: Item; - + // @ts-ignore unused property private userContent: HTMLElement; private height: number; diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index ac5ba32ad5c..bbd6e4c4476 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -392,7 +392,7 @@ export class TreeView extends HeightMap { private isRefreshing = false; private refreshingPreviousChildrenIds: { [id: string]: string[] } = {}; - + // @ts-ignore unused property private dragAndDropListeners: { (): void; }[]; private currentDragAndDropData: _.IDragAndDropData; private currentDropElement: any; diff --git a/src/vs/base/parts/tree/test/browser/treeModel.test.ts b/src/vs/base/parts/tree/test/browser/treeModel.test.ts index e7e24b16be9..39e90566539 100644 --- a/src/vs/base/parts/tree/test/browser/treeModel.test.ts +++ b/src/vs/base/parts/tree/test/browser/treeModel.test.ts @@ -1439,7 +1439,7 @@ suite('TreeModel - Dynamic data model', () => { var gotTimes = 0; var gotListener = dataModel.addListener('gotChildren', (element) => { gotTimes++; }); - + // @ts-ignore unused local var p1, p2; var p1Completes = []; @@ -1517,7 +1517,7 @@ suite('TreeModel - Dynamic data model', () => { var gotTimes = 0; var getListener = dataModel.addListener('getChildren', (element) => { getTimes++; }); var gotListener = dataModel.addListener('gotChildren', (element) => { gotTimes++; }); - + // @ts-ignore unused local var p1, p2; var p1Complete; diff --git a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts index 1b36710b748..9ff6f861378 100644 --- a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts +++ b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts @@ -13,6 +13,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import product from 'vs/platform/node/product'; declare type OnNodeCachedDataArgs = [{ errorCode: string, path: string, detail?: string }, { path: string, length: number }]; +// @ts-ignore unused local declare const MonacoEnvironment: { onNodeCachedData: OnNodeCachedDataArgs[] }; export class NodeCachedDataCleaner { diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 1c564e54f18..7c67597e716 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -76,6 +76,7 @@ export class CodeApplication { @ILogService private logService: ILogService, @IEnvironmentService private environmentService: IEnvironmentService, @ILifecycleService private lifecycleService: ILifecycleService, + // @ts-ignore unused injected service @IConfigurationService private configurationService: ConfigurationService, @IStorageService private storageService: IStorageService, @IHistoryMainService private historyService: IHistoryMainService diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index fb916b8f73d..b9932b45ceb 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -72,6 +72,7 @@ export class CodeMenu { @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, @IHistoryMainService private historyService: IHistoryMainService, + // @ts-ignore unused injected service @IWorkspacesMainService private workspacesService: IWorkspacesMainService ) { this.extensionViewlets = []; diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 148986ecca9..d3704cd95b8 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -143,6 +143,7 @@ export class WindowsManager implements IWindowsMainService { @IEnvironmentService private environmentService: IEnvironmentService, @ILifecycleService private lifecycleService: ILifecycleService, @IBackupMainService private backupService: IBackupMainService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IConfigurationService private configurationService: IConfigurationService, @IHistoryMainService private historyService: IHistoryMainService, @@ -1672,6 +1673,7 @@ class WorkspacesManager { constructor( private workspacesService: IWorkspacesMainService, + // @ts-ignore unused injected service private lifecycleService: ILifecycleService, private backupService: IBackupMainService, private environmentService: IEnvironmentService, diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts index a060f7863b1..6b7f630467c 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -54,7 +54,7 @@ export class TextAreaHandler extends ViewPart { private readonly _viewController: ViewController; private readonly _viewHelper: ITextAreaHandlerHelper; - + // @ts-ignore unused property private _pixelRatio: number; private _accessibilitySupport: platform.AccessibilitySupport; private _contentLeft: number; diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index 1a53e3d9814..72997183743 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -90,6 +90,7 @@ export class View extends ViewEventHandler { private overflowGuardContainer: FastDomNode; // Actual mutable state + // @ts-ignore unused property private _isDisposed: boolean; private _renderAnimationFrame: IDisposable; diff --git a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts index a2b218246e1..a07ae843924 100644 --- a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts +++ b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts @@ -16,6 +16,7 @@ import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common export class CurrentLineHighlightOverlay extends DynamicViewOverlay { private _context: ViewContext; private _lineHeight: number; + // @ts-ignore unused property private _readOnly: boolean; private _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all'; private _selectionIsEmpty: boolean; diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 6a5e95b0b8c..813a995c000 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -20,6 +20,7 @@ export class Rulers extends ViewPart { public domNode: FastDomNode; private _renderedRulers: FastDomNode[]; private _rulers: number[]; + // @ts-ignore unused property private _height: number; private _typicalHalfwidthCharacterWidth: number; diff --git a/src/vs/editor/browser/widget/diffReview.ts b/src/vs/editor/browser/widget/diffReview.ts index 22b17b5f9fb..7764188fe0b 100644 --- a/src/vs/editor/browser/widget/diffReview.ts +++ b/src/vs/editor/browser/widget/diffReview.ts @@ -764,6 +764,7 @@ registerThemingParticipant((theme, collector) => { }); @editorAction +// @ts-ignore @editorAction uses the class class DiffReviewNext extends EditorAction { constructor() { super({ @@ -787,6 +788,7 @@ class DiffReviewNext extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class DiffReviewPrev extends EditorAction { constructor() { super({ diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index 4881d847e08..f9dc3df6ff3 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -1036,7 +1036,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo class EditorContextKeysManager extends Disposable { private _editor: CommonCodeEditor; - + // @ts-ignore unused property private _editorId: IContextKey; private _editorFocus: IContextKey; private _editorTextFocus: IContextKey; diff --git a/src/vs/editor/common/controller/coreCommands.ts b/src/vs/editor/common/controller/coreCommands.ts index 37335e80e77..f3a8e446f63 100644 --- a/src/vs/editor/common/controller/coreCommands.ts +++ b/src/vs/editor/common/controller/coreCommands.ts @@ -1650,7 +1650,7 @@ export namespace CoreEditingCommands { }); } - +// @ts-ignore unused namespace namespace Config { function findFocusedEditor(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { diff --git a/src/vs/editor/common/core/uint.ts b/src/vs/editor/common/core/uint.ts index b68709f2ce2..924b783a4a5 100644 --- a/src/vs/editor/common/core/uint.ts +++ b/src/vs/editor/common/core/uint.ts @@ -7,6 +7,7 @@ export class Uint8Matrix { private _data: Uint8Array; + // @ts-ignore unused property private _rows: number; private _cols: number; diff --git a/src/vs/editor/common/modes/supports/onEnter.ts b/src/vs/editor/common/modes/supports/onEnter.ts index 2287829bb1d..be11c521278 100644 --- a/src/vs/editor/common/modes/supports/onEnter.ts +++ b/src/vs/editor/common/modes/supports/onEnter.ts @@ -24,6 +24,7 @@ interface IProcessedBracketPair { export class OnEnterSupport { private readonly _brackets: IProcessedBracketPair[]; + // @ts-ignore unused property private readonly _indentationRules: IndentationRule; private readonly _regExpRules: OnEnterRule[]; diff --git a/src/vs/editor/common/services/editorWorkerServiceImpl.ts b/src/vs/editor/common/services/editorWorkerServiceImpl.ts index eb0fc71a160..ed44a216e56 100644 --- a/src/vs/editor/common/services/editorWorkerServiceImpl.ts +++ b/src/vs/editor/common/services/editorWorkerServiceImpl.ts @@ -114,6 +114,7 @@ class WordBasedCompletionItemProvider implements modes.ISuggestSupport { private readonly _workerManager: WorkerManager; private readonly _configurationService: ITextResourceConfigurationService; + // @ts-ignore unused injected service private readonly _modeService: IModeService; private readonly _modelService: IModelService; diff --git a/src/vs/editor/common/viewLayout/viewLineRenderer.ts b/src/vs/editor/common/viewLayout/viewLineRenderer.ts index 2160e5ebff1..68dd0b726eb 100644 --- a/src/vs/editor/common/viewLayout/viewLineRenderer.ts +++ b/src/vs/editor/common/viewLayout/viewLineRenderer.ts @@ -618,6 +618,7 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render { let _charIndex = charIndex; let _tabsCharDelta = tabsCharDelta; + // @ts-ignore unused local let _charOffsetInPart = charOffsetInPart; for (; _charIndex < partEndIndex; _charIndex++) { diff --git a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts index ac3d45aee32..666bfdafc1f 100644 --- a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts @@ -20,6 +20,7 @@ import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/edito import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @editorAction +// @ts-ignore @editorAction uses the class class SelectBracketAction extends EditorAction { constructor() { super({ diff --git a/src/vs/editor/contrib/caretOperations/common/caretOperations.ts b/src/vs/editor/contrib/caretOperations/common/caretOperations.ts index 96e935bd69d..c31ae66f389 100644 --- a/src/vs/editor/contrib/caretOperations/common/caretOperations.ts +++ b/src/vs/editor/contrib/caretOperations/common/caretOperations.ts @@ -36,6 +36,7 @@ class MoveCaretAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class MoveCaretLeftAction extends MoveCaretAction { constructor() { super(true, { @@ -48,6 +49,7 @@ class MoveCaretLeftAction extends MoveCaretAction { } @editorAction +// @ts-ignore @editorAction uses the class class MoveCaretRightAction extends MoveCaretAction { constructor() { super(false, { diff --git a/src/vs/editor/contrib/caretOperations/common/transpose.ts b/src/vs/editor/contrib/caretOperations/common/transpose.ts index 5ca66ce287d..28bab72bba4 100644 --- a/src/vs/editor/contrib/caretOperations/common/transpose.ts +++ b/src/vs/editor/contrib/caretOperations/common/transpose.ts @@ -13,6 +13,7 @@ import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/e import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; @editorAction +// @ts-ignore @editorAction uses the class class TransposeLettersAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/clipboard/browser/clipboard.ts b/src/vs/editor/contrib/clipboard/browser/clipboard.ts index 84cb6cc3167..828d4ff7d4c 100644 --- a/src/vs/editor/contrib/clipboard/browser/clipboard.ts +++ b/src/vs/editor/contrib/clipboard/browser/clipboard.ts @@ -64,6 +64,7 @@ abstract class ExecCommandAction extends EditorAction { } @conditionalEditorAction(supportsCut) +// @ts-ignore @editorAction uses the class class ExecCommandCutAction extends ExecCommandAction { constructor() { @@ -102,6 +103,7 @@ class ExecCommandCutAction extends ExecCommandAction { } @conditionalEditorAction(supportsCopy) +// @ts-ignore @editorAction uses the class class ExecCommandCopyAction extends ExecCommandAction { constructor() { @@ -141,6 +143,7 @@ class ExecCommandCopyAction extends ExecCommandAction { } @conditionalEditorAction(supportsPaste) +// @ts-ignore @editorAction uses the class class ExecCommandPasteAction extends ExecCommandAction { constructor() { @@ -170,6 +173,7 @@ class ExecCommandPasteAction extends ExecCommandAction { } @conditionalEditorAction(supportsCopyWithSyntaxHighlighting) +// @ts-ignore @editorAction uses the class class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction { constructor() { diff --git a/src/vs/editor/contrib/codelens/browser/codelensWidget.ts b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts index ac7b103cd55..b98a31d4fa7 100644 --- a/src/vs/editor/contrib/codelens/browser/codelensWidget.ts +++ b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts @@ -65,6 +65,7 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { private readonly _disposables: IDisposable[] = []; private readonly _editor: editorBrowser.ICodeEditor; + // @ts-ignore unused property private _symbolRange: Range; private _widgetPosition: editorBrowser.IContentWidgetPosition; private _commands: { [id: string]: Command } = Object.create(null); diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts index d2c7c854f55..1b461696a68 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts @@ -66,7 +66,7 @@ export class ColorPickerBody extends Disposable { private saturationBox: SaturationBox; private hueStrip: Strip; private opacityStrip: Strip; - + // @ts-ignore unused property constructor(private container: HTMLElement, private model: ColorPickerModel, private pixelRatio: number) { super(); diff --git a/src/vs/editor/contrib/comment/common/comment.ts b/src/vs/editor/contrib/comment/common/comment.ts index 898e1aa89d0..e722543179f 100644 --- a/src/vs/editor/contrib/comment/common/comment.ts +++ b/src/vs/editor/contrib/comment/common/comment.ts @@ -43,6 +43,7 @@ abstract class CommentLineAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class ToggleCommentLineAction extends CommentLineAction { constructor() { super(Type.Toggle, { @@ -59,6 +60,7 @@ class ToggleCommentLineAction extends CommentLineAction { } @editorAction +// @ts-ignore @editorAction uses the class class AddLineCommentAction extends CommentLineAction { constructor() { super(Type.ForceAdd, { @@ -75,6 +77,7 @@ class AddLineCommentAction extends CommentLineAction { } @editorAction +// @ts-ignore @editorAction uses the class class RemoveLineCommentAction extends CommentLineAction { constructor() { super(Type.ForceRemove, { @@ -91,6 +94,7 @@ class RemoveLineCommentAction extends CommentLineAction { } @editorAction +// @ts-ignore @editorAction uses the class class BlockCommentAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index 2a726ea915e..8f08c79e111 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -218,6 +218,7 @@ export class ContextMenuController implements IEditorContribution { } @editorAction +// @ts-ignore @editorAction uses the class class ShowContextMenu extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index d453e0e5d3b..60df213b7ba 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -363,6 +363,7 @@ function foldingArgumentsConstraint(args: any) { } @editorAction +// @ts-ignore @editorAction uses the class class UnfoldAction extends FoldingAction { constructor() { @@ -407,6 +408,7 @@ class UnfoldAction extends FoldingAction { } @editorAction +// @ts-ignore @editorAction uses the class class UnFoldRecursivelyAction extends FoldingAction { constructor() { @@ -428,6 +430,7 @@ class UnFoldRecursivelyAction extends FoldingAction { } @editorAction +// @ts-ignore @editorAction uses the class class FoldAction extends FoldingAction { constructor() { @@ -472,6 +475,7 @@ class FoldAction extends FoldingAction { } @editorAction +// @ts-ignore @editorAction uses the class class FoldRecursivelyAction extends FoldingAction { constructor() { @@ -498,6 +502,7 @@ class FoldRecursivelyAction extends FoldingAction { } @editorAction +// @ts-ignore @editorAction uses the class class FoldAllAction extends FoldingAction { constructor() { @@ -519,6 +524,7 @@ class FoldAllAction extends FoldingAction { } @editorAction +// @ts-ignore @editorAction uses the class class UnfoldAllAction extends FoldingAction { constructor() { diff --git a/src/vs/editor/contrib/format/browser/formatActions.ts b/src/vs/editor/contrib/format/browser/formatActions.ts index 73fec82fbe7..17df91fbcee 100644 --- a/src/vs/editor/contrib/format/browser/formatActions.ts +++ b/src/vs/editor/contrib/format/browser/formatActions.ts @@ -54,6 +54,7 @@ function alertFormattingEdits(edits: editorCommon.ISingleEditOperation[]): void } @commonEditorContribution +// @ts-ignore @editorAction uses the class class FormatOnType implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.autoFormat'; @@ -180,6 +181,7 @@ class FormatOnType implements editorCommon.IEditorContribution { } @commonEditorContribution +// @ts-ignore @editorAction uses the class class FormatOnPaste implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.formatOnPaste'; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts index bb47505032e..872ce48705f 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts @@ -27,6 +27,7 @@ import { DefinitionAction, DefinitionActionConfig } from './goToDeclarationComma import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDeclaration/browser/clickLinkGesture'; @editorContribution +// @ts-ignore @editorAction uses the class class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.gotodefinitionwithmouse'; diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index 8b6111b2c13..24a5d2dd690 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -504,6 +504,7 @@ class MarkerController implements editorCommon.IEditorContribution { } @editorAction +// @ts-ignore @editorAction uses the class class NextMarkerAction extends MarkerNavigationAction { constructor() { super(true, { @@ -520,6 +521,7 @@ class NextMarkerAction extends MarkerNavigationAction { } @editorAction +// @ts-ignore @editorAction uses the class class PrevMarkerAction extends MarkerNavigationAction { constructor() { super(false, { diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 179eb9d2973..b7854831ac9 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -170,6 +170,7 @@ export class ModesHoverController implements editorCommon.IEditorContribution { } @editorAction +// @ts-ignore @editorAction uses the class class ShowHoverAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts index 3e9084e361a..b25fc4caa2e 100644 --- a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts @@ -34,6 +34,7 @@ class InPlaceReplaceController implements IEditorContribution { }); private editor: ICommonCodeEditor; + // @ts-ignore unused property private requestIdPool: number; private currentRequest: TPromise; private decorationRemover: TPromise; @@ -141,6 +142,7 @@ class InPlaceReplaceController implements IEditorContribution { } @editorAction +// @ts-ignore @editorAction uses the class class InPlaceReplaceUp extends EditorAction { constructor() { @@ -166,6 +168,7 @@ class InPlaceReplaceUp extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class InPlaceReplaceDown extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/indentation/common/indentation.ts b/src/vs/editor/contrib/indentation/common/indentation.ts index 41fb47db826..5530c97ef8e 100644 --- a/src/vs/editor/contrib/indentation/common/indentation.ts +++ b/src/vs/editor/contrib/indentation/common/indentation.ts @@ -333,6 +333,7 @@ export class ReindentLinesAction extends EditorAction { export class AutoIndentOnPasteCommand implements ICommand { private _edits: TextEdit[]; + // @ts-ignore @editorAction unused property private _newEol: EndOfLineSequence; private _initialSelection: Selection; diff --git a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts index 2a81b32df9c..05eeac34347 100644 --- a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts @@ -49,6 +49,7 @@ abstract class AbstractCopyLinesAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class CopyLinesUpAction extends AbstractCopyLinesAction { constructor() { super(false, { @@ -66,6 +67,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction { } @editorAction +// @ts-ignore @editorAction uses the class class CopyLinesDownAction extends AbstractCopyLinesAction { constructor() { super(true, { @@ -110,6 +112,7 @@ abstract class AbstractMoveLinesAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class MoveLinesUpAction extends AbstractMoveLinesAction { constructor() { super(false, { @@ -127,6 +130,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction { } @editorAction +// @ts-ignore @editorAction uses the class class MoveLinesDownAction extends AbstractMoveLinesAction { constructor() { super(true, { @@ -166,6 +170,7 @@ abstract class AbstractSortLinesAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class SortLinesAscendingAction extends AbstractSortLinesAction { constructor() { super(false, { @@ -178,6 +183,7 @@ class SortLinesAscendingAction extends AbstractSortLinesAction { } @editorAction +// @ts-ignore @editorAction uses the class class SortLinesDescendingAction extends AbstractSortLinesAction { constructor() { super(true, { @@ -276,6 +282,7 @@ abstract class AbstractRemoveLinesAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class DeleteLinesAction extends AbstractRemoveLinesAction { constructor() { @@ -329,6 +336,7 @@ export class IndentLinesAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class OutdentLinesAction extends EditorAction { constructor() { super({ diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index 4c6eceb7ff6..cf74afa28ef 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -148,6 +148,7 @@ class LinkDetector implements editorCommon.IEditorContribution { private activeLinkDecorationId: string; private openerService: IOpenerService; private messageService: IMessageService; + // @ts-ignore unused injected service private editorWorkerService: IEditorWorkerService; private currentOccurrences: { [decorationId: string]: LinkOccurrence; }; @@ -389,6 +390,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } @editorAction +// @ts-ignore @editorAction uses the class class OpenLinkAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/multicursor/common/multicursor.ts b/src/vs/editor/contrib/multicursor/common/multicursor.ts index f43996b53b7..f044ba0f0cf 100644 --- a/src/vs/editor/contrib/multicursor/common/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/common/multicursor.ts @@ -105,6 +105,7 @@ export class InsertCursorBelow extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class InsertCursorAtEndOfEachLineSelected extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts index 47b9d0f2f0b..eb7f99d771c 100644 --- a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts @@ -164,6 +164,7 @@ abstract class AbstractSmartSelect extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class GrowSelectionAction extends AbstractSmartSelect { constructor() { super(true, { @@ -181,6 +182,7 @@ class GrowSelectionAction extends AbstractSmartSelect { } @editorAction +// @ts-ignore @editorAction uses the class class ShrinkSelectionAction extends AbstractSmartSelect { constructor() { super(false, { diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 67874ded11c..31bed3940dd 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -207,6 +207,7 @@ class SuggestionDetails { private widget: SuggestWidget, private editor: ICodeEditor, private markdownRenderer: MarkdownRenderer, + // @ts-ignore unused property private triggerKeybindingLabel: string ) { this.disposables = []; diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index 7f563dc6e31..2017bae8de2 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -491,6 +491,7 @@ class WordHighlightNavigationAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class NextWordHighlightAction extends WordHighlightNavigationAction { constructor() { super(true, { @@ -507,6 +508,7 @@ class NextWordHighlightAction extends WordHighlightNavigationAction { } @editorAction +// @ts-ignore @editorAction uses the class class PrevWordHighlightAction extends WordHighlightNavigationAction { constructor() { super(false, { diff --git a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts index b60bdaf2f80..c35a8d0a5b6 100644 --- a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts +++ b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts @@ -335,6 +335,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { } @editorAction +// @ts-ignore @editorAction uses the class class ShowAccessibilityHelpAction extends EditorAction { constructor() { super({ diff --git a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index cbcd2a853d2..4b1ef0da9ec 100644 --- a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -83,6 +83,7 @@ class InspectTokensController extends Disposable implements IEditorContribution } @editorAction +// @ts-ignore @editorAction uses the class class InspectTokens extends EditorAction { constructor() { @@ -169,6 +170,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget { public allowEditorOverflow = true; private _editor: ICodeEditor; + // @ts-ignore unused injected service private _standaloneThemeService: IStandaloneThemeService; private _modeService: IModeService; private _tokenizationSupport: ITokenizationSupport; diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 7ff286ade85..9e3e05dc781 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -306,6 +306,8 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon export class StandaloneDiffEditor extends DiffEditorWidget implements IStandaloneDiffEditor { private _contextViewService: IEditorContextViewService; + + // @ts-ignore unused injected service private _standaloneKeybindingService: StandaloneKeybindingService; constructor( diff --git a/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts index 17197a6f7d3..3b48b9eab9e 100644 --- a/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts +++ b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts @@ -10,6 +10,7 @@ import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/e import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; @editorAction +// @ts-ignore @editorAction uses the class class ToggleHighContrast extends EditorAction { private _originalThemeName: string; diff --git a/src/vs/editor/test/browser/controller/imeTester.ts b/src/vs/editor/test/browser/controller/imeTester.ts index ef3fb620995..6d80c9f7d5f 100644 --- a/src/vs/editor/test/browser/controller/imeTester.ts +++ b/src/vs/editor/test/browser/controller/imeTester.ts @@ -17,6 +17,7 @@ import * as browser from 'vs/base/browser/browser'; class SingleLineTestModel implements ISimpleModel { private _line: string; + // @ts-ignore unused property private _eol: string; constructor(line: string) { diff --git a/src/vs/editor/test/browser/controller/textAreaState.test.ts b/src/vs/editor/test/browser/controller/textAreaState.test.ts index ed247b98709..f63f52aadc3 100644 --- a/src/vs/editor/test/browser/controller/textAreaState.test.ts +++ b/src/vs/editor/test/browser/controller/textAreaState.test.ts @@ -588,6 +588,7 @@ suite('TextAreaState', () => { }); }); +// @ts-ignore unused class class SimpleModel implements ISimpleModel { private _lines: string[]; diff --git a/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts b/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts index 20bbda92be7..290e750f645 100644 --- a/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts +++ b/src/vs/editor/test/common/viewModel/viewModelDecorations.test.ts @@ -25,21 +25,8 @@ suite('ViewModelDecorations', () => { assert.equal(viewModel.getLineContent(4), 'will be '); assert.equal(viewModel.getLineContent(5), 'wrapped'); - let dec1: string; - let dec2: string; - let dec3: string; - let dec4: string; - let dec5: string; - let dec6: string; - let dec7: string; - let dec8: string; - let dec9: string; - let dec10: string; - let dec11: string; - let dec12: string; - let dec13: string; - let dec14: string; - let dec15: string; + //@ts-ignore + let dec1, dec2, dec3, dec4, dec5, dec6, dec7, dec8, dec9, dec10, dec11, dec12, dec13, dec14, dec15: string; model.changeDecorations((accessor) => { let createOpts = (id: string) => { return { @@ -280,6 +267,7 @@ suite('ViewModelDecorations', () => { assert.equal(viewModel.getLineContent(4), 'will be '); assert.equal(viewModel.getLineContent(5), 'wrapped'); + // @ts-ignore unused local let dec1: string; model.changeDecorations((accessor) => { dec1 = accessor.addDecoration( diff --git a/src/vs/platform/actions/common/menu.ts b/src/vs/platform/actions/common/menu.ts index 1ea2c643b7f..6d0273668c0 100644 --- a/src/vs/platform/actions/common/menu.ts +++ b/src/vs/platform/actions/common/menu.ts @@ -21,6 +21,7 @@ export class Menu implements IMenu { private _onDidChange = new Emitter(); constructor( + // @ts-ignore unused property private _id: MenuId, startupSignal: TPromise, @ICommandService private _commandService: ICommandService, diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index 9ea43c880e6..0c23b2c208d 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -29,6 +29,7 @@ export class BackupMainService implements IBackupMainService { @IEnvironmentService environmentService: IEnvironmentService, @IConfigurationService private configurationService: IConfigurationService, @ILogService private logService: ILogService, + // @ts-ignore unused injected service @IWorkspacesMainService private workspacesService: IWorkspacesMainService ) { this.backupHome = environmentService.backupHome; diff --git a/src/vs/platform/commands/test/commandService.test.ts b/src/vs/platform/commands/test/commandService.test.ts index c4f39187914..2cc8f0ce2af 100644 --- a/src/vs/platform/commands/test/commandService.test.ts +++ b/src/vs/platform/commands/test/commandService.test.ts @@ -95,6 +95,7 @@ suite('CommandService', function () { let callCounter = 0; let reg = CommandsRegistry.registerCommand('bar', () => callCounter += 1); + // @ts-ignore unused local let resolve: Function; let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService { onReady() { diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index 1b58dec25db..6eff3d729e9 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -55,6 +55,7 @@ export class ConfigurationModel implements IConfigurationModel { addToValueTree(override.contents, key, value, e => { throw new Error(e); }); } + // @ts-ignore unused generic parameter public override(identifier: string): ConfigurationModel { const overrideContents = this.getContentsForOverrideIdentifer(identifier); @@ -385,6 +386,7 @@ export class Configuration { }); } + // @ts-ignore unused generic parameter private getConsolidateConfigurationModel(overrides: IConfigurationOverrides, workspace: Workspace): ConfigurationModel { let configurationModel = this.getConsolidatedConfigurationModelForResource(overrides, workspace); return overrides.overrideIdentifier ? configurationModel.override(overrides.overrideIdentifier) : configurationModel; diff --git a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts index 2ea8728e026..4db312fd0a1 100644 --- a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts +++ b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts @@ -29,6 +29,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService { @IStorageService private storageService: IStorageService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IEnvironmentService private environmentService: IEnvironmentService, + // @ts-ignore unused injected service @IExtensionManagementService private extensionManagementService: IExtensionManagementService ) { extensionManagementService.onDidUninstallExtension(this.onDidUninstallExtension, this, this.disposables); diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 013d6ecdff0..d219de90a51 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -292,6 +292,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { @IRequestService private requestService: IRequestService, @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IConfigurationService private configurationService: IConfigurationService ) { const config = product.extensionsGallery; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 687d47ab967..837dd1497b7 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -101,6 +101,7 @@ export class ExtensionManagementService implements IExtensionManagementService { onDidUninstallExtension: Event = this._onDidUninstallExtension.event; constructor( + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @IChoiceService private choiceService: IChoiceService, @IExtensionGalleryService private galleryService: IExtensionGalleryService diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index fd3adf8e44e..e27300b9302 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -62,6 +62,7 @@ export class InstantiationService implements IInstantiationService { } } + // @ts-ignore unused generic parameter createInstance(param: any, ...rest: any[]): any { if (param instanceof SyncDescriptor) { diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index 440d84448e1..c09fb7e714b 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -73,6 +73,7 @@ export class TestInstantiationService extends InstantiationService { public stubPromise(service?: ServiceIdentifier, fnProperty?: string, value?: any): T | sinon.SinonStub; public stubPromise(service?: ServiceIdentifier, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub; public stubPromise(service?: ServiceIdentifier, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub; + // @ts-ignore unused generic parameter public stubPromise(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub { arg3 = typeof arg2 === 'string' ? TPromise.as(arg3) : arg3; arg4 = typeof arg2 !== 'string' && typeof arg3 === 'string' ? TPromise.as(arg4) : arg4; @@ -87,6 +88,7 @@ export class TestInstantiationService extends InstantiationService { private _create(serviceMock: IServiceMock, options: SinonOptions, reset?: boolean): any; private _create(ctor: any, options: SinonOptions): any; + // @ts-ignore unused generic parameter private _create(arg1: any, options: SinonOptions, reset: boolean = false): any { if (this.isServiceMock(arg1)) { let service = this._getOrCreateService(arg1, options, reset); diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index a050b92656c..62a40264836 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -14,6 +14,7 @@ import { OS } from 'vs/base/common/platform'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; class MockKeybindingContextKey implements IContextKey { + // @ts-ignore unused property private _key: string; private _defaultValue: T; private _value: T; diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 592396b8e50..50dc285444f 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -94,6 +94,7 @@ export class LifecycleService implements ILifecycleService { onBeforeWindowUnload: Event = this._onBeforeWindowUnload.event; constructor( + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @ILogService private logService: ILogService, @IStorageService private storageService: IStorageService diff --git a/src/vs/workbench/api/electron-browser/mainThreadCredentials.ts b/src/vs/workbench/api/electron-browser/mainThreadCredentials.ts index bc0a15a0496..fc728e9f5df 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadCredentials.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadCredentials.ts @@ -11,6 +11,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC @extHostNamedCustomer(MainContext.MainThreadCredentials) export class MainThreadCredentials implements MainThreadCredentialsShape { + // @ts-ignore unused property private _proxy: ExtHostCredentialsShape; constructor( diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts index d0fcfb8b158..cca68b1a3fd 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts @@ -66,6 +66,7 @@ export class BoundModelReferenceCollection { export class MainThreadDocuments implements MainThreadDocumentsShape { private _modelService: IModelService; + // @ts-ignore unused injected service private _modeService: IModeService; private _textModelResolverService: ITextModelService; private _textFileService: ITextFileService; diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts index d538ccaefae..654667ed7fe 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts @@ -69,6 +69,7 @@ export class HeapService implements IHeapService { trackRecursive(p: TPromise): TPromise; trackRecursive(obj: T): T; + // @ts-ignore unused generic parameter trackRecursive(obj: any): any { if (TPromise.is(obj)) { return obj.then(result => this.trackRecursive(result)); diff --git a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts index 9bf93689c11..ee1e1909e21 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts @@ -18,6 +18,7 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape { constructor( extHostContext: IExtHostContext, + // @ts-ignore unused injected service @IExtensionService private readonly _extensionService: IExtensionService, @IMessageService private readonly _messageService: IMessageService, @IChoiceService private readonly _choiceService: IChoiceService diff --git a/src/vs/workbench/api/electron-browser/mainThreadSCM.ts b/src/vs/workbench/api/electron-browser/mainThreadSCM.ts index e90753d4ce3..928279007a2 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSCM.ts @@ -121,6 +121,7 @@ class MainThreadSCMProvider implements ISCMProvider { private _label: string, private _rootUri: URI | undefined, @ISCMService scmService: ISCMService, + // @ts-ignore unused injected service @ICommandService private commandService: ICommandService ) { } @@ -256,6 +257,7 @@ export class MainThreadSCM implements MainThreadSCMShape { constructor( extHostContext: IExtHostContext, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService, @ISCMService private scmService: ISCMService, @ICommandService private commandService: ICommandService diff --git a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts index ad86c4e3abb..553016983c3 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts @@ -103,6 +103,7 @@ class TreeViewDataProvider implements ITreeViewDataProvider { this._onDispose.fire(); } + // @ts-ignore unused property private clearChildren(treeItemHandle: TreeItemHandle): void { const children = this.childrenMap.get(treeItemHandle); if (children) { @@ -132,6 +133,7 @@ class TreeViewDataProvider implements ITreeViewDataProvider { } } + // @ts-ignore unused property private populateElementsToExpand(elements: ITreeItem[], toExpand: ITreeItem[]) { for (const element of elements) { if (element.collapsibleState === TreeItemCollapsibleState.Expanded) { diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index c9ab705aacf..a641a38c87e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -31,7 +31,9 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @ITextFileService private readonly _textFileService: ITextFileService, @IConfigurationService private _configurationService: IConfigurationService, + // @ts-ignore unused injected service @IFileService private readonly _fileService: IFileService, + // @ts-ignore unused injected service @IWorkspaceEditingService private _workspaceEditingService: IWorkspaceEditingService ) { this._proxy = extHostContext.get(ExtHostContext.ExtHostWorkspace); diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index fb2762dcc0b..eb450597c93 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -142,6 +142,7 @@ export function createApiFactory( // namespace: commands const commands: typeof vscode.commands = { + // @ts-ignore unused generic parameter registerCommand(id: string, command: (...args: any[]) => T | Thenable, thisArgs?: any): vscode.Disposable { return extHostCommands.registerCommand(id, command, thisArgs); }, diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 3b5bb8f8b44..4e21bd1f4b6 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -707,8 +707,10 @@ class LinkProviderAdapter { class ColorProviderAdapter { constructor( + // @ts-ignore unused property private _proxy: MainThreadLanguageFeaturesShape, private _documents: ExtHostDocuments, + // @ts-ignore unused property private _colorFormatCache: Map, private _provider: vscode.DocumentColorProvider ) { } diff --git a/src/vs/workbench/api/node/extHostMessageService.ts b/src/vs/workbench/api/node/extHostMessageService.ts index 5a4e176f26d..642eca76c0f 100644 --- a/src/vs/workbench/api/node/extHostMessageService.ts +++ b/src/vs/workbench/api/node/extHostMessageService.ts @@ -10,6 +10,7 @@ import { MainContext, MainThreadMessageServiceShape, MainThreadMessageOptions, I import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +// @ts-ignore unused generic parameter function isMessageItem(item: any): item is vscode.MessageItem { return item && item.title; } diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 993a4011fed..84d12774752 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -19,6 +19,8 @@ import * as types from 'vs/workbench/api/node/extHostTypes'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import * as vscode from 'vscode'; + +// @ts-ignore unused type interface StringMap { [key: string]: V; } diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index 616ce83c24c..126fd66d08c 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -1131,6 +1131,7 @@ export enum TaskPanelKind { export class TaskGroup implements vscode.TaskGroup { private _id: string; + // @ts-ignore unused property private _label: string; public static Clean: TaskGroup = new TaskGroup('clean', 'Clean'); diff --git a/src/vs/workbench/browser/actions/workspaceActions.ts b/src/vs/workbench/browser/actions/workspaceActions.ts index 66c115330a4..3c394c6ff8f 100644 --- a/src/vs/workbench/browser/actions/workspaceActions.ts +++ b/src/vs/workbench/browser/actions/workspaceActions.ts @@ -204,6 +204,7 @@ export class AddRootFolderAction extends BaseWorkspacesAction { @IWindowService windowService: IWindowService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IEnvironmentService environmentService: IEnvironmentService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IViewletService private viewletService: IViewletService, diff --git a/src/vs/workbench/browser/part.ts b/src/vs/workbench/browser/part.ts index 71e32226b2a..edecfa020ee 100644 --- a/src/vs/workbench/browser/part.ts +++ b/src/vs/workbench/browser/part.ts @@ -111,6 +111,7 @@ const TITLE_HEIGHT = 35; export class PartLayout { + // @ts-ignore unused property constructor(private container: Builder, private options: IPartOptions, private titleArea: Builder, private contentArea: Builder) { } diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 32771c179fd..c75fb219d65 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -54,7 +54,9 @@ export class ActivitybarPart extends Part { constructor( id: string, @IViewletService private viewletService: IViewletService, + // @ts-ignore unused injected service @IExtensionService private extensionService: IExtensionService, + // @ts-ignore unused injected service @IStorageService private storageService: IStorageService, @IContextMenuService private contextMenuService: IContextMenuService, @IInstantiationService private instantiationService: IInstantiationService, diff --git a/src/vs/workbench/browser/parts/compositebar/compositeBarActions.ts b/src/vs/workbench/browser/parts/compositebar/compositeBarActions.ts index 94db53d020d..aa36133c7ba 100644 --- a/src/vs/workbench/browser/parts/compositebar/compositeBarActions.ts +++ b/src/vs/workbench/browser/parts/compositebar/compositeBarActions.ts @@ -291,7 +291,9 @@ export class CompositeOverflowActivityAction extends ActivityAction { } export class CompositeOverflowActivityActionItem extends ActivityActionItem { + // @ts-ignore unused property private name: string; + // @ts-ignore unused property private cssClass: string; private actions: Action[]; @@ -302,6 +304,7 @@ export class CompositeOverflowActivityActionItem extends ActivityActionItem { private getBadge: (compositeId: string) => IBadge, private getCompositeOpenAction: (compositeId: string) => Action, colors: ICompositeBarColors, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService, @IContextMenuService private contextMenuService: IContextMenuService, @IThemeService themeService: IThemeService diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index aff43d76e7b..dd3cce2d126 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -113,6 +113,7 @@ export class JoinTwoGroupsAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorGroupService: IEditorGroupService ) { diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index fe160365da8..188ae01b8f4 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -91,6 +91,7 @@ export abstract class BaseEditorPicker extends QuickOpenHandler { constructor( @IInstantiationService protected instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkbenchEditorService protected editorService: IWorkbenchEditorService, @IEditorGroupService protected editorGroupService: IEditorGroupService diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 6f3ef39d9fb..227c1aa57d7 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -795,6 +795,7 @@ export class ChangeModeAction extends Action { @IQuickOpenService private quickOpenService: IQuickOpenService, @IPreferencesService private preferencesService: IPreferencesService, @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @ICommandService private commandService: ICommandService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService ) { diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 13522be113f..9ef9310354f 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -32,6 +32,7 @@ import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; const TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY = 'textEditorViewState'; +// @ts-ignore unused type interface ITextEditorViewState { 0?: IEditorViewState; 1?: IEditorViewState; @@ -60,6 +61,7 @@ export abstract class BaseTextEditor extends BaseEditor { @IStorageService private storageService: IStorageService, @ITextResourceConfigurationService private _configurationService: ITextResourceConfigurationService, @IThemeService protected themeService: IThemeService, + // @ts-ignore unused injected service @IModeService private modeService: IModeService, @ITextFileService private _textFileService: ITextFileService, @IEditorGroupService protected editorGroupService: IEditorGroupService diff --git a/src/vs/workbench/browser/parts/editor/webviewEditor.ts b/src/vs/workbench/browser/parts/editor/webviewEditor.ts index d31c6b57bd3..fdc9f2fa59a 100644 --- a/src/vs/workbench/browser/parts/editor/webviewEditor.ts +++ b/src/vs/workbench/browser/parts/editor/webviewEditor.ts @@ -14,6 +14,7 @@ export interface HtmlPreviewEditorViewState { scrollYPercentage: number; } +// @ts-ignore unused type interface HtmlPreviewEditorViewStates { 0?: HtmlPreviewEditorViewState; 1?: HtmlPreviewEditorViewState; diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index 1412c3cc68d..69b64066d51 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -98,6 +98,7 @@ export class QuickOpenController extends Component implements IQuickOpenService private promisesToCompleteOnHide: ValueCallback[]; private previousActiveHandlerDescriptor: QuickOpenHandlerDescriptor; private actionProvider = new ContributableActionProvider(); + // @ts-ignore unused property private previousValue = ''; private visibilityChangeTimeoutHandle: number; private closeOnFocusLost: boolean; @@ -107,9 +108,11 @@ export class QuickOpenController extends Component implements IQuickOpenService @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IMessageService private messageService: IMessageService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, + // @ts-ignore unused injected service @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService, @IPartService private partService: IPartService, @@ -1176,6 +1179,7 @@ class EditorHistoryHandler { constructor( @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IFileService private fileService: IFileService ) { @@ -1265,6 +1269,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { @IWorkspaceContextService contextService: IWorkspaceContextService, @IConfigurationService private configurationService: IConfigurationService, @IEnvironmentService environmentService: IEnvironmentService, + // @ts-ignore unused injected service @IFileService private fileService: IFileService ) { super(editorService); diff --git a/src/vs/workbench/browser/parts/views/treeView.ts b/src/vs/workbench/browser/parts/views/treeView.ts index cf1490e2597..b4d452928aa 100644 --- a/src/vs/workbench/browser/parts/views/treeView.ts +++ b/src/vs/workbench/browser/parts/views/treeView.ts @@ -41,6 +41,7 @@ export class TreeView extends ViewsViewletPanel { private dataProviderElementChangeListener: IDisposable; constructor( + // @ts-ignore unused property private options: IViewletViewOptions, @IMessageService private messageService: IMessageService, @IKeybindingService keybindingService: IKeybindingService, diff --git a/src/vs/workbench/browser/parts/views/viewsRegistry.ts b/src/vs/workbench/browser/parts/views/viewsRegistry.ts index e39b999ec43..411f4181f60 100644 --- a/src/vs/workbench/browser/parts/views/viewsRegistry.ts +++ b/src/vs/workbench/browser/parts/views/viewsRegistry.ts @@ -122,6 +122,7 @@ export const ViewsRegistry: IViewsRegistry = new class { this._onViewsDeregistered.fire(viewsToDeregister); } + // @ts-ignore unused generic parameter registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { if (!this.isDataProviderRegistered(id)) { // TODO: throw error diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 8c7cf7bea1e..9b817365a28 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -323,6 +323,7 @@ export interface ICommand { icon?: string; } +// @ts-ignore unused type class CommandEntry extends QuickOpenEntry { constructor(private quickOpenService: IQuickOpenService, private prefix: string, private command: ICommand, highlights: IHighlight[]) { diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 780ce0463c2..09829d7922c 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -156,6 +156,7 @@ export class ToggleMenuBarAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, @IConfigurationService private configurationService: IConfigurationService ) { @@ -341,6 +342,7 @@ export class ShowStartupPerformance extends Action { console.log(`Empty Workspace: ${metrics.emptyWorkbench}`); let nodeModuleLoadTime: number; + // @ts-ignore unused local let nodeModuleLoadDetails: any[]; if (this.environmentService.performance) { const nodeModuleTimes = this.analyzeNodeModulesLoadTimes(); diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index 84f5d2302b9..a978e2e1651 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -86,12 +86,15 @@ export class ElectronWindow extends Themable { @IViewletService private viewletService: IViewletService, @IContextMenuService private contextMenuService: IContextMenuService, @IKeybindingService private keybindingService: IKeybindingService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IFileService private fileService: IFileService, @IMenuService private menuService: IMenuService, + // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService ) { super(themeService); diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index c91957498d4..f007c0aec79 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -224,6 +224,7 @@ export class Workbench implements IPartService { @IStorageService private storageService: IStorageService, @IMessageService private messageService: IMessageService, @IConfigurationService private configurationService: WorkspaceService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IEnvironmentService private environmentService: IEnvironmentService, @IWindowService private windowService: IWindowService diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts index 5decaa73b37..59570f7a220 100644 --- a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts +++ b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts @@ -18,6 +18,7 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IEditorService } from 'vs/platform/editor/common/editor'; import product from 'vs/platform/node/product'; +// @ts-ignore unused type interface ILegacyUse { file: string; lineNumber: number; @@ -43,6 +44,7 @@ class InstallAction extends Action { id: string, label: string, @IMessageService private messageService: IMessageService, + // @ts-ignore unused injected service @IEditorService private editorService: IEditorService ) { super(id, label); diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts index aaf8113fe70..6df4199bc2a 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts @@ -278,6 +278,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { } @editorAction +// @ts-ignore @editorAction uses the class class ShowAccessibilityHelpAction extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts b/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts index a37c93ea70f..983302f0396 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts @@ -13,6 +13,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { IUntitledResourceInput } from 'vs/platform/editor/common/editor'; @editorAction +// @ts-ignore @editorAction uses the class class InspectKeyMap extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts index e28e657d8d7..27065a87ebb 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts @@ -102,6 +102,7 @@ class InspectTMScopesController extends Disposable implements IEditorContributio } @editorAction +// @ts-ignore @editorAction uses the class class InspectTMScopes extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index 1b8da02242b..7065e678a6d 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -131,6 +131,7 @@ function applyWordWrapState(editor: ICommonCodeEditor, state: IWordWrapState): v } @editorAction +// @ts-ignore @editorAction uses the class class ToggleWordWrapAction extends EditorAction { constructor() { @@ -175,6 +176,7 @@ class ToggleWordWrapAction extends EditorAction { } @commonEditorContribution +// @ts-ignore @editorAction uses the class class ToggleWordWrapController extends Disposable implements IEditorContribution { private static _ID = 'editor.contrib.toggleWordWrapController'; diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts b/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts index e2e99c99949..641f87730cc 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts @@ -55,6 +55,7 @@ class WordWrapMigrationStorage { } @editorContribution +// @ts-ignore @editorAction uses the class class WordWrapMigrationController extends Disposable implements IEditorContribution { private static ID = 'editor.contrib.wordWrapMigrationController'; diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index dbe837021a9..10b38d0a753 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -77,6 +77,7 @@ export class ConfigureAction extends AbstractDebugAction { constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMessageService private messageService: IMessageService ) { diff --git a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts index 44289a6b188..14c6c3ef0f3 100644 --- a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts @@ -16,6 +16,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @editorAction +// @ts-ignore @editorAction uses the class class ToggleBreakpointAction extends EditorAction { constructor() { super({ @@ -68,6 +69,7 @@ function addColumnBreakpoint(accessor: ServicesAccessor, editor: ICommonCodeEdit } @editorAction +// @ts-ignore @editorAction uses the class class ToggleColumnBreakpointAction extends EditorAction { constructor() { super({ @@ -89,6 +91,7 @@ class ToggleColumnBreakpointAction extends EditorAction { // TODO@Isidor merge two column breakpoints actions together @editorAction +// @ts-ignore @editorAction uses the class class ToggleColumnBreakpointContextMenuAction extends EditorAction { constructor() { super({ @@ -109,6 +112,7 @@ class ToggleColumnBreakpointContextMenuAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class ConditionalBreakpointAction extends EditorAction { constructor() { @@ -132,6 +136,7 @@ class ConditionalBreakpointAction extends EditorAction { @editorAction +// @ts-ignore @editorAction uses the class class RunToCursorAction extends EditorAction { constructor() { @@ -175,6 +180,7 @@ class RunToCursorAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class SelectionToReplAction extends EditorAction { constructor() { @@ -202,6 +208,7 @@ class SelectionToReplAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class SelectionToWatchExpressionsAction extends EditorAction { constructor() { @@ -227,6 +234,7 @@ class SelectionToWatchExpressionsAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class ShowDebugHoverAction extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/debug/browser/debugQuickOpen.ts b/src/vs/workbench/parts/debug/browser/debugQuickOpen.ts index 5ce5e8bb14b..b85b020bf9b 100644 --- a/src/vs/workbench/parts/debug/browser/debugQuickOpen.ts +++ b/src/vs/workbench/parts/debug/browser/debugQuickOpen.ts @@ -80,6 +80,7 @@ export class DebugQuickOpenHandler extends Quickopen.QuickOpenHandler { private autoFocusIndex: number; constructor( + // @ts-ignore unused injected service @IQuickOpenService private quickOpenService: IQuickOpenService, @IDebugService private debugService: IDebugService, @IWorkspaceContextService private contextService: IWorkspaceContextService, diff --git a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts index cbb4c4e8bd9..e69433687b7 100644 --- a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts +++ b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts @@ -27,8 +27,11 @@ export class ExceptionWidget extends ZoneWidget { private _backgroundColor: Color; + // @ts-ignore unused property constructor(editor: ICodeEditor, private exceptionInfo: IExceptionInfo, private lineNumber: number, + // @ts-ignore unused injected service @IContextViewService private contextViewService: IContextViewService, + // @ts-ignore unused injected service @IDebugService private debugService: IDebugService, @IThemeService themeService: IThemeService, @IInstantiationService private instantiationService: IInstantiationService diff --git a/src/vs/workbench/parts/debug/browser/linkDetector.ts b/src/vs/workbench/parts/debug/browser/linkDetector.ts index ac31e70c14a..246c70b41f0 100644 --- a/src/vs/workbench/parts/debug/browser/linkDetector.ts +++ b/src/vs/workbench/parts/debug/browser/linkDetector.ts @@ -24,6 +24,7 @@ export class LinkDetector { constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService ) { // noop diff --git a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index 3a1bc568bd4..568ece14e38 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -217,11 +217,14 @@ export class ConfigurationManager implements IConfigurationManager { constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService, + // @ts-ignore unused injected service @IFileService private fileService: IFileService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationService private configurationService: IConfigurationService, @IQuickOpenService private quickOpenService: IQuickOpenService, + // @ts-ignore unused injected service @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService, @IInstantiationService private instantiationService: IInstantiationService, @ICommandService private commandService: ICommandService, diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index dd792db112a..f8d476f7ca2 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -60,6 +60,7 @@ const DEBUG_FUNCTION_BREAKPOINTS_KEY = 'debug.functionbreakpoint'; const DEBUG_EXCEPTION_BREAKPOINTS_KEY = 'debug.exceptionbreakpoint'; const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions'; +// @ts-ignore unused type interface StartSessionResult { status: 'ok' | 'initialConfiguration' | 'saveConfiguration'; content?: string; @@ -94,6 +95,7 @@ export class DebugService implements debug.IDebugService { @IPanelService private panelService: IPanelService, @IMessageService private messageService: IMessageService, @IPartService private partService: IPartService, + // @ts-ignore unused injected service @IWindowsService private windowsService: IWindowsService, @IWindowService private windowService: IWindowService, @IBroadcastService private broadcastService: IBroadcastService, @@ -107,6 +109,7 @@ export class DebugService implements debug.IDebugService { @ITaskService private taskService: ITaskService, @IFileService private fileService: IFileService, @IConfigurationService private configurationService: IConfigurationService, + // @ts-ignore unused injected service @ICommandService private commandService: ICommandService ) { this.toDispose = []; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index 88994468dc2..43abfd9ca01 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -310,6 +310,7 @@ export class CallStackController extends BaseDebugController { export class CallStackActionProvider implements IActionProvider { + // @ts-ignore unused injected service constructor( @IInstantiationService private instantiationService: IInstantiationService, @debug.IDebugService private debugService: debug.IDebugService) { // noop } @@ -885,10 +886,12 @@ export class WatchExpressionsRenderer implements IRenderer { private static WATCH_EXPRESSION_TEMPLATE_ID = 'watchExpression'; private static VARIABLE_TEMPLATE_ID = 'variables'; private toDispose: lifecycle.IDisposable[]; + // @ts-ignore unused property private actionProvider: WatchExpressionsActionProvider; constructor( actionProvider: IActionProvider, + // @ts-ignore unused property private actionRunner: IActionRunner, @debug.IDebugService private debugService: debug.IDebugService, @IContextViewService private contextViewService: IContextViewService, @@ -1132,7 +1135,9 @@ export class BreakpointsRenderer implements IRenderer { private static BREAKPOINT_TEMPLATE_ID = 'breakpoint'; constructor( + // @ts-ignore unused property private actionProvider: BreakpointsActionProvider, + // @ts-ignore unused property private actionRunner: IActionRunner, @IWorkspaceContextService private contextService: IWorkspaceContextService, @debug.IDebugService private debugService: debug.IDebugService, diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts index e5c982d17cd..62f77354324 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts @@ -50,8 +50,10 @@ export class VariablesView extends ViewsViewletPanel { private expandedElements: any[]; constructor( + // @ts-ignore unused property private options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IDebugService private debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, @@ -162,6 +164,7 @@ export class WatchExpressionsView extends ViewsViewletPanel { private settings: any; constructor( + // @ts-ignore unused property private options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @IDebugService private debugService: IDebugService, @@ -256,6 +259,7 @@ export class CallStackView extends ViewsViewletPanel { constructor( private options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IDebugService private debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, @@ -390,6 +394,7 @@ export class BreakpointsView extends ViewsViewletPanel { private settings: any; constructor( + // @ts-ignore unused property private options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @IDebugService private debugService: IDebugService, diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index a1a9c8250a5..189ce191a23 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -313,6 +313,7 @@ export class Repl extends Panel implements IPrivateReplService { } @editorAction +// @ts-ignore @editorAction uses the class class ReplHistoryPreviousAction extends EditorAction { constructor() { @@ -338,6 +339,7 @@ class ReplHistoryPreviousAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class ReplHistoryNextAction extends EditorAction { constructor() { @@ -363,6 +365,7 @@ class ReplHistoryNextAction extends EditorAction { } @editorAction +// @ts-ignore @editorAction uses the class class AcceptReplInputAction extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index ff2a326182b..24272e989cf 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -22,6 +22,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; export class Adapter { constructor(private rawAdapter: IRawAdapter, public extensionDescription: IExtensionDescription, + // @ts-ignore unused injected service @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService, @IConfigurationService private configurationService: IConfigurationService, @ICommandService private commandService: ICommandService diff --git a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts index a11c3333fe8..289ca1d5e5b 100644 --- a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts +++ b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts @@ -16,6 +16,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; const EMMET_COMMANDS_PREFIX = '>Emmet: '; @editorAction +// @ts-ignore @editorAction uses the class class ShowEmmetCommandsAction extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts index fc9136fce72..02540f66630 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts @@ -12,6 +12,7 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @editorAction +// @ts-ignore @editorAction uses the class class ExpandAbbreviationAction extends EmmetEditorAction { constructor() { diff --git a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts index 9794f7ba135..46259772e70 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts @@ -165,7 +165,9 @@ export class ExtensionEditor extends BaseEditor { private content: HTMLElement; private recommendation: HTMLElement; private header: HTMLElement; + // @ts-ignore unused property private _highlight: ITemplateData; + // @ts-ignore unused property private highlightDisposable: IDisposable; private extensionReadme: Cache; @@ -183,7 +185,9 @@ export class ExtensionEditor extends BaseEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IExtensionGalleryService private galleryService: IExtensionGalleryService, + // @ts-ignore unused injected service @IConfigurationService private configurationService: IConfigurationService, @IInstantiationService private instantiationService: IInstantiationService, @IViewletService private viewletService: IViewletService, @@ -195,6 +199,7 @@ export class ExtensionEditor extends BaseEditor { @IListService private listService: IListService, @IPartService private partService: IPartService, @IContextViewService private contextViewService: IContextViewService, + // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionTipsService private extensionTipsService: IExtensionTipsService ) { @@ -927,6 +932,7 @@ const showCommand = new ShowExtensionEditorFindCommand({ }); KeybindingsRegistry.registerCommandAndKeybindingRule(showCommand.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorContrib())); +// @ts-ignore unused type class HideExtensionEditorFindCommand extends Command { public runCommand(accessor: ServicesAccessor, args: any): void { const extensionEditor = this.getExtensionEditor(accessor); diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index 5092c0cac43..2eefea0dfef 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -111,7 +111,9 @@ export class UninstallAction extends Action { constructor( @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super('extensions.uninstall', UninstallAction.UninstallLabel, UninstallAction.UninstallClass, false); @@ -363,8 +365,10 @@ export class ManageExtensionAction extends Action { set extension(extension: IExtension) { this._extension = extension; this._actionItem.extension = extension; this.update(); } constructor( + // @ts-ignore unused injected service @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, @IInstantiationService private instantiationService: IInstantiationService ) { @@ -427,6 +431,7 @@ export class EnableForWorkspaceAction extends Action implements IExtensionAction @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(EnableForWorkspaceAction.ID, label); @@ -467,6 +472,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction { constructor(label: string, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(EnableGloballyAction.ID, label); @@ -564,6 +570,7 @@ export class DisableForWorkspaceAction extends Action implements IExtensionActio constructor(label: string, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(DisableForWorkspaceAction.ID, label); @@ -603,6 +610,7 @@ export class DisableGloballyAction extends Action implements IExtensionAction { constructor(label: string, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(DisableGloballyAction.ID, label); @@ -802,6 +810,7 @@ export class ReloadAction extends Action { constructor( @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, @IWindowService private windowService: IWindowService, @IExtensionService private extensionService: IExtensionService @@ -911,6 +920,7 @@ export class ShowEnabledExtensionsAction extends Action { id: string, label: string, @IViewletService private viewletService: IViewletService, + // @ts-ignore unused injected service @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label, 'clear-extensions', true); @@ -935,6 +945,7 @@ export class ShowInstalledExtensionsAction extends Action { id: string, label: string, @IViewletService private viewletService: IViewletService, + // @ts-ignore unused injected service @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label, 'clear-extensions', true); @@ -959,6 +970,7 @@ export class ShowDisabledExtensionsAction extends Action { id: string, label: string, @IViewletService private viewletService: IViewletService, + // @ts-ignore unused injected service @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label, 'null', true); @@ -986,6 +998,7 @@ export class ClearExtensionsInputAction extends Action { label: string, onSearchChange: Event, @IViewletService private viewletService: IViewletService, + // @ts-ignore unused injected service @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label, 'clear-extensions', true); @@ -1553,6 +1566,7 @@ export class DisableAllAction extends Action { constructor( id: string = DisableAllAction.ID, label: string = DisableAllAction.LABEL, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService ) { super(id, label); @@ -1585,6 +1599,7 @@ export class DisableAllWorkpsaceAction extends Action { id: string = DisableAllWorkpsaceAction.ID, label: string = DisableAllWorkpsaceAction.LABEL, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + // @ts-ignore unused injected service @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService ) { super(id, label); diff --git a/src/vs/workbench/parts/extensions/browser/extensionsList.ts b/src/vs/workbench/parts/extensions/browser/extensionsList.ts index 29e8d84b673..1fb93a5094f 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsList.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsList.ts @@ -50,6 +50,7 @@ export class Renderer implements IPagedRenderer { constructor( @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IContextMenuService private contextMenuService: IContextMenuService, @IMessageService private messageService: IMessageService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 7387483260a..4846b7c9791 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -85,9 +85,11 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens @IInstantiationService instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorInputService: IEditorGroupService, + // @ts-ignore unused injected service @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionManagementService private extensionManagementService: IExtensionManagementService, @IMessageService private messageService: IMessageService, + // @ts-ignore unused injected service @IViewletService private viewletService: IViewletService, @IThemeService themeService: IThemeService, @IConfigurationService private configurationService: IConfigurationService, diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts index eaad5c72393..05ff1d777bd 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts @@ -58,8 +58,10 @@ export class ExtensionsListView extends ViewsViewletPanel { @IInstantiationService protected instantiationService: IInstantiationService, @IListService private listService: IListService, @IThemeService private themeService: IThemeService, + // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionService private extensionService: IExtensionService, + // @ts-ignore unused injected service @ICommandService private commandService: ICommandService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @@ -67,6 +69,7 @@ export class ExtensionsListView extends ViewsViewletPanel { @IExtensionTipsService private tipsService: IExtensionTipsService, @IModeService private modeService: IModeService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IProgressService private progressService: IProgressService ) { super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService); diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 47dd74d76a5..09840fcfeb8 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -332,6 +332,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { @IChoiceService private choiceService: IChoiceService, @IURLService urlService: IURLService, @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, + // @ts-ignore unused injected service @IExtensionTipsService private tipsService: IExtensionTipsService, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IWindowService private windowService: IWindowService diff --git a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts index 69f877671f9..a87932a839f 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts @@ -30,8 +30,10 @@ class FilesViewerActionContributor extends ActionBarContributor { constructor( @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IKeybindingService private keybindingService: IKeybindingService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService ) { super(); diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index 9ef7fff70e5..4e9c5a2a19d 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -1878,8 +1878,10 @@ export class GlobalRevealInOSAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService ) { super(id, label); @@ -1920,8 +1922,11 @@ export class GlobalCopyPathAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + // @ts-ignore unused injected service @IEditorGroupService private editorGroupService: IEditorGroupService, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, @IInstantiationService private instantiationService: IInstantiationService ) { diff --git a/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts b/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts index 7151d614f6f..c88a5742191 100644 --- a/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts +++ b/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts @@ -21,6 +21,7 @@ export default class FileResultsNavigation extends Disposable { private _openFile: Emitter = new Emitter(); public readonly openFile: Event = this._openFile.event; + // @ts-ignore unused property private throttler: Throttler; constructor(private tree: ITree) { diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index 685f955c969..38eac0fa753 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -111,6 +111,7 @@ interface ISerializedFileInput { class FileEditorInputFactory implements IEditorInputFactory { constructor( + // @ts-ignore unused injected service @ITextResourceConfigurationService private configurationService: ITextResourceConfigurationService ) { } diff --git a/src/vs/workbench/parts/files/browser/views/explorerView.ts b/src/vs/workbench/parts/files/browser/views/explorerView.ts index 169f4134dd0..c756a441c10 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerView.ts @@ -69,6 +69,7 @@ export class ExplorerView extends ViewsViewletPanel { private viewletState: FileViewletState; private explorerRefreshDelayer: ThrottledDelayer; + // @ts-ignore unused property private explorerImportDelayer: ThrottledDelayer; private resourceContext: ResourceContextKey; @@ -100,6 +101,7 @@ export class ExplorerView extends ViewsViewletPanel { @IContextKeyService contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, @IWorkbenchThemeService private themeService: IWorkbenchThemeService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @IDecorationsService decorationService: IDecorationsService ) { diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index a11f8564498..3c37d29c972 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -63,6 +63,7 @@ export class FileDataSource implements IDataSource { @IMessageService private messageService: IMessageService, @IFileService private fileService: IFileService, @IPartService private partService: IPartService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService ) { } @@ -425,8 +426,10 @@ export class FileController extends DefaultController { constructor(state: FileViewletState, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IContextMenuService private contextMenuService: IContextMenuService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMenuService menuService: IMenuService, @IContextKeyService contextKeyService: IContextKeyService @@ -752,6 +755,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { @IBackupFileService private backupFileService: IBackupFileService, @IWindowService private windowService: IWindowService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService ) { super(stat => this.statToResource(stat)); @@ -1031,6 +1035,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // 3.) run the move operation .then(() => { const targetResource = target.resource.with({ path: paths.join(target.resource.path, source.name) }); + // @ts-ignore unused local let didHandleConflict = false; return this.fileService.moveFile(source.resource, targetResource).then(null, error => { diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts index 3209fbc2a2e..dd6ff6045af 100644 --- a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts +++ b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts @@ -10,6 +10,7 @@ import errors = require('vs/base/common/errors'); import URI from 'vs/base/common/uri'; import paths = require('vs/base/common/paths'); import { IEditorViewState, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; +// @ts-ignore unused import import { toResource, IEditorStacksModel, SideBySideEditorInput, IEditorGroup, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; @@ -31,7 +32,7 @@ export class FileEditorTracker implements IWorkbenchContribution { protected closeOnFileDelete: boolean; - private stacks: IEditorStacksModel; + // @ts-ignore unused propertyprivate stacks: IEditorStacksModel; private toUnbind: IDisposable[]; private modelLoadQueue: ResourceQueue; private activeOutOfWorkspaceWatchers: ResourceMap; @@ -47,6 +48,7 @@ export class FileEditorTracker implements IWorkbenchContribution { @IWorkspaceContextService private contextService: IWorkspaceContextService, ) { this.toUnbind = []; + // @ts-ignore unused property this.stacks = editorGroupService.getStacksModel(); this.modelLoadQueue = new ResourceQueue(); this.activeOutOfWorkspaceWatchers = new ResourceMap(); diff --git a/src/vs/workbench/parts/markers/browser/markersPanel.ts b/src/vs/workbench/parts/markers/browser/markersPanel.ts index 5c811c3b975..86daa95eeb3 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanel.ts @@ -69,6 +69,7 @@ export class MarkersPanel extends Panel { @IEditorGroupService private editorGroupService: IEditorGroupService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationService private configurationService: IConfigurationService, + // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService, @ITelemetryService telemetryService: ITelemetryService, @IListService private listService: IListService, diff --git a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts index ddb0a8b77be..a2c0a03bfff 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts @@ -117,6 +117,7 @@ export class FilterAction extends Action { public static ID: string = 'workbench.actions.problems.filter'; + // @ts-ignore unused property constructor(private markersPanel: MarkersPanel) { super(FilterAction.ID, Messages.MARKERS_PANEL_ACTION_TOOLTIP_FILTER, 'markers-panel-action-filter', true); } diff --git a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts index a01620d3e42..9e9e050f737 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts @@ -81,8 +81,11 @@ export class Renderer implements IRenderer { private static FILE_RESOURCE_TEMPLATE_ID = 'file-resource-template'; private static MARKER_TEMPLATE_ID = 'marker-template'; + // @ts-ignore unused property constructor(private actionRunner: IActionRunner, + // @ts-ignore unused property private actionProvider: IActionProvider, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IInstantiationService private instantiationService: IInstantiationService, @IThemeService private themeService: IThemeService diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index 6f7f7326885..04c8ec3ff4a 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -91,6 +91,7 @@ export class OutputService implements IOutputService { private _onOutputChannel: Emitter; private _onActiveOutputChannel: Emitter; + // @ts-ignore unused property private _outputLinkDetector: OutputLinkProvider; private _outputContentProvider: OutputContentProvider; private _outputPanel: OutputPanel; diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts index 2bf9edfc5c2..e8afc26ae6b 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts @@ -152,6 +152,7 @@ export class DefineKeybindingWidget extends Widget { constructor( parent: HTMLElement, + // @ts-ignore unused injected service @IKeybindingService private keybindingService: IKeybindingService, @IInstantiationService private instantiationService: IInstantiationService, @IThemeService private themeService: IThemeService diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index 386b2013334..b594c4cfff0 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -49,6 +49,7 @@ export class KeybindingsEditorInput extends EditorInput { public static ID: string = 'workbench.input.keybindings'; public readonly keybindingsModel: KeybindingsEditorModel; + // @ts-ignore unused injected service constructor( @IInstantiationService private instantiationService: IInstantiationService) { super(); this.keybindingsModel = instantiationService.createInstance(KeybindingsEditorModel, OS); @@ -106,6 +107,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor @IKeybindingEditingService private keybindingEditingService: IKeybindingEditingService, @IListService private listService: IListService, @IContextKeyService private contextKeyService: IContextKeyService, + // @ts-ignore unused injected service @IChoiceService private choiceService: IChoiceService, @IMessageService private messageService: IMessageService, @IClipboardService private clipboardService: IClipboardService, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesActions.ts b/src/vs/workbench/parts/preferences/browser/preferencesActions.ts index 1bdd9b31166..8a31da0bdfc 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesActions.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesActions.ts @@ -114,6 +114,7 @@ export class OpenFolderSettingsAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IPreferencesService private preferencesService: IPreferencesService, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @ICommandService private commandService: ICommandService diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 82220081583..2171e3dfc72 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -120,6 +120,7 @@ export class PreferencesEditor extends BaseEditor { constructor( @IPreferencesService private preferencesService: IPreferencesService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService telemetryService: ITelemetryService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @@ -698,12 +699,14 @@ export class EditableSettingsEditor extends BaseTextEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, @IPreferencesService private preferencesService: IPreferencesService, + // @ts-ignore unused injected service @IModelService private modelService: IModelService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, @@ -769,12 +772,15 @@ export class DefaultPreferencesEditor extends BaseTextEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, + // @ts-ignore unused injected service @IPreferencesService private preferencesService: IPreferencesService, + // @ts-ignore unused injected service @IModelService private modelService: IModelService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index 70ad86aba2c..5d01c19c744 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -73,6 +73,7 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend constructor(protected editor: ICodeEditor, public readonly preferencesModel: SettingsEditorModel, @IPreferencesService protected preferencesService: IPreferencesService, @ITelemetryService private telemetryService: ITelemetryService, + // @ts-ignore unused injected service @ITextFileService private textFileService: ITextFileService, @IConfigurationService private configurationService: IConfigurationService, @IInstantiationService protected instantiationService: IInstantiationService @@ -251,6 +252,7 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR constructor(protected editor: ICodeEditor, public readonly preferencesModel: DefaultSettingsEditorModel, @IPreferencesService protected preferencesService: IPreferencesService, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService protected instantiationService: IInstantiationService ) { @@ -415,6 +417,7 @@ class DefaultSettingsHeaderRenderer extends Disposable { private settingsHeaderWidget: DefaultSettingsHeaderWidget; public onClick: Event; + // @ts-ignore unused property constructor(private editor: ICodeEditor, scope: ConfigurationScope) { super(); const title = scope === ConfigurationScope.RESOURCE ? nls.localize('defaultFolderSettingsTitle', "Default Folder Settings") : nls.localize('defaultSettingsTitle', "Default Settings"); @@ -531,6 +534,7 @@ export class SettingsGroupTitleRenderer extends Disposable implements HiddenArea export class HiddenAreasRenderer extends Disposable { constructor(private editor: ICodeEditor, private hiddenAreasProviders: HiddenAreasProvider[], + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(); @@ -707,6 +711,7 @@ export class FilteredMatchesRenderer extends Disposable implements HiddenAreasPr public hiddenAreas: IRange[] = []; constructor(private editor: ICodeEditor, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(); @@ -811,6 +816,7 @@ export class HighlightMatchesRenderer extends Disposable { private decorationIds: string[] = []; constructor(private editor: ICodeEditor, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(); @@ -864,6 +870,7 @@ class EditSettingRenderer extends Disposable { constructor(private editor: ICodeEditor, private masterSettingsModel: ISettingsEditorModel, private settingHighlighter: SettingHighlighter, + // @ts-ignore unused injected service @IPreferencesService private preferencesService: IPreferencesService, @IInstantiationService private instantiationService: IInstantiationService, @IContextMenuService private contextMenuService: IContextMenuService @@ -1135,6 +1142,7 @@ class UnsupportedSettingsRenderer extends Disposable { constructor( private editor: editorCommon.ICommonCodeEditor, private settingsEditorModel: SettingsEditorModel, + // @ts-ignore unused injected service @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService, @IMarkerService private markerService: IMarkerService, @IEnvironmentService private environmentService: IEnvironmentService diff --git a/src/vs/workbench/parts/preferences/browser/preferencesService.ts b/src/vs/workbench/parts/preferences/browser/preferencesService.ts index 41ada932bde..c9f691030ed 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesService.ts @@ -63,9 +63,11 @@ export class PreferencesService extends Disposable implements IPreferencesServic @IFileService private fileService: IFileService, @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService, @IMessageService private messageService: IMessageService, + // @ts-ignore unused injected service @IChoiceService private choiceService: IChoiceService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IStorageService private storageService: IStorageService, @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts index cf03fd27d6f..0057f2d43d2 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts @@ -444,6 +444,7 @@ export class SearchWidget extends Widget { constructor(parent: HTMLElement, protected options: SearchOptions, @IContextViewService private contextViewService: IContextViewService, + // @ts-ignore unused injected service @IContextMenuService private contextMenuService: IContextMenuService, @IInstantiationService protected instantiationService: IInstantiationService, @IThemeService private themeService: IThemeService @@ -593,6 +594,7 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget { constructor( private editor: ICodeEditor, private label: string, + // @ts-ignore unused property private keyBindingAction: string, @IKeybindingService keybindingService: IKeybindingService, @IThemeService private themeService: IThemeService diff --git a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts index 8549fbdd25a..65e93c3b212 100644 --- a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts +++ b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts @@ -77,6 +77,7 @@ export class KeybindingsEditorModel extends EditorModel { private modifierLabels: ModifierLabels; constructor( + // @ts-ignore unused property private os: OperatingSystem, @IKeybindingService private keybindingsService: IKeybindingService, @IExtensionService private extensionService: IExtensionService @@ -244,6 +245,7 @@ class KeybindingItemMatches { public readonly whenMatches: IMatch[] = null; public readonly keybindingMatches: KeybindingMatches = null; + // @ts-ignore unused property constructor(private modifierLabels: ModifierLabels, keybindingItem: IKeybindingItem, private searchValue: string, private words: string[], private keybindingWords: string[], private completeMatch: boolean) { this.commandIdMatches = this.matches(searchValue, keybindingItem.command, or(matchesWords, matchesCamelCase), words); this.commandLabelMatches = keybindingItem.commandLabel ? this.matches(searchValue, keybindingItem.commandLabel, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandLabel, true), words) : null; diff --git a/src/vs/workbench/parts/preferences/common/preferencesModels.ts b/src/vs/workbench/parts/preferences/common/preferencesModels.ts index e75d3ec9f63..f68e560cf0f 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesModels.ts @@ -372,6 +372,7 @@ export class WorkspaceConfigModel extends SettingsEditorModel implements ISettin _configurationTarget: ConfigurationTarget, onDispose: Event, @IFileService private fileService: IFileService, + // @ts-ignore unused injected service @ITextModelService private textModelResolverService: ITextModelService, @ITextFileService textFileService: ITextFileService ) { @@ -810,6 +811,7 @@ class SettingsContentBuilder { return this._contentByLines[this._contentByLines.length - 1] || ''; } + // @ts-ignore unused property constructor(private _rangeOffset = 0, private _maxLines = Infinity) { this._contentByLines = []; } diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index 27ed3dfa3ff..41fcdfc26d3 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -157,6 +157,7 @@ export class ClearCommandHistoryAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused injected service @IStorageService private storageService: IStorageService, @IConfigurationService private configurationService: IConfigurationService ) { @@ -175,6 +176,7 @@ export class ClearCommandHistoryAction extends Action { } @editorAction +// @ts-ignore @editorAction uses the class class CommandPaletteEditorAction extends EditorAction { constructor() { @@ -322,6 +324,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { } } +// @ts-ignore unused type class CommandEntry extends BaseCommandEntry { constructor( @@ -402,6 +405,7 @@ export class CommandsHandler extends QuickOpenHandler { @IInstantiationService private instantiationService: IInstantiationService, @IKeybindingService private keybindingService: IKeybindingService, @IMenuService private menuService: IMenuService, + // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService ) { diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index b467e7526c4..81a4923534a 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -44,6 +44,7 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { @IWindowsService private windowsService: IWindowsService, @IWindowService private windowService: IWindowService, @IConfigurationService private configurationService: IConfigurationService, + // @ts-ignore unused injected service @IPreferencesService private preferencesService: IPreferencesService, @IEnvironmentService private envService: IEnvironmentService, @IMessageService private messageService: IMessageService, diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index 22d8ab03a1f..5275bc6cdd4 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -194,6 +194,7 @@ class DirtyDiffWidget extends PeekViewWidget { private model: DirtyDiffModel, @IThemeService private themeService: IThemeService, @IInstantiationService private instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IMenuService private menuService: IMenuService, @IKeybindingService private keybindingService: IKeybindingService, @IMessageService private messageService: IMessageService, @@ -467,6 +468,7 @@ export class DirtyDiffController implements IEditorContribution { private model: DirtyDiffModel | null = null; private widget: DirtyDiffWidget | null = null; + // @ts-ignore unused property private currentLineNumber: number = -1; private currentIndex: number = -1; private readonly isDirtyDiffVisible: IContextKey; @@ -478,6 +480,7 @@ export class DirtyDiffController implements IEditorContribution { constructor( private editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, + // @ts-ignore unused injected service @IThemeService private themeService: IThemeService, @IInstantiationService private instantiationService: IInstantiationService ) { @@ -872,9 +875,12 @@ export class DirtyDiffModel { constructor( private _editorModel: IModel, @ISCMService private scmService: ISCMService, + // @ts-ignore unused injected service @IModelService private modelService: IModelService, @IEditorWorkerService private editorWorkerService: IEditorWorkerService, + // @ts-ignore unused injected service @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @ITextModelService private textModelResolverService: ITextModelService ) { @@ -1018,9 +1024,11 @@ export class DirtyDiffWorkbenchController implements ext.IWorkbenchContribution, private disposables: IDisposable[] = []; constructor( + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IInstantiationService private instantiationService: IInstantiationService ) { diff --git a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts index 89e93eccac8..fe15f294473 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts @@ -28,6 +28,7 @@ export class SCMMenus implements IDisposable { private disposables: IDisposable[] = []; constructor( + // @ts-ignore unused property private provider: ISCMProvider | undefined, @IContextKeyService contextKeyService: IContextKeyService, @IMenuService private menuService: IMenuService diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 7238c2a7060..9f6881f0c8a 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -123,6 +123,7 @@ export class OpenFileHandler extends QuickOpenHandler { @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @ISearchService private searchService: ISearchService, + // @ts-ignore unused injected service @IConfigurationService private configurationService: IConfigurationService, @IEnvironmentService private environmentService: IEnvironmentService ) { diff --git a/src/vs/workbench/parts/search/browser/patternInputWidget.ts b/src/vs/workbench/parts/search/browser/patternInputWidget.ts index e282dfcb600..06020f4ef5e 100644 --- a/src/vs/workbench/parts/search/browser/patternInputWidget.ts +++ b/src/vs/workbench/parts/search/browser/patternInputWidget.ts @@ -37,6 +37,7 @@ export class PatternInputWidget extends Widget { private ariaLabel: string; private domNode: HTMLElement; + // @ts-ignore unused property private inputNode: HTMLInputElement; protected inputBox: InputBox; diff --git a/src/vs/workbench/parts/search/browser/replaceService.ts b/src/vs/workbench/parts/search/browser/replaceService.ts index 226a49595c7..90c0895a44d 100644 --- a/src/vs/workbench/parts/search/browser/replaceService.ts +++ b/src/vs/workbench/parts/search/browser/replaceService.ts @@ -99,8 +99,10 @@ export class ReplaceService implements IReplaceService { @ITelemetryService private telemetryService: ITelemetryService, @IFileService private fileService: IFileService, @IEditorService private editorService: IWorkbenchEditorService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService, @ITextModelService private textModelResolverService: ITextModelService, + // @ts-ignore unused injected service @ISearchWorkbenchService private searchWorkbenchService: ISearchWorkbenchService ) { } diff --git a/src/vs/workbench/parts/search/browser/search.contribution.ts b/src/vs/workbench/parts/search/browser/search.contribution.ts index af48f7bc74c..0431d6bea30 100644 --- a/src/vs/workbench/parts/search/browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/browser/search.contribution.ts @@ -172,6 +172,7 @@ CommandsRegistry.registerCommand(searchActions.FindInFolderAction.ID, searchActi class ExplorerViewerActionContributor extends ActionBarContributor { private _instantiationService: IInstantiationService; + // @ts-ignore unused injected service private _contextService: IWorkspaceContextService; constructor( @IInstantiationService instantiationService: IInstantiationService, @IWorkspaceContextService contextService: IWorkspaceContextService) { diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/parts/search/browser/searchActions.ts index 65b57f6a739..b9939f0339f 100644 --- a/src/vs/workbench/parts/search/browser/searchActions.ts +++ b/src/vs/workbench/parts/search/browser/searchActions.ts @@ -583,6 +583,7 @@ export class RemoveAction extends AbstractSearchAndReplaceAction { export class ReplaceAllAction extends AbstractSearchAndReplaceAction { constructor(private viewer: ITree, private fileMatch: FileMatch, private viewlet: SearchViewlet, + // @ts-ignore unused injected service @IReplaceService private replaceService: IReplaceService, @IKeybindingService keyBindingService: IKeybindingService, @ITelemetryService private telemetryService: ITelemetryService) { diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 522ae4e54ef..d9eebd8932c 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -155,6 +155,7 @@ export class SearchRenderer extends Disposable implements IRenderer { constructor( actionRunner: IActionRunner, private viewlet: SearchViewlet, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @IInstantiationService private instantiationService: IInstantiationService, @IThemeService private themeService: IThemeService diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index 6cd49dd06a5..d0dfc7755ab 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -71,9 +71,11 @@ export class SearchViewlet extends Viewlet { private isDisposed: boolean; + // @ts-ignore unused property private loading: boolean; private queryBuilder: QueryBuilder; private viewModel: SearchModel; + // @ts-ignore unused property private callOnModelChange: lifecycle.IDisposable[]; private viewletVisible: IContextKey; @@ -88,6 +90,7 @@ export class SearchViewlet extends Viewlet { private actionRegistry: { [key: string]: Action; }; private tree: ITree; private viewletSettings: any; + // @ts-ignore unused property private domNode: Builder; private messages: Builder; private searchWidgetsContainer: Builder; diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index 717213f614c..a3ada6ff325 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -348,6 +348,7 @@ export class FolderMatch extends Disposable { private _unDisposedFileMatches: ResourceMap; private _replacingAll: boolean = false; + // @ts-ignore unused injected service constructor(private _resource: URI, private _id: string, private _index: number, private _query: ISearchQuery, private _parent: SearchResult, private _searchModel: SearchModel, @IReplaceService private replaceService: IReplaceService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) { super(); @@ -497,6 +498,7 @@ export class SearchResult extends Disposable { private _folderMatches: FolderMatch[] = []; private _folderMatchesMap: TernarySearchTree = TernarySearchTree.forPaths(); + // @ts-ignore unused property private _query: ISearchQuery = null; private _showHighlights: boolean; diff --git a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts index 6ed72114838..37bd918e9d4 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts @@ -52,6 +52,7 @@ class Args { } @editorAction +// @ts-ignore @editorAction uses the class class InsertSnippetAction extends EditorAction { constructor() { diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts index 1e83ba2ab3f..5da020d10d2 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts @@ -133,6 +133,7 @@ export class Snippet { } } +// @ts-ignore unused type namespace OpenSnippetsAction { const id = 'workbench.action.openSnippets'; diff --git a/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts b/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts index 55567eec11f..3fa92e9391e 100644 --- a/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts +++ b/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts @@ -122,6 +122,7 @@ class LanguageSurvey { class LanguageSurveysContribution implements IWorkbenchContribution { + // @ts-ignore unused property private surveys: LanguageSurvey[]; constructor( diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/parts/tasks/browser/quickOpen.ts index 3298cbc6126..d534e3707c7 100644 --- a/src/vs/workbench/parts/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/quickOpen.ts @@ -200,6 +200,7 @@ export class QuickOpenActionContributor extends ActionBarContributor { private action: CustomizeTaskAction; + // @ts-ignore unused injected service constructor( @ITaskService private taskService: ITaskService, @IQuickOpenService private quickOpenService: IQuickOpenService) { super(); this.action = new CustomizeTaskAction(taskService, quickOpenService); diff --git a/src/vs/workbench/parts/tasks/common/problemCollectors.ts b/src/vs/workbench/parts/tasks/common/problemCollectors.ts index c40e58579b1..c6222b5902a 100644 --- a/src/vs/workbench/parts/tasks/common/problemCollectors.ts +++ b/src/vs/workbench/parts/tasks/common/problemCollectors.ts @@ -297,6 +297,7 @@ export enum ProblemHandlingStrategy { export class StartStopProblemCollector extends AbstractProblemCollector implements IProblemMatcher { private owners: string[]; + // @ts-ignore unused property private strategy: ProblemHandlingStrategy; private currentOwner: string; diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 7fb9ff90337..e889a21f26e 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -97,6 +97,7 @@ namespace ConfigureTaskAction { export const TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task"); } +// @ts-ignore unused type namespace ConfigureBuildTaskAction { export const ID = 'workbench.action.tasks.configureBuildTask'; export const TEXT = nls.localize('ConfigureBuildTaskAction.label', "Configure Build Task"); @@ -120,6 +121,7 @@ class CloseMessageAction extends Action { } } +// @ts-ignore unused type class ViewTerminalAction extends Action { public static ID = 'workbench.action.build.viewTerminal'; @@ -142,6 +144,7 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { constructor( @IPanelService private panelService: IPanelService, @IMarkerService private markerService: IMarkerService, + // @ts-ignore unused injected service @IOutputService private outputService: IOutputService, @ITaskService private taskService: ITaskService, @IPartService private partService: IPartService, @@ -316,12 +319,17 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { class TaskStatusBarItem extends Themable implements IStatusbarItem { constructor( + // @ts-ignore unused injected service @IPanelService private panelService: IPanelService, + // @ts-ignore unused injected service @IMarkerService private markerService: IMarkerService, + // @ts-ignore unused injected service @IOutputService private outputService: IOutputService, @ITaskService private taskService: ITaskService, + // @ts-ignore unused injected service @IPartService private partService: IPartService, @IThemeService themeService: IThemeService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, ) { super(themeService); @@ -378,10 +386,12 @@ class TaskStatusBarItem extends Themable implements IStatusbarItem { } } +// @ts-ignore unused type interface TaskServiceEventData { error?: any; } +// @ts-ignore unused type class NullTaskSystem extends EventEmitter implements ITaskSystem { public run(task: Task): ITaskExecuteResult { return { @@ -529,6 +539,7 @@ class TaskService extends EventEmitter implements ITaskService { public static OutputChannelId: string = 'tasks'; public static OutputChannelLabel: string = nls.localize('tasks', "Tasks"); + // @ts-ignore unused injected service private modeService: IModeService; private configurationService: IConfigurationService; private markerService: IMarkerService; @@ -569,6 +580,7 @@ class TaskService extends EventEmitter implements ITaskService { @ILifecycleService lifecycleService: ILifecycleService, @IModelService modelService: IModelService, @IExtensionService extensionService: IExtensionService, @IQuickOpenService quickOpenService: IQuickOpenService, + // @ts-ignore unused injected service @IEnvironmentService private environmentService: IEnvironmentService, @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService, @ITerminalService private terminalService: ITerminalService, @@ -2038,6 +2050,7 @@ class TaskService extends EventEmitter implements ITaskService { }; let promise = this.getTasksForGroup(TaskGroup.Build).then((tasks) => { if (tasks.length > 0) { + // @ts-ignore unused local let { none, defaults, users } = this.splitPerGroupType(tasks); if (defaults.length === 1) { this.run(defaults[0]); @@ -2082,6 +2095,7 @@ class TaskService extends EventEmitter implements ITaskService { }; let promise = this.getTasksForGroup(TaskGroup.Test).then((tasks) => { if (tasks.length > 0) { + // @ts-ignore unused local let { none, defaults, users } = this.splitPerGroupType(tasks); if (defaults.length === 1) { this.run(defaults[0]); diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 88de5627bf8..0db084bf985 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -38,6 +38,7 @@ import { TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; +// @ts-ignore unused type interface PrimaryTerminal { terminal: ITerminalInstance; busy: boolean; @@ -68,6 +69,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { private markerService: IMarkerService, private modelService: IModelService, private configurationResolverService: IConfigurationResolverService, private telemetryService: ITelemetryService, + // @ts-ignore unused injected service private workbenchEditorService: IWorkbenchEditorService, private contextService: IWorkspaceContextService, outputChannelId: string) { diff --git a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts index 3d57714c819..2f03ec2ff94 100644 --- a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts @@ -44,6 +44,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { private outputService: IOutputService; private telemetryService: ITelemetryService; private configurationResolverService: IConfigurationResolverService; + // @ts-ignore unused injected service private contextService: IWorkspaceContextService; private outputChannel: IOutputChannel; diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts index 1324eb06c92..a69d801d963 100644 --- a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts +++ b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts @@ -1648,6 +1648,7 @@ export interface IProblemReporter extends IProblemReporterBase { clearOutput(): void; } +// @ts-ignore unused type class NullProblemReporter extends NullProblemReporterBase implements IProblemReporter { clearOutput(): void { } } diff --git a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts index b8057237852..c49786a93eb 100644 --- a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts +++ b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts @@ -50,6 +50,7 @@ export class CreateTerminal extends QuickOpenEntry { constructor( private label: string, + // @ts-ignore unused injected service private terminalService: ITerminalService, private commandService: ICommandService ) { @@ -81,6 +82,7 @@ export class TerminalPickerHandler extends QuickOpenHandler { constructor( @ITerminalService private terminalService: ITerminalService, @ICommandService private commandService: ICommandService, + // @ts-ignore unused injected service @IPanelService private panelService: IPanelService ) { super(); diff --git a/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts b/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts index f51e97e5dd7..bfa10fd50a8 100644 --- a/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts +++ b/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts @@ -14,6 +14,7 @@ export class TerminalWidgetManager { private _messageListeners: IDisposable[] = []; constructor( + // @ts-ignore unused property private _configHelper: ITerminalConfigHelper, terminalWrapper: HTMLElement ) { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index ce3950c1dbb..dc0db1cebf3 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -729,7 +729,9 @@ export class ShowPreviousFindTermTerminalFindWidgetAction extends Action { export class QuickOpenActionTermContributor extends ActionBarContributor { constructor( + // @ts-ignore unused injected service @ITerminalService private terminalService: ITerminalService, + // @ts-ignore unused injected service @IQuickOpenService private quickOpenService: IQuickOpenService, @IInstantiationService private instantiationService: IInstantiationService ) { @@ -775,6 +777,7 @@ export class RenameTerminalQuickOpenAction extends RenameTerminalAction { private terminal: TerminalEntry, @IQuickOpenService quickOpenService: IQuickOpenService, @ITerminalService terminalService: ITerminalService, + // @ts-ignore unused injected service @IInstantiationService private instantiationService: IInstantiationService ) { super(id, label, quickOpenService, terminalService); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index a2b24f21f08..079dc144f86 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -42,6 +42,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { private _lastFontMeasurement: ITerminalFont; public constructor( + // @ts-ignore unused property private _platform: platform.Platform, @IConfigurationService private _configurationService: IConfigurationService, @IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService, diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 110deb4b14b..40869c941d0 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -78,6 +78,7 @@ enum ProcessState { export class TerminalInstance implements ITerminalInstance { private static readonly EOL_REGEX = /\r?\n/g; + // @ts-ignore unused property private static _terminalProcessFactory: ITerminalProcessFactory = new StandardTerminalProcessFactory(); private static _lastKnownDimensions: Dimension = null; private static _idCounter = 1; @@ -133,7 +134,9 @@ export class TerminalInstance implements ITerminalInstance { @IKeybindingService private _keybindingService: IKeybindingService, @IMessageService private _messageService: IMessageService, @IPanelService private _panelService: IPanelService, + // @ts-ignore unused injected service @IWorkspaceContextService private _contextService: IWorkspaceContextService, + // @ts-ignore unused injected service @IWorkbenchEditorService private _editorService: IWorkbenchEditorService, @IInstantiationService private _instantiationService: IInstantiationService, @IClipboardService private _clipboardService: IClipboardService, diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index cc13cbf8554..33d3783991a 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -67,6 +67,7 @@ export class TerminalLinkHandler { private _platform: platform.Platform, private _initialCwd: string, @IOpenerService private _openerService: IOpenerService, + // @ts-ignore unused injected service @IWorkbenchEditorService private _editorService: IWorkbenchEditorService, @IConfigurationService private _configurationService: IConfigurationService, @ITerminalService private _terminalService: ITerminalService diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index 4a0363f17b5..130c0e5c601 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -33,6 +33,7 @@ export class TerminalPanel extends Panel { private _copyContextMenuAction: IAction; private _contextMenuActions: IAction[]; private _cancelContextMenu: boolean = false; + // @ts-ignore unused property private _font: ITerminalFont; private _fontStyleElement: HTMLElement; private _parentDomElement: HTMLElement; @@ -43,6 +44,7 @@ export class TerminalPanel extends Panel { constructor( @IConfigurationService private _configurationService: IConfigurationService, @IContextMenuService private _contextMenuService: IContextMenuService, + // @ts-ignore unused injected service @IContextViewService private _contextViewService: IContextViewService, @IInstantiationService private _instantiationService: IInstantiationService, @ITerminalService private _terminalService: ITerminalService, diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index e68cc0b5173..7038f2887a7 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -36,6 +36,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina @IPartService _partService: IPartService, @ILifecycleService _lifecycleService: ILifecycleService, @IInstantiationService private _instantiationService: IInstantiationService, + // @ts-ignore unused injected service @IWindowService private _windowService: IWindowService, @IQuickOpenService private _quickOpenService: IQuickOpenService, @IChoiceService private _choiceService: IChoiceService, diff --git a/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts index b4a2d55c42a..fb4a1f38096 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts @@ -14,6 +14,7 @@ const SHELL_EXECUTABLES = ['cmd.exe', 'powershell.exe', 'bash.exe']; let windowsProcessTree; export class WindowsShellHelper { + // @ts-ignore unused property private _childProcessIdStack: number[]; private _onCheckShell: Emitter>; private _isDisposed: boolean; @@ -22,6 +23,7 @@ export class WindowsShellHelper { public constructor( private _rootProcessId: number, + // @ts-ignore unused property private _rootShellExecutable: string, private _terminalInstance: ITerminalInstance, private _xterm: XTermTerminal diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index be088071437..25b6767742d 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -21,6 +21,7 @@ class MockConfigurationService implements IConfigurationService { public keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; } public getConfiguration(): any { return this.configuration; } public getValue(key: string, overrides?: IConfigurationOverrides): T { return getConfigurationValue(this.getConfiguration(), key); } + // @ts-ignore unused generic parameter public updateValue(): TPromise { return null; } public getConfigurationData(): any { return null; } public onDidChangeConfiguration() { return { dispose() { } }; } diff --git a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts index d8f6bebd750..937068e685d 100644 --- a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts +++ b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts @@ -35,6 +35,7 @@ export class SelectColorThemeAction extends Action { id: string, label: string, @IQuickOpenService private quickOpenService: IQuickOpenService, + // @ts-ignore unused injected service @IMessageService private messageService: IMessageService, @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IExtensionGalleryService private extensionGalleryService: IExtensionGalleryService, diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index 9a42bcaf34b..096d930c697 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -128,6 +128,7 @@ export abstract class AbstractShowReleaseNotesAction extends Action { constructor( id: string, label: string, + // @ts-ignore unused property private returnValue: boolean, private version: string, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @@ -182,6 +183,7 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio export class DownloadAction extends Action { + // @ts-ignore unused property constructor(private url: string, @IUpdateService private updateService: IUpdateService) { super('update.download', nls.localize('downloadNow', "Download Now"), null, true); } @@ -301,6 +303,7 @@ class CommandAction extends Action { constructor( commandId: string, label: string, + // @ts-ignore unused injected service @ICommandService private commandService: ICommandService ) { super(`command-action:${commandId}`, label, undefined, true, () => commandService.executeCommand(commandId)); diff --git a/src/vs/workbench/parts/watermark/electron-browser/watermark.ts b/src/vs/workbench/parts/watermark/electron-browser/watermark.ts index 1031a79131b..e8aa038a47c 100644 --- a/src/vs/workbench/parts/watermark/electron-browser/watermark.ts +++ b/src/vs/workbench/parts/watermark/electron-browser/watermark.ts @@ -114,6 +114,7 @@ export class WatermarkContribution implements IWorkbenchContribution { @IPartService private partService: IPartService, @IKeybindingService private keybindingService: IKeybindingService, @IWorkspaceContextService private contextService: IWorkspaceContextService, + // @ts-ignore unused injected service @ITelemetryService private telemetryService: ITelemetryService, @IConfigurationService private configurationService: IConfigurationService ) { diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts index cdb9eb088b0..74df1a7312d 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts @@ -11,6 +11,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import * as platform from 'vs/base/common/platform'; import product from 'vs/platform/node/product'; +// @ts-ignore unused type abstract class AbstractGettingStarted implements IWorkbenchContribution { protected static hideWelcomeSettingskey = 'workbench.hide.welcome'; diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index 86da1d7bd3b..8a53b671f5f 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -243,7 +243,9 @@ class WelcomePage { @IExtensionTipsService private tipsService: IExtensionTipsService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @ILifecycleService lifecycleService: ILifecycleService, + // @ts-ignore unused injected service @IThemeService private themeService: IThemeService, + // @ts-ignore unused injected service @IExperimentService private experimentService: IExperimentService, @ITelemetryService private telemetryService: ITelemetryService ) { diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts index 84757bd9881..d916ffa0e68 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts @@ -99,14 +99,17 @@ export class WalkThroughPart extends BaseEditor { @IInstantiationService private instantiationService: IInstantiationService, @IThemeService protected themeService: IThemeService, @IOpenerService private openerService: IOpenerService, + // @ts-ignore unused injected service @IFileService private fileService: IFileService, @IModelService protected modelService: IModelService, @IKeybindingService private keybindingService: IKeybindingService, @IStorageService private storageService: IStorageService, @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, + // @ts-ignore unused injected service @IModeService private modeService: IModeService, @IMessageService private messageService: IMessageService, + // @ts-ignore unused injected service @IPartService private partService: IPartService ) { super(WalkThroughPart.ID, telemetryService, themeService); diff --git a/src/vs/workbench/services/backup/test/node/backupFileService.test.ts b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts index 23420f77df0..f7c21bdf2cd 100644 --- a/src/vs/workbench/services/backup/test/node/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts @@ -23,6 +23,7 @@ import { TestContextService, TestTextResourceConfigurationService, getRandomTest import { Workspace, toWorkspaceFolders } from 'vs/platform/workspace/common/workspace'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; +// @ts-ignore unused type class TestEnvironmentService extends EnvironmentService { constructor(private _backupHome: string, private _backupWorkspacesPath: string) { diff --git a/src/vs/workbench/services/configuration/node/configurationEditingService.ts b/src/vs/workbench/services/configuration/node/configurationEditingService.ts index 24dce179514..ce0d601fd93 100644 --- a/src/vs/workbench/services/configuration/node/configurationEditingService.ts +++ b/src/vs/workbench/services/configuration/node/configurationEditingService.ts @@ -109,6 +109,7 @@ interface IConfigurationEditOperation extends IConfigurationValue { } +// @ts-ignore unused type interface IValidationResult { error?: ConfigurationEditingErrorCode; exists?: boolean; diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index eb798445520..11cd1329ab5 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -68,6 +68,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat private configurationEditingService: ConfigurationEditingService; private jsonEditingService: JSONEditingService; + // @ts-ignore unused injected service constructor(private environmentService: IEnvironmentService, private workspacesService: IWorkspacesService, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME) { super(); diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index d9df4dda92f..cb7c2dce949 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -133,6 +133,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } public resolveAny(root: IWorkspaceFolder, value: T): T; + // @ts-ignore unused generic parameter public resolveAny(root: IWorkspaceFolder, value: any): any { try { this._lastWorkspaceFolder = root; @@ -205,6 +206,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } private resolveAnyLiteral(root: IWorkspaceFolder, values: T): T; + // @ts-ignore unused generic parameter private resolveAnyLiteral(root: IWorkspaceFolder, values: any): any { let result: IStringDictionary | string[]> = Object.create(null); Object.keys(values).forEach(key => { diff --git a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts index fce774139c1..b44f10acfd8 100644 --- a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts @@ -365,6 +365,7 @@ class MockCommandService implements ICommandService { onWillExecuteCommand = () => ({ dispose: () => { } }); + // @ts-ignore unused generic parameter public executeCommand(commandId: string, ...args: any[]): TPromise { this.callCount++; return TPromise.as(commandId); diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index dabe18285d6..767722336fe 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -27,6 +27,7 @@ let activeEditor: BaseEditor = { let openedEditorInput; let openedEditorOptions; +// @ts-ignore unused local let openedEditorPosition; function toResource(path) { diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index b00ba458b71..2db30d6e03e 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -189,6 +189,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic private history: (IEditorInput | IResourceInput)[]; private recentlyClosedFiles: IRecentlyClosedFile[]; private loaded: boolean; + // @ts-ignore unused property private registry: IEditorRegistry; private resourceFilter: ResourceGlobMatcher; diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 9fa0959b5c2..da0865c1e95 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -34,6 +34,7 @@ export class SearchService implements ISearchService { @IModelService private modelService: IModelService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IEnvironmentService environmentService: IEnvironmentService, + // @ts-ignore unused injected service @IWorkspaceContextService private contextService: IWorkspaceContextService, @ITelemetryService private telemetryService: ITelemetryService, @IConfigurationService private configurationService: IConfigurationService diff --git a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts index 125ef301221..2e1640fbd73 100644 --- a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts +++ b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts @@ -102,6 +102,7 @@ export class TextModelResolverService implements ITextModelService { private resourceModelCollection: ResourceModelCollection; constructor( + // @ts-ignore unused injected service @ITextFileService private textFileService: ITextFileService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IInstantiationService private instantiationService: IInstantiationService, diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 5dd51a71206..526ffd67dec 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -92,6 +92,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { constructor( container: HTMLElement, + // @ts-ignore unused injected service @IExtensionService private extensionService: IExtensionService, @IStorageService private storageService: IStorageService, @IBroadcastService private broadcastService: IBroadcastService, diff --git a/src/vs/workbench/services/thread/common/threadService.ts b/src/vs/workbench/services/thread/common/threadService.ts index 9c0e152fd52..0fd6a9cd6af 100644 --- a/src/vs/workbench/services/thread/common/threadService.ts +++ b/src/vs/workbench/services/thread/common/threadService.ts @@ -21,6 +21,7 @@ export interface IThreadService { assertRegistered(identifiers: ProxyIdentifier[]): void; } +// @ts-ignore unused generic parameter export class ProxyIdentifier { _proxyIdentifierBrand: void; diff --git a/src/vs/workbench/test/browser/actionRegistry.test.ts b/src/vs/workbench/test/browser/actionRegistry.test.ts index 97a62c5cc7f..f0955049db3 100644 --- a/src/vs/workbench/test/browser/actionRegistry.test.ts +++ b/src/vs/workbench/test/browser/actionRegistry.test.ts @@ -11,6 +11,7 @@ import { prepareActions } from 'vs/workbench/browser/actions'; import { Action } from 'vs/base/common/actions'; +// @ts-ignore unused type class MyClass extends Action { constructor(id: string, label: string) { super(id, label); diff --git a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts index e0e73cd5df4..9caa11a7e98 100644 --- a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts @@ -339,6 +339,7 @@ suite('Editor Stacks Model', () => { let events = modelListener(model); let group1 = model.openGroup('first'); + // @ts-ignore unused property let group2 = model.openGroup('second'); let group3 = model.openGroup('third'); diff --git a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts index 432571a2e27..41e7bdb6667 100644 --- a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts @@ -21,7 +21,9 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IModel } from 'vs/editor/common/editorCommon'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +// @ts-ignore unused type class MyEditorModel extends EditorModel { } +// @ts-ignore unused type class MyTextEditorModel extends BaseTextEditorModel { } class ServiceAccessor { diff --git a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts index e9677bbdb23..08b419544c3 100644 --- a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts +++ b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts @@ -28,8 +28,11 @@ import { CoreNavigationCommands } from 'vs/editor/common/controller/coreCommands suite('Editor - Range decorations', () => { let instantiationService: TestInstantiationService; + // @ts-ignore unused injected service let editorService: WorkbenchEditorService.IWorkbenchEditorService; + // @ts-ignore unused injected service let modelService: IModelService; + // @ts-ignore unused injected service let modeService: IModeService; let codeEditor: editorCommon.ICommonCodeEditor; let model: Model; diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index f2e905cbb73..1be72cf370d 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -45,6 +45,7 @@ const model: EditorCommon.IModel = EditorModel.createFromString( let threadService: TestThreadService; let extHost: ExtHostLanguageFeatures; +// @ts-ignore unused local let mainThread: MainThreadLanguageFeatures; let commands: ExtHostCommands; let disposables: vscode.Disposable[] = []; diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index 92c6cfed88e..f27229ac33a 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -57,6 +57,7 @@ const model: EditorCommon.IModel = EditorModel.createFromString( URI.parse('far://testing/file.a')); let extHost: ExtHostLanguageFeatures; +// @ts-ignore unused local let mainThread: MainThreadLanguageFeatures; let disposables: vscode.Disposable[] = []; let threadService: TestThreadService; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index aa0b3e1f76b..b5f7d2615a8 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -25,6 +25,7 @@ suite('MainThreadDocumentsAndEditors', () => { let codeEditorService: MockCodeEditorService; let textFileService: ITextFileService; let workbenchEditorService: IWorkbenchEditorService; + // @ts-ignore unused property let documentAndEditor: MainThreadDocumentsAndEditors; let deltas: IDocumentsAndEditorsDelta[] = []; const hugeModelString = new Array(2 + (50 * 1024 * 1024)).join('-'); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 56398e4ceb4..b007781516c 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -72,6 +72,7 @@ export class TestContextService implements IWorkspaceContextService { public _serviceBrand: any; private workspace: IWorkbenchWorkspace; + // @ts-ignore unused property private id: string; private options: any; From d2cc96626bd670f5bb5dc6a0965747412cbc7290 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 7 Nov 2017 17:07:15 +0100 Subject: [PATCH 25/88] don't unneccessary fire event when calling ContextKey#removeValue --- src/vs/platform/contextkey/browser/contextKeyService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/contextkey/browser/contextKeyService.ts b/src/vs/platform/contextkey/browser/contextKeyService.ts index f12ad44deeb..3ae51a0edea 100644 --- a/src/vs/platform/contextkey/browser/contextKeyService.ts +++ b/src/vs/platform/contextkey/browser/contextKeyService.ts @@ -37,7 +37,11 @@ export class Context implements IContext { public removeValue(key: string): boolean { // console.log('REMOVE ' + key + ' FROM ' + this._id); - return delete this._value[key]; + if (key in this._value) { + delete this._value[key]; + return true; + } + return false; } public getValue(key: string): T { From 6dc7e364d78c2b9c88871d0eb9d22428308a2099 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 7 Nov 2017 17:23:19 +0100 Subject: [PATCH 26/88] debt - remove some ts-ignored things --- .../instantiation/common/instantiationService.ts | 3 +-- .../api/electron-browser/mainThreadDocuments.ts | 3 --- .../api/electron-browser/mainThreadHeapService.ts | 3 +-- .../api/electron-browser/mainThreadMessageService.ts | 4 +--- .../api/electron-browser/mainThreadWorkspace.ts | 8 +------- src/vs/workbench/api/node/extHostLanguageFeatures.ts | 7 +------ src/vs/workbench/api/node/extHostMessageService.ts | 4 +--- src/vs/workbench/api/node/extHostTask.ts | 7 +------ .../electron-browser/snippets.contribution.ts | 3 +-- .../api/extHostMessagerService.test.ts | 12 ++++++------ .../api/mainThreadDocumentsAndEditors.test.ts | 4 +--- 11 files changed, 15 insertions(+), 43 deletions(-) diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index e27300b9302..052e2eba90a 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -62,8 +62,7 @@ export class InstantiationService implements IInstantiationService { } } - // @ts-ignore unused generic parameter - createInstance(param: any, ...rest: any[]): any { + createInstance(param: any, ...rest: any[]): any { if (param instanceof SyncDescriptor) { // sync diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts index cca68b1a3fd..9293b819709 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts @@ -66,8 +66,6 @@ export class BoundModelReferenceCollection { export class MainThreadDocuments implements MainThreadDocumentsShape { private _modelService: IModelService; - // @ts-ignore unused injected service - private _modeService: IModeService; private _textModelResolverService: ITextModelService; private _textFileService: ITextFileService; private _fileService: IFileService; @@ -90,7 +88,6 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { @IUntitledEditorService untitledEditorService: IUntitledEditorService, ) { this._modelService = modelService; - this._modeService = modeService; this._textModelResolverService = textModelResolverService; this._textFileService = textFileService; this._fileService = fileService; diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts index 654667ed7fe..e962c85b7ac 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts @@ -69,8 +69,7 @@ export class HeapService implements IHeapService { trackRecursive(p: TPromise): TPromise; trackRecursive(obj: T): T; - // @ts-ignore unused generic parameter - trackRecursive(obj: any): any { + trackRecursive(obj: any): any { if (TPromise.is(obj)) { return obj.then(result => this.trackRecursive(result)); } else { diff --git a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts index ee1e1909e21..090834e9b6a 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadMessageService.ts @@ -11,15 +11,13 @@ import { Action } from 'vs/base/common/actions'; import { TPromise as Promise } from 'vs/base/common/winjs.base'; import { MainThreadMessageServiceShape, MainContext, IExtHostContext, MainThreadMessageOptions } from '../node/extHost.protocol'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; -import { IExtensionService, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; @extHostNamedCustomer(MainContext.MainThreadMessageService) export class MainThreadMessageService implements MainThreadMessageServiceShape { constructor( extHostContext: IExtHostContext, - // @ts-ignore unused injected service - @IExtensionService private readonly _extensionService: IExtensionService, @IMessageService private readonly _messageService: IMessageService, @IChoiceService private readonly _choiceService: IChoiceService ) { diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index a641a38c87e..18e06d646ee 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -11,12 +11,10 @@ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { TPromise } from 'vs/base/common/winjs.base'; import { MainThreadWorkspaceShape, ExtHostWorkspaceShape, ExtHostContext, MainContext, IExtHostContext } from '../node/extHost.protocol'; -import { IFileService } from 'vs/platform/files/common/files'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IRelativePattern } from 'vs/base/common/glob'; -import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; @extHostNamedCustomer(MainContext.MainThreadWorkspace) export class MainThreadWorkspace implements MainThreadWorkspaceShape { @@ -30,11 +28,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { @ISearchService private readonly _searchService: ISearchService, @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @ITextFileService private readonly _textFileService: ITextFileService, - @IConfigurationService private _configurationService: IConfigurationService, - // @ts-ignore unused injected service - @IFileService private readonly _fileService: IFileService, - // @ts-ignore unused injected service - @IWorkspaceEditingService private _workspaceEditingService: IWorkspaceEditingService + @IConfigurationService private _configurationService: IConfigurationService ) { this._proxy = extHostContext.get(ExtHostContext.ExtHostWorkspace); this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace, this, this._toDispose); diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 4e21bd1f4b6..d45f5d6b3bf 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -707,11 +707,7 @@ class LinkProviderAdapter { class ColorProviderAdapter { constructor( - // @ts-ignore unused property - private _proxy: MainThreadLanguageFeaturesShape, private _documents: ExtHostDocuments, - // @ts-ignore unused property - private _colorFormatCache: Map, private _provider: vscode.DocumentColorProvider ) { } @@ -758,7 +754,6 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { private _heapService: ExtHostHeapService; private _diagnostics: ExtHostDiagnostics; private _adapter = new Map(); - private _colorFormatCache = new Map(); constructor( mainContext: IMainContext, @@ -1041,7 +1036,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { registerColorProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentColorProvider): vscode.Disposable { const handle = this._nextHandle(); - this._adapter.set(handle, new ColorProviderAdapter(this._proxy, this._documents, this._colorFormatCache, provider)); + this._adapter.set(handle, new ColorProviderAdapter(this._documents, provider)); this._proxy.$registerDocumentColorProvider(handle, selector); return this._createDisposable(handle); } diff --git a/src/vs/workbench/api/node/extHostMessageService.ts b/src/vs/workbench/api/node/extHostMessageService.ts index 642eca76c0f..d0698c554bc 100644 --- a/src/vs/workbench/api/node/extHostMessageService.ts +++ b/src/vs/workbench/api/node/extHostMessageService.ts @@ -9,9 +9,7 @@ import vscode = require('vscode'); import { MainContext, MainThreadMessageServiceShape, MainThreadMessageOptions, IMainContext } from './extHost.protocol'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; - -// @ts-ignore unused generic parameter -function isMessageItem(item: any): item is vscode.MessageItem { +function isMessageItem(item: any): item is vscode.MessageItem { return item && item.title; } diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 84d12774752..09538e65693 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -20,11 +20,6 @@ import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import * as vscode from 'vscode'; -// @ts-ignore unused type -interface StringMap { - [key: string]: V; -} - /* namespace ProblemPattern { export function from(value: vscode.ProblemPattern | vscode.MultiLineProblemPattern): Problems.ProblemPattern | Problems.MultiLineProblemPattern { @@ -465,4 +460,4 @@ export class ExtHostTask implements ExtHostTaskShape { private nextHandle(): number { return this._handleCounter++; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts index 5da020d10d2..b262f72df95 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts @@ -133,9 +133,8 @@ export class Snippet { } } -// @ts-ignore unused type -namespace OpenSnippetsAction { +{ const id = 'workbench.action.openSnippets'; CommandsRegistry.registerCommand(id, accessor => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index 37c944c5ce9..0876cbf5b90 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -14,7 +14,7 @@ suite('ExtHostMessageService', function () { test('propagte handle on select', function () { - let service = new MainThreadMessageService(null, null, { + let service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { assert.equal(m.actions.length, 1); setImmediate(() => m.actions[0].run()); @@ -34,7 +34,7 @@ suite('ExtHostMessageService', function () { test('isCloseAffordance', function () { let actions: Action[]; - let service = new MainThreadMessageService(null, null, { + let service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { actions = m.actions; } @@ -62,7 +62,7 @@ suite('ExtHostMessageService', function () { let actions: Action[]; let c: number; - let service = new MainThreadMessageService(null, null, { + let service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { c = 0; actions = m.actions; @@ -85,7 +85,7 @@ suite('ExtHostMessageService', function () { suite('modal', () => { test('calls choice service', () => { - const service = new MainThreadMessageService(null, null, { + const service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { throw new Error('not implemented'); } @@ -105,7 +105,7 @@ suite('ExtHostMessageService', function () { }); test('returns undefined when cancelled', () => { - const service = new MainThreadMessageService(null, null, { + const service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { throw new Error('not implemented'); } @@ -121,7 +121,7 @@ suite('ExtHostMessageService', function () { }); test('hides Cancel button when not needed', () => { - const service = new MainThreadMessageService(null, null, { + const service = new MainThreadMessageService(null, { show(sev: number, m: { message; actions: Action[] }) { throw new Error('not implemented'); } diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index b5f7d2615a8..f070654bb3a 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -25,8 +25,6 @@ suite('MainThreadDocumentsAndEditors', () => { let codeEditorService: MockCodeEditorService; let textFileService: ITextFileService; let workbenchEditorService: IWorkbenchEditorService; - // @ts-ignore unused property - let documentAndEditor: MainThreadDocumentsAndEditors; let deltas: IDocumentsAndEditorsDelta[] = []; const hugeModelString = new Array(2 + (50 * 1024 * 1024)).join('-'); @@ -53,7 +51,7 @@ suite('MainThreadDocumentsAndEditors', () => { onEditorGroupMoved = Event.None; }; - documentAndEditor = new MainThreadDocumentsAndEditors( + new MainThreadDocumentsAndEditors( OneGetThreadService(new class extends mock() { $acceptDocumentsAndEditorsDelta(delta) { deltas.push(delta); } }), From 73bf4242a564644f32784ec81da6d0d4e86995c6 Mon Sep 17 00:00:00 2001 From: Anton Vildyaev Date: Tue, 7 Nov 2017 17:50:47 +0100 Subject: [PATCH 27/88] Rename to openDebugOnStart --- src/vs/workbench/parts/debug/common/debug.ts | 7 +++---- .../parts/debug/electron-browser/debug.contribution.ts | 4 ++-- .../parts/debug/electron-browser/debugService.ts | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 8121fc42e81..4979ba978c4 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -47,10 +47,10 @@ export const INTERNAL_CONSOLE_OPTIONS_SCHEMA = { default: 'openOnFirstSessionStart', description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.") }; -export const DEBUG_VIEWLET_OPTIONS_SCHEMA = { +export const OPEN_DEBUG_OPTIONS_SCHEMA = { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], default: 'openOnFirstSessionStart', - description: nls.localize('debugViewletOptions', "Controls whether debug viewlet should be open on debugging session start.") + description: nls.localize('openDebugOnStart', "Controls whether debug viewlet should be open on debugging session start.") }; // raw @@ -324,11 +324,11 @@ export enum State { export interface IDebugConfiguration { allowBreakpointsEverywhere: boolean; + openDebugOnStart: string; openExplorerOnEnd: boolean; inlineValues: boolean; hideActionBar: boolean; internalConsoleOptions: string; - debugViewletOptions: string; } export interface IGlobalConfig { @@ -342,7 +342,6 @@ export interface IEnvConfig { type: string; request: string; internalConsoleOptions?: string; - debugViewletOptions?: string; preLaunchTask?: string; __restart?: any; __sessionId?: string; diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 8ac9c2cef88..3f9b85b0abd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -20,7 +20,7 @@ import { VariablesView, WatchExpressionsView, CallStackView, BreakpointsView } f import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA, - CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, DEBUG_VIEWLET_OPTIONS_SCHEMA + CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, OPEN_DEBUG_OPTIONS_SCHEMA } from 'vs/workbench/parts/debug/common/debug'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; @@ -188,7 +188,7 @@ configurationRegistry.registerConfiguration({ default: false }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, - 'debug.debugViewletOptions': DEBUG_VIEWLET_OPTIONS_SCHEMA, + 'debug.openDebugOnStart': OPEN_DEBUG_OPTIONS_SCHEMA, 'launch': { type: 'object', description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"), diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 15c36fc56e5..3386d49584c 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -872,11 +872,11 @@ export class DebugService implements debug.IDebugService { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } - const debugViewletOptions = configuration.debugViewletOptions || this.configurationService.getConfiguration('debug').debugViewletOptions; - // Open debug viewlet based on the visibility of the side bar and debugViewletOptions setting + const openDebugOptions = this.configurationService.getConfiguration('debug').openDebugOnStart; + // Open debug viewlet based on the visibility of the side bar and openDebugOnStart setting if ((this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) - && ((debugViewletOptions === 'openOnSessionStart') - || (debugViewletOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState))) { + && ((openDebugOptions === 'openOnSessionStart') + || (openDebugOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState))) { this.viewModel.changedWorkbenchViewState = true; this.viewletService.openViewlet(debug.VIEWLET_ID); } From 3fbbfabac783f3e6fd230be116688c3789b0ec89 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 18:14:55 +0100 Subject: [PATCH 28/88] fix compile --- src/vs/workbench/electron-browser/workbench.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index f007c0aec79..0ac0123c767 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -20,7 +20,6 @@ import { time } from 'vs/base/common/performance'; import errors = require('vs/base/common/errors'); import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; import { Registry } from 'vs/platform/registry/common/platform'; import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform'; import { Position as EditorPosition, IResourceDiffInput, IUntitledResourceInput, IEditor, IResourceInput } from 'vs/platform/editor/common/editor'; From 7bf5879ce094f61c3275e29b4f2ffd059f29fee6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 7 Nov 2017 18:55:59 +0100 Subject: [PATCH 29/88] tslint input for #37212 --- src/vs/base/browser/ui/findinput/findInput.ts | 3 +- src/vs/base/browser/ui/inputbox/inputBox.ts | 5 --- .../browser/ui/progressbar/progressbar.ts | 7 ---- src/vs/base/browser/ui/sash/sash.ts | 21 +++--------- src/vs/base/browser/ui/selectBox/selectBox.ts | 3 -- src/vs/base/common/async.ts | 3 +- .../parts/quickopen/common/quickOpenScorer.ts | 3 +- src/vs/code/electron-main/app.ts | 3 +- src/vs/code/electron-main/menus.ts | 6 ++-- src/vs/code/electron-main/windows.ts | 7 ++-- .../backup/electron-main/backupMainService.ts | 6 ++-- .../electron-main/backupMainService.test.ts | 4 +-- .../lifecycle/electron-main/lifecycleMain.ts | 3 -- .../browser/actions/workspaceActions.ts | 4 +-- src/vs/workbench/browser/part.ts | 3 +- .../parts/activitybar/activitybarPart.ts | 6 ---- .../browser/parts/editor/editorActions.ts | 2 -- .../browser/parts/editor/editorPicker.ts | 3 -- .../browser/parts/editor/editorStatus.ts | 2 -- .../browser/parts/editor/textDiffEditor.ts | 4 +-- .../browser/parts/editor/textEditor.ts | 10 ------ .../parts/editor/textResourceEditor.ts | 4 +-- .../parts/quickopen/quickOpenController.ts | 14 +------- src/vs/workbench/browser/quickopen.ts | 32 +------------------ src/vs/workbench/electron-browser/actions.ts | 5 --- src/vs/workbench/electron-browser/window.ts | 10 +----- .../workbench/electron-browser/workbench.ts | 3 -- .../files/browser/editors/textFileEditor.ts | 4 +-- .../files/browser/fileActions.contribution.ts | 8 +---- .../parts/files/browser/fileActions.ts | 12 +------ .../files/browser/fileResultsNavigation.ts | 5 --- .../parts/files/browser/files.contribution.ts | 7 +--- .../parts/files/browser/views/explorerView.ts | 7 ---- .../files/browser/views/explorerViewer.ts | 20 ++---------- .../files/common/editors/fileEditorTracker.ts | 10 ++---- .../parts/output/browser/outputPanel.ts | 4 +-- .../parts/output/browser/outputServices.ts | 4 +-- .../preferences/browser/preferencesEditor.ts | 7 ++-- .../quickopen/browser/commandsHandler.ts | 29 +---------------- .../relauncher.contribution.ts | 3 -- .../parts/search/browser/openFileHandler.ts | 2 -- .../search/browser/patternInputWidget.ts | 3 +- .../services/backup/node/backupFileService.ts | 4 +-- .../test/node/backupFileService.test.ts | 14 -------- .../editor/test/browser/editorService.test.ts | 3 -- .../services/history/browser/history.ts | 4 --- .../common/textModelResolverService.ts | 2 -- .../test/browser/actionRegistry.test.ts | 8 ----- .../parts/editor/editorStacksModel.test.ts | 2 +- .../common/editor/editorDiffModel.test.ts | 7 ---- .../workbench/test/workbenchTestServices.ts | 5 +-- 51 files changed, 43 insertions(+), 307 deletions(-) diff --git a/src/vs/base/browser/ui/findinput/findInput.ts b/src/vs/base/browser/ui/findinput/findInput.ts index 958297431e2..fe0788dbf3a 100644 --- a/src/vs/base/browser/ui/findinput/findInput.ts +++ b/src/vs/base/browser/ui/findinput/findInput.ts @@ -268,8 +268,7 @@ export class FindInput extends Widget { placeholder: this.placeholder || '', ariaLabel: this.label || '', validationOptions: { - validation: this.validation || null, - showMessage: true + validation: this.validation || null }, inputBackground: this.inputBackground, inputForeground: this.inputForeground, diff --git a/src/vs/base/browser/ui/inputbox/inputBox.ts b/src/vs/base/browser/ui/inputbox/inputBox.ts index c93367a5518..8dfb882931c 100644 --- a/src/vs/base/browser/ui/inputbox/inputBox.ts +++ b/src/vs/base/browser/ui/inputbox/inputBox.ts @@ -54,7 +54,6 @@ export interface IMessage { export interface IInputValidationOptions { validation: IInputValidator; - showMessage?: boolean; } export enum MessageType { @@ -90,8 +89,6 @@ export class InputBox extends Widget { private placeholder: string; private ariaLabel: string; private validation: IInputValidator; - // @ts-ignore unused property - private showValidationMessage: boolean; private state = 'idle'; private cachedHeight: number; @@ -136,7 +133,6 @@ export class InputBox extends Widget { if (this.options.validationOptions) { this.validation = this.options.validationOptions.validation; - this.showValidationMessage = this.options.validationOptions.showMessage || false; } this.element = dom.append(container, $('.monaco-inputbox.idle')); @@ -498,7 +494,6 @@ export class InputBox extends Widget { this.placeholder = null; this.ariaLabel = null; this.validation = null; - this.showValidationMessage = null; this.state = null; this.actionbar = null; diff --git a/src/vs/base/browser/ui/progressbar/progressbar.ts b/src/vs/base/browser/ui/progressbar/progressbar.ts index ac24174cc72..19e5657414c 100644 --- a/src/vs/base/browser/ui/progressbar/progressbar.ts +++ b/src/vs/base/browser/ui/progressbar/progressbar.ts @@ -40,8 +40,6 @@ export class ProgressBar { private toUnbind: IDisposable[]; private workedVal: number; private element: Builder; - // @ts-ignore unused property - private animationRunning: boolean; private bit: HTMLElement; private totalWork: number; private animationStopToken: ValueCallback; @@ -65,11 +63,6 @@ export class ProgressBar { builder.div({ 'class': css_progress_bit }).on([DOM.EventType.ANIMATION_START, DOM.EventType.ANIMATION_END, DOM.EventType.ANIMATION_ITERATION], (e: Event) => { switch (e.type) { - case DOM.EventType.ANIMATION_START: - case DOM.EventType.ANIMATION_END: - this.animationRunning = e.type === DOM.EventType.ANIMATION_START; - break; - case DOM.EventType.ANIMATION_ITERATION: if (this.animationStopToken) { this.animationStopToken(null); diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index cd0de3f9b84..22947e67d88 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -51,7 +51,6 @@ export enum Orientation { export class Sash extends EventEmitter { private $e: Builder; - // @ts-ignore unused property private gesture: Gesture; private layoutProvider: ISashLayoutProvider; private isDisabled: boolean; @@ -141,10 +140,6 @@ export class Sash extends EventEmitter { let $window = $(window); let containerCSSClass = `${this.getOrientation()}-cursor-container${isMacintosh ? '-mac' : ''}`; - // @ts-ignore unused local - let lastCurrentX = startX; - // @ts-ignore unused local - let lastCurrentY = startY; $window.on('mousemove', (e) => { DOM.EventHelper.stop(e, false); @@ -157,9 +152,6 @@ export class Sash extends EventEmitter { currentY: mouseMoveEvent.posy }; - lastCurrentX = mouseMoveEvent.posx; - lastCurrentY = mouseMoveEvent.posy; - this.emit('change', event); }).once('mouseup', (e) => { DOM.EventHelper.stop(e, false); @@ -193,11 +185,6 @@ export class Sash extends EventEmitter { currentY: startY }); - // @ts-ignore unused local - let lastCurrentX = startX; - // @ts-ignore unused local - let lastCurrentY = startY; - listeners.push(DOM.addDisposableListener(this.$e.getHTMLElement(), EventType.Change, (event: GestureEvent) => { if (types.isNumber(event.pageX) && types.isNumber(event.pageY)) { this.emit('change', { @@ -206,9 +193,6 @@ export class Sash extends EventEmitter { startY: startY, currentY: event.pageY }); - - lastCurrentX = event.pageX; - lastCurrentY = event.pageY; } })); @@ -282,6 +266,11 @@ export class Sash extends EventEmitter { this.$e = null; } + if (this.gesture) { + this.gesture.dispose(); + this.gesture = null; + } + super.dispose(); } } diff --git a/src/vs/base/browser/ui/selectBox/selectBox.ts b/src/vs/base/browser/ui/selectBox/selectBox.ts index 186ba115671..76e76cd5be3 100644 --- a/src/vs/base/browser/ui/selectBox/selectBox.ts +++ b/src/vs/base/browser/ui/selectBox/selectBox.ts @@ -36,8 +36,6 @@ export class SelectBox extends Widget { private selectElement: HTMLSelectElement; private options: string[]; private selected: number; - // @ts-ignore unused property - private container: HTMLElement; private _onDidSelect: Emitter; private toDispose: IDisposable[]; private selectBackground: Color; @@ -114,7 +112,6 @@ export class SelectBox extends Widget { } public render(container: HTMLElement): void { - this.container = container; dom.addClass(container, 'select-container'); container.appendChild(this.selectElement); this.setOptions(this.options, this.selected); diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index cc2749f492a..37c69b0f5bd 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -510,8 +510,7 @@ export class Queue extends Limiter { * A helper to organize queues per resource. The ResourceQueue makes sure to manage queues per resource * by disposing them once the queue is empty. */ -// @ts-ignore unused generic parameter -export class ResourceQueue { +export class ResourceQueue { private queues: { [path: string]: Queue }; constructor() { diff --git a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts index 4ab821398e6..75b33c6ebf6 100644 --- a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts +++ b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts @@ -352,8 +352,7 @@ export function scoreItem(item: T, query: IPreparedQuery, fuzzy: boolean, acc return itemScore; } -// @ts-ignore unused generic parameter -function doScoreItem(label: string, description: string, path: string, query: IPreparedQuery, fuzzy: boolean): IItemScore { +function doScoreItem(label: string, description: string, path: string, query: IPreparedQuery, fuzzy: boolean): IItemScore { // 1.) treat identity matches on full path highest if (path && isEqual(query.value, path, true)) { diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 7c67597e716..5683665f46b 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -76,8 +76,7 @@ export class CodeApplication { @ILogService private logService: ILogService, @IEnvironmentService private environmentService: IEnvironmentService, @ILifecycleService private lifecycleService: ILifecycleService, - // @ts-ignore unused injected service - @IConfigurationService private configurationService: ConfigurationService, + @IConfigurationService configurationService: ConfigurationService, @IStorageService private storageService: IStorageService, @IHistoryMainService private historyService: IHistoryMainService ) { diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index b9932b45ceb..9d48e22e95d 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -22,7 +22,7 @@ import { mnemonicMenuLabel as baseMnemonicLabel, unmnemonicLabel, getPathLabel } import { KeybindingsResolver } from 'vs/code/electron-main/keyboard'; import { IWindowsMainService, IWindowsCountChangedEvent } from 'vs/platform/windows/electron-main/windows'; import { IHistoryMainService } from 'vs/platform/history/common/history'; -import { IWorkspaceIdentifier, IWorkspacesMainService, getWorkspaceLabel, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; +import { IWorkspaceIdentifier, getWorkspaceLabel, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; interface IExtensionViewlet { id: string; @@ -71,9 +71,7 @@ export class CodeMenu { @IWindowsMainService private windowsService: IWindowsMainService, @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, - @IHistoryMainService private historyService: IHistoryMainService, - // @ts-ignore unused injected service - @IWorkspacesMainService private workspacesService: IWorkspacesMainService + @IHistoryMainService private historyService: IHistoryMainService ) { this.extensionViewlets = []; this.nativeTabMenuItems = []; diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index d3704cd95b8..f0d030a42ef 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -143,8 +143,7 @@ export class WindowsManager implements IWindowsMainService { @IEnvironmentService private environmentService: IEnvironmentService, @ILifecycleService private lifecycleService: ILifecycleService, @IBackupMainService private backupService: IBackupMainService, - // @ts-ignore unused injected service - @ITelemetryService private telemetryService: ITelemetryService, + @ITelemetryService telemetryService: ITelemetryService, @IConfigurationService private configurationService: IConfigurationService, @IHistoryMainService private historyService: IHistoryMainService, @IWorkspacesMainService private workspacesService: IWorkspacesMainService, @@ -153,7 +152,7 @@ export class WindowsManager implements IWindowsMainService { this.windowsState = this.storageService.getItem(WindowsManager.windowsStateStorageKey) || { openedWindows: [] }; this.fileDialog = new FileDialog(environmentService, telemetryService, storageService, this); - this.workspacesManager = new WorkspacesManager(workspacesService, lifecycleService, backupService, environmentService, this); + this.workspacesManager = new WorkspacesManager(workspacesService, backupService, environmentService, this); this.migrateLegacyWindowState(); } @@ -1673,8 +1672,6 @@ class WorkspacesManager { constructor( private workspacesService: IWorkspacesMainService, - // @ts-ignore unused injected service - private lifecycleService: ILifecycleService, private backupService: IBackupMainService, private environmentService: IEnvironmentService, private windowsMainService: IWindowsMainService diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index 0c23b2c208d..ceb1a0e5cbc 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -14,7 +14,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFilesConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; -import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspacesMainService, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; +import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; export class BackupMainService implements IBackupMainService { @@ -28,9 +28,7 @@ export class BackupMainService implements IBackupMainService { constructor( @IEnvironmentService environmentService: IEnvironmentService, @IConfigurationService private configurationService: IConfigurationService, - @ILogService private logService: ILogService, - // @ts-ignore unused injected service - @IWorkspacesMainService private workspacesService: IWorkspacesMainService + @ILogService private logService: ILogService ) { this.backupHome = environmentService.backupHome; this.workspacesJsonPath = environmentService.backupWorkspacesPath; diff --git a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts index 96f8242c326..ae7618cefd3 100644 --- a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts +++ b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts @@ -22,7 +22,6 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/ import { LogMainService } from 'vs/platform/log/common/log'; import { IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { createHash } from 'crypto'; -import { WorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService'; import { getRandomTestPath } from 'vs/workbench/test/workbenchTestServices'; suite('BackupMainService', () => { @@ -31,12 +30,11 @@ suite('BackupMainService', () => { const backupWorkspacesPath = path.join(backupHome, 'workspaces.json'); const environmentService = new EnvironmentService(parseArgs(process.argv), process.execPath); - const logService = new LogMainService(environmentService); class TestBackupMainService extends BackupMainService { constructor(backupHome: string, backupWorkspacesPath: string, configService: TestConfigurationService) { - super(environmentService, configService, new LogMainService(environmentService), new WorkspacesMainService(environmentService, logService)); + super(environmentService, configService, new LogMainService(environmentService)); this.backupHome = backupHome; this.workspacesJsonPath = backupWorkspacesPath; diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 50dc285444f..28bf62c5654 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -7,7 +7,6 @@ import { ipcMain as ipc, app } from 'electron'; import { TPromise, TValueCallback } from 'vs/base/common/winjs.base'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; import { IStorageService } from 'vs/platform/storage/node/storage'; import Event, { Emitter } from 'vs/base/common/event'; @@ -94,8 +93,6 @@ export class LifecycleService implements ILifecycleService { onBeforeWindowUnload: Event = this._onBeforeWindowUnload.event; constructor( - // @ts-ignore unused injected service - @IEnvironmentService private environmentService: IEnvironmentService, @ILogService private logService: ILogService, @IStorageService private storageService: IStorageService ) { diff --git a/src/vs/workbench/browser/actions/workspaceActions.ts b/src/vs/workbench/browser/actions/workspaceActions.ts index 3c394c6ff8f..07f7c530ddc 100644 --- a/src/vs/workbench/browser/actions/workspaceActions.ts +++ b/src/vs/workbench/browser/actions/workspaceActions.ts @@ -14,7 +14,7 @@ import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/p import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; import URI from 'vs/base/common/uri'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { WORKSPACE_FILTER, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { isLinux } from 'vs/base/common/platform'; @@ -204,8 +204,6 @@ export class AddRootFolderAction extends BaseWorkspacesAction { @IWindowService windowService: IWindowService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IEnvironmentService environmentService: IEnvironmentService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IViewletService private viewletService: IViewletService, @IHistoryService historyService: IHistoryService diff --git a/src/vs/workbench/browser/part.ts b/src/vs/workbench/browser/part.ts index edecfa020ee..ad324177d50 100644 --- a/src/vs/workbench/browser/part.ts +++ b/src/vs/workbench/browser/part.ts @@ -111,8 +111,7 @@ const TITLE_HEIGHT = 35; export class PartLayout { - // @ts-ignore unused property - constructor(private container: Builder, private options: IPartOptions, private titleArea: Builder, private contentArea: Builder) { + constructor(container: Builder, private options: IPartOptions, titleArea: Builder, private contentArea: Builder) { } public layout(dimension: Dimension): Dimension[] { diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index c75fb219d65..299431306fe 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -20,8 +20,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IBadge } from 'vs/workbench/services/activity/common/activity'; import { IPartService, Position as SideBarPosition } from 'vs/workbench/services/part/common/partService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { IStorageService } from 'vs/platform/storage/common/storage'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; @@ -54,10 +52,6 @@ export class ActivitybarPart extends Part { constructor( id: string, @IViewletService private viewletService: IViewletService, - // @ts-ignore unused injected service - @IExtensionService private extensionService: IExtensionService, - // @ts-ignore unused injected service - @IStorageService private storageService: IStorageService, @IContextMenuService private contextMenuService: IContextMenuService, @IInstantiationService private instantiationService: IInstantiationService, @IPartService private partService: IPartService, diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index dd3cce2d126..7dce52b6198 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -113,8 +113,6 @@ export class JoinTwoGroupsAction extends Action { constructor( id: string, label: string, - // @ts-ignore unused injected service - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorGroupService: IEditorGroupService ) { super(id, label); diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index 188ae01b8f4..979df653a59 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -20,7 +20,6 @@ import { Position } from 'vs/platform/editor/common/editor'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EditorInput, toResource, IEditorGroup, IEditorStacksModel } from 'vs/workbench/common/editor'; import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer'; @@ -91,8 +90,6 @@ export abstract class BaseEditorPicker extends QuickOpenHandler { constructor( @IInstantiationService protected instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkbenchEditorService protected editorService: IWorkbenchEditorService, @IEditorGroupService protected editorGroupService: IEditorGroupService ) { diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 227c1aa57d7..28dcafe4a0f 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -795,8 +795,6 @@ export class ChangeModeAction extends Action { @IQuickOpenService private quickOpenService: IQuickOpenService, @IPreferencesService private preferencesService: IPreferencesService, @IInstantiationService private instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @ICommandService private commandService: ICommandService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService ) { super(actionId, actionLabel); diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 641e62414b7..bfc099a30fb 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -31,7 +31,6 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IWorkbenchEditorService, DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IEditorInput } from 'vs/platform/editor/common/editor'; import { ScrollType } from 'vs/editor/common/editorCommon'; @@ -55,10 +54,9 @@ export class TextDiffEditor extends BaseTextEditor { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService ) { - super(TextDiffEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); + super(TextDiffEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService); } public getTitle(): string { diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 9ef9310354f..dc250322285 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -24,7 +24,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Scope } from 'vs/workbench/common/memento'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService, SaveReason, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; @@ -32,13 +31,6 @@ import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; const TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY = 'textEditorViewState'; -// @ts-ignore unused type -interface ITextEditorViewState { - 0?: IEditorViewState; - 1?: IEditorViewState; - 2?: IEditorViewState; -} - export interface IEditorConfiguration { editor: object; diffEditor: object; @@ -61,8 +53,6 @@ export abstract class BaseTextEditor extends BaseEditor { @IStorageService private storageService: IStorageService, @ITextResourceConfigurationService private _configurationService: ITextResourceConfigurationService, @IThemeService protected themeService: IThemeService, - // @ts-ignore unused injected service - @IModeService private modeService: IModeService, @ITextFileService private _textFileService: ITextFileService, @IEditorGroupService protected editorGroupService: IEditorGroupService ) { diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index 7d723508d2a..cfabfc41b0e 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -20,7 +20,6 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { once } from 'vs/base/common/event'; import { ScrollType } from 'vs/editor/common/editorCommon'; @@ -40,10 +39,9 @@ export class TextResourceEditor extends BaseTextEditor { @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService ) { - super(TextResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); + super(TextResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService); } public getTitle(): string { diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index 69b64066d51..d40e65a496d 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -98,8 +98,6 @@ export class QuickOpenController extends Component implements IQuickOpenService private promisesToCompleteOnHide: ValueCallback[]; private previousActiveHandlerDescriptor: QuickOpenHandlerDescriptor; private actionProvider = new ContributableActionProvider(); - // @ts-ignore unused property - private previousValue = ''; private visibilityChangeTimeoutHandle: number; private closeOnFocusLost: boolean; private editorHistoryHandler: EditorHistoryHandler; @@ -108,12 +106,8 @@ export class QuickOpenController extends Component implements IQuickOpenService @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IMessageService private messageService: IMessageService, @ITelemetryService private telemetryService: ITelemetryService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, - // @ts-ignore unused injected service - @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService, @IPartService private partService: IPartService, @IListService private listService: IListService, @@ -554,8 +548,6 @@ export class QuickOpenController extends Component implements IQuickOpenService let inputSelection = options ? options.inputSelection : void 0; let autoFocus = options ? options.autoFocus : void 0; - this.previousValue = prefix; - const promiseCompletedOnHide = new TPromise(c => { this.promisesToCompleteOnHide.push(c); }); @@ -750,7 +742,6 @@ export class QuickOpenController extends Component implements IQuickOpenService } private onType(value: string): void { - this.previousValue = value; // look for a handler const registry = Registry.as(Extensions.Quickopen); @@ -1179,8 +1170,6 @@ class EditorHistoryHandler { constructor( @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, @IFileService private fileService: IFileService ) { this.scorerCache = Object.create(null); @@ -1269,8 +1258,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { @IWorkspaceContextService contextService: IWorkspaceContextService, @IConfigurationService private configurationService: IConfigurationService, @IEnvironmentService environmentService: IEnvironmentService, - // @ts-ignore unused injected service - @IFileService private fileService: IFileService + @IFileService fileService: IFileService ) { super(editorService); diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 9b817365a28..7921f37fff7 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -15,7 +15,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { KeyMod } from 'vs/base/common/keyCodes'; import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenEntry, IHighlight, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { QuickOpenEntry, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { EditorOptions, EditorInput } from 'vs/workbench/common/editor'; import { IResourceInput, IEditorInput, IEditorOptions } from 'vs/platform/editor/common/editor'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -323,36 +323,6 @@ export interface ICommand { icon?: string; } -// @ts-ignore unused type -class CommandEntry extends QuickOpenEntry { - - constructor(private quickOpenService: IQuickOpenService, private prefix: string, private command: ICommand, highlights: IHighlight[]) { - super(highlights); - this.command = command; - } - - public getIcon(): string { - return this.command.icon || null; - } - - public getLabel(): string { - return this.command.aliases[0]; - } - - public getAriaLabel(): string { - return nls.localize('entryAriaLabel', "{0}, command", this.getLabel()); - } - - public run(mode: Mode, context: IEntryRunContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - this.quickOpenService.show(`${this.prefix} ${this.command.aliases[0]} `); - return false; - } -} - export interface ICommandQuickOpenHandlerOptions { prefix: string; commands: ICommand[]; diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 09829d7922c..1cca1e27f11 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -156,8 +156,6 @@ export class ToggleMenuBarAction extends Action { constructor( id: string, label: string, - // @ts-ignore unused injected service - @IMessageService private messageService: IMessageService, @IConfigurationService private configurationService: IConfigurationService ) { super(id, label); @@ -342,12 +340,9 @@ export class ShowStartupPerformance extends Action { console.log(`Empty Workspace: ${metrics.emptyWorkbench}`); let nodeModuleLoadTime: number; - // @ts-ignore unused local - let nodeModuleLoadDetails: any[]; if (this.environmentService.performance) { const nodeModuleTimes = this.analyzeNodeModulesLoadTimes(); nodeModuleLoadTime = nodeModuleTimes.duration; - nodeModuleLoadDetails = nodeModuleTimes.table; } (console).table(this.getStartupMetricsTable(nodeModuleLoadTime)); diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index a978e2e1651..6e7206117f5 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -27,7 +27,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IWindowsService, IWindowService, IWindowSettings, IPath, IOpenFileRequest, IWindowsConfiguration, IAddFoldersRequest, IRunActionInWindowRequest } from 'vs/platform/windows/common/windows'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ITitleService } from 'vs/workbench/services/title/common/titleService'; import { IWorkbenchThemeService, VS_HC_THEME, VS_DARK_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService'; @@ -39,7 +38,6 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; import { Themable } from 'vs/workbench/common/theme'; import { ipcRenderer as ipc, webFrame } from 'electron'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; import { IMenuService, MenuId, IMenu, MenuItemAction, ICommandAction } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -86,16 +84,10 @@ export class ElectronWindow extends Themable { @IViewletService private viewletService: IViewletService, @IContextMenuService private contextMenuService: IContextMenuService, @IKeybindingService private keybindingService: IKeybindingService, - // @ts-ignore unused injected service - @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IFileService private fileService: IFileService, - @IMenuService private menuService: IMenuService, - // @ts-ignore unused injected service - @IContextKeyService private contextKeyService: IContextKeyService + @IMenuService private menuService: IMenuService ) { super(themeService); diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 0ac0123c767..3216812ad1e 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -87,7 +87,6 @@ import { IMenuService, SyncActionDescriptor } from 'vs/platform/actions/common/a import { MenuService } from 'vs/platform/actions/common/menuService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; import { OpenRecentAction, ToggleDevToolsAction, ReloadWindowAction, ShowPreviousWindowTab, MoveWindowTabToNewWindow, MergeAllWindowTabs, ShowNextWindowTab, ToggleWindowTabsBar } from 'vs/workbench/electron-browser/actions'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; @@ -223,8 +222,6 @@ export class Workbench implements IPartService { @IStorageService private storageService: IStorageService, @IMessageService private messageService: IMessageService, @IConfigurationService private configurationService: WorkspaceService, - // @ts-ignore unused injected service - @ITelemetryService private telemetryService: ITelemetryService, @IEnvironmentService private environmentService: IEnvironmentService, @IWindowService private windowService: IWindowService ) { diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index b60b3bce030..b607ba93761 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -29,7 +29,6 @@ import { CancelAction } from 'vs/platform/message/common/message'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ScrollType } from 'vs/editor/common/editorCommon'; /** @@ -50,10 +49,9 @@ export class TextFileEditor extends BaseTextEditor { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, ) { - super(TextFileEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); + super(TextFileEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService); // Clear view state for deleted files this.toUnbind.push(this.fileService.onFileChanges(e => this.onFilesChanged(e))); diff --git a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts index a87932a839f..2dddb2c5105 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts @@ -14,7 +14,6 @@ import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTI import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { FileStat, Model } from 'vs/workbench/parts/files/common/explorerModel'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; @@ -23,18 +22,13 @@ import { copyFocusedFilesExplorerViewItem, revealInOSFocusedFilesExplorerItem, o import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { explorerItemToFileResource, ExplorerFocusCondition, FilesExplorerFocusCondition } from 'vs/workbench/parts/files/common/files'; class FilesViewerActionContributor extends ActionBarContributor { constructor( @IInstantiationService private instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IKeybindingService private keybindingService: IKeybindingService, - // @ts-ignore unused injected service - @IEnvironmentService private environmentService: IEnvironmentService + @IKeybindingService private keybindingService: IKeybindingService ) { super(); } diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index 4e9c5a2a19d..ccc0d2ba899 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -1878,11 +1878,7 @@ export class GlobalRevealInOSAction extends Action { constructor( id: string, label: string, - // @ts-ignore unused injected service - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IInstantiationService private instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IMessageService private messageService: IMessageService + @IInstantiationService private instantiationService: IInstantiationService ) { super(id, label); } @@ -1922,12 +1918,6 @@ export class GlobalCopyPathAction extends Action { constructor( id: string, label: string, - // @ts-ignore unused injected service - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - // @ts-ignore unused injected service - @IEditorGroupService private editorGroupService: IEditorGroupService, - // @ts-ignore unused injected service - @IMessageService private messageService: IMessageService, @IInstantiationService private instantiationService: IInstantiationService ) { super(id, label); diff --git a/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts b/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts index c88a5742191..9174477d966 100644 --- a/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts +++ b/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { Disposable } from 'vs/base/common/lifecycle'; -import { Throttler } from 'vs/base/common/async'; import Event, { Emitter } from 'vs/base/common/event'; import { IEditorOptions } from 'vs/platform/editor/common/editor'; import { ITree } from 'vs/base/parts/tree/browser/tree'; @@ -21,12 +20,8 @@ export default class FileResultsNavigation extends Disposable { private _openFile: Emitter = new Emitter(); public readonly openFile: Event = this._openFile.event; - // @ts-ignore unused property - private throttler: Throttler; - constructor(private tree: ITree) { super(); - this.throttler = new Throttler(); this._register(this.tree.addListener('focus', e => this.onFocus(e))); this._register(this.tree.addListener('selection', e => this.onSelection(e))); } diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index 38eac0fa753..15b4a09a9fa 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -29,7 +29,6 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import * as platform from 'vs/base/common/platform'; import { DirtyFilesTracker } from 'vs/workbench/parts/files/common/dirtyFilesTracker'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { ExplorerViewlet } from 'vs/workbench/parts/files/browser/explorerViewlet'; import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; @@ -110,11 +109,7 @@ interface ISerializedFileInput { // Register Editor Input Factory class FileEditorInputFactory implements IEditorInputFactory { - constructor( - // @ts-ignore unused injected service - @ITextResourceConfigurationService private configurationService: ITextResourceConfigurationService - ) { - } + constructor() { } public serialize(editorInput: EditorInput): string { const fileEditorInput = editorInput; diff --git a/src/vs/workbench/parts/files/browser/views/explorerView.ts b/src/vs/workbench/parts/files/browser/views/explorerView.ts index c756a441c10..0969df39c49 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerView.ts @@ -44,7 +44,6 @@ import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/c import { ResourceContextKey, ResourceGlobMatcher } from 'vs/workbench/common/resources'; import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { isLinux } from 'vs/base/common/platform'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IDecorationsService } from 'vs/workbench/services/decorations/browser/decorations'; @@ -57,7 +56,6 @@ export class ExplorerView extends ViewsViewletPanel { public static ID: string = 'workbench.explorer.fileView'; private static EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first private static EXPLORER_FILE_CHANGES_REFRESH_DELAY = 100; // delay in ms to refresh the explorer from disk file changes - private static EXPLORER_IMPORT_REFRESH_DELAY = 300; // delay in ms to refresh the explorer from imports private static MEMENTO_LAST_ACTIVE_FILE_RESOURCE = 'explorer.memento.lastActiveFileResource'; private static MEMENTO_EXPANDED_FOLDER_RESOURCES = 'explorer.memento.expandedFolderResources'; @@ -69,8 +67,6 @@ export class ExplorerView extends ViewsViewletPanel { private viewletState: FileViewletState; private explorerRefreshDelayer: ThrottledDelayer; - // @ts-ignore unused property - private explorerImportDelayer: ThrottledDelayer; private resourceContext: ResourceContextKey; private folderContext: IContextKey; @@ -101,8 +97,6 @@ export class ExplorerView extends ViewsViewletPanel { @IContextKeyService contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, @IWorkbenchThemeService private themeService: IWorkbenchThemeService, - // @ts-ignore unused injected service - @IEnvironmentService private environmentService: IEnvironmentService, @IDecorationsService decorationService: IDecorationsService ) { super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService); @@ -112,7 +106,6 @@ export class ExplorerView extends ViewsViewletPanel { this.autoReveal = true; this.explorerRefreshDelayer = new ThrottledDelayer(ExplorerView.EXPLORER_FILE_CHANGES_REFRESH_DELAY); - this.explorerImportDelayer = new ThrottledDelayer(ExplorerView.EXPLORER_IMPORT_REFRESH_DELAY); this.resourceContext = instantiationService.createInstance(ResourceContextKey); this.folderContext = ExplorerFolderContext.bindTo(contextKeyService); diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index 3c37d29c972..6b80e582f28 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -53,7 +53,6 @@ import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { getPathLabel } from 'vs/base/common/labels'; import { extractResources } from 'vs/workbench/browser/editor'; @@ -62,9 +61,7 @@ export class FileDataSource implements IDataSource { @IProgressService private progressService: IProgressService, @IMessageService private messageService: IMessageService, @IFileService private fileService: IFileService, - @IPartService private partService: IPartService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IPartService private partService: IPartService ) { } public getId(tree: ITree, stat: FileStat | Model): string { @@ -353,8 +350,7 @@ export class FileRenderer implements IRenderer { // Input field for name const inputBox = new InputBox(label.element, this.contextViewService, { validationOptions: { - validation: editableData.validator, - showMessage: true + validation: editableData.validator }, ariaLabel: nls.localize('fileInputAriaLabel', "Type file name. Press Enter to confirm or Escape to cancel.") }); @@ -426,11 +422,7 @@ export class FileController extends DefaultController { constructor(state: FileViewletState, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IContextMenuService private contextMenuService: IContextMenuService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService, @ITelemetryService private telemetryService: ITelemetryService, - // @ts-ignore unused injected service - @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMenuService menuService: IMenuService, @IContextKeyService contextKeyService: IContextKeyService ) { @@ -754,9 +746,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { @ITextFileService private textFileService: ITextFileService, @IBackupFileService private backupFileService: IBackupFileService, @IWindowService private windowService: IWindowService, - @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, - // @ts-ignore unused injected service - @IEnvironmentService private environmentService: IEnvironmentService + @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService ) { super(stat => this.statToResource(stat)); @@ -1035,15 +1025,11 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { // 3.) run the move operation .then(() => { const targetResource = target.resource.with({ path: paths.join(target.resource.path, source.name) }); - // @ts-ignore unused local - let didHandleConflict = false; return this.fileService.moveFile(source.resource, targetResource).then(null, error => { // Conflict if ((error).fileOperationResult === FileOperationResult.FILE_MOVE_CONFLICT) { - didHandleConflict = true; - const confirm: IConfirmation = { message: nls.localize('confirmOverwriteMessage', "'{0}' already exists in the destination folder. Do you want to replace it?", source.name), detail: nls.localize('irreversible', "This action is irreversible!"), diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts index dd6ff6045af..771cde62269 100644 --- a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts +++ b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts @@ -10,8 +10,7 @@ import errors = require('vs/base/common/errors'); import URI from 'vs/base/common/uri'; import paths = require('vs/base/common/paths'); import { IEditorViewState, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; -// @ts-ignore unused import -import { toResource, IEditorStacksModel, SideBySideEditorInput, IEditorGroup, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; +import { toResource, SideBySideEditorInput, IEditorGroup, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent, indexOf } from 'vs/platform/files/common/files'; @@ -32,9 +31,8 @@ export class FileEditorTracker implements IWorkbenchContribution { protected closeOnFileDelete: boolean; - // @ts-ignore unused propertyprivate stacks: IEditorStacksModel; private toUnbind: IDisposable[]; - private modelLoadQueue: ResourceQueue; + private modelLoadQueue: ResourceQueue; private activeOutOfWorkspaceWatchers: ResourceMap; constructor( @@ -48,9 +46,7 @@ export class FileEditorTracker implements IWorkbenchContribution { @IWorkspaceContextService private contextService: IWorkspaceContextService, ) { this.toUnbind = []; - // @ts-ignore unused property - this.stacks = editorGroupService.getStacksModel(); - this.modelLoadQueue = new ResourceQueue(); + this.modelLoadQueue = new ResourceQueue(); this.activeOutOfWorkspaceWatchers = new ResourceMap(); this.onConfigurationUpdated(configurationService.getConfiguration()); diff --git a/src/vs/workbench/parts/output/browser/outputPanel.ts b/src/vs/workbench/parts/output/browser/outputPanel.ts index 811e8d69a05..73c2d9a89be 100644 --- a/src/vs/workbench/parts/output/browser/outputPanel.ts +++ b/src/vs/workbench/parts/output/browser/outputPanel.ts @@ -22,7 +22,6 @@ import { OutputEditors, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } fro import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOutputScrollLockAction } from 'vs/workbench/parts/output/browser/outputActions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; export class OutputPanel extends TextResourceEditor { @@ -38,10 +37,9 @@ export class OutputPanel extends TextResourceEditor { @IOutputService private outputService: IOutputService, @IContextKeyService private contextKeyService: IContextKeyService, @IEditorGroupService editorGroupService: IEditorGroupService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService ) { - super(telemetryService, instantiationService, storageService, configurationService, themeService, editorGroupService, modeService, textFileService); + super(telemetryService, instantiationService, storageService, configurationService, themeService, editorGroupService, textFileService); this.scopedInstantiationService = instantiationService; } diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index 04c8ec3ff4a..37aa71b666d 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -91,8 +91,6 @@ export class OutputService implements IOutputService { private _onOutputChannel: Emitter; private _onActiveOutputChannel: Emitter; - // @ts-ignore unused property - private _outputLinkDetector: OutputLinkProvider; private _outputContentProvider: OutputContentProvider; private _outputPanel: OutputPanel; @@ -111,7 +109,7 @@ export class OutputService implements IOutputService { const channels = this.getChannels(); this.activeChannelId = this.storageService.get(OUTPUT_ACTIVE_CHANNEL_KEY, StorageScope.WORKSPACE, channels && channels.length > 0 ? channels[0].id : null); - this._outputLinkDetector = instantiationService.createInstance(OutputLinkProvider); + instantiationService.createInstance(OutputLinkProvider); this._outputContentProvider = instantiationService.createInstance(OutputContentProvider, this); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 2171e3dfc72..1acd6036909 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -36,7 +36,6 @@ import { Command } from 'vs/editor/common/editorCommonExtensions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -708,11 +707,10 @@ export class EditableSettingsEditor extends BaseTextEditor { @IPreferencesService private preferencesService: IPreferencesService, // @ts-ignore unused injected service @IModelService private modelService: IModelService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, @IEditorGroupService editorGroupService: IEditorGroupService ) { - super(EditableSettingsEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); + super(EditableSettingsEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService); this._register({ dispose: () => dispose(this.modelDisposables) }); this.saveDelayer = new Delayer(1000); } @@ -782,11 +780,10 @@ export class DefaultPreferencesEditor extends BaseTextEditor { @IPreferencesService private preferencesService: IPreferencesService, // @ts-ignore unused injected service @IModelService private modelService: IModelService, - @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, @IEditorGroupService editorGroupService: IEditorGroupService ) { - super(DefaultPreferencesEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); + super(DefaultPreferencesEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService); } public createEditorControl(parent: Builder, configuration: IEditorOptions): editorCommon.IEditor { diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index 41fcdfc26d3..2148ec88e17 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -14,7 +14,7 @@ import { Action } from 'vs/base/common/actions'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntryGroup, IHighlight, QuickOpenModel, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { SyncActionDescriptor, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; +import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { QuickOpenHandler, IWorkbenchQuickOpenConfiguration } from 'vs/workbench/browser/quickopen'; import { IEditorAction, IEditor, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; @@ -157,8 +157,6 @@ export class ClearCommandHistoryAction extends Action { constructor( id: string, label: string, - // @ts-ignore unused injected service - @IStorageService private storageService: IStorageService, @IConfigurationService private configurationService: IConfigurationService ) { super(id, label); @@ -324,29 +322,6 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { } } -// @ts-ignore unused type -class CommandEntry extends BaseCommandEntry { - - constructor( - commandId: string, - keybinding: ResolvedKeybinding, - label: string, - meta: string, - highlights: { label: IHighlight[], alias: IHighlight[] }, - private actionDescriptor: SyncActionDescriptor, - onBeforeRun: (commandId: string) => void, - @IInstantiationService private instantiationService: IInstantiationService, - @IMessageService messageService: IMessageService, - @ITelemetryService telemetryService: ITelemetryService - ) { - super(commandId, keybinding, label, meta, highlights, onBeforeRun, messageService, telemetryService); - } - - protected getAction(): Action | IEditorAction { - return this.instantiationService.createInstance(this.actionDescriptor.syncDescriptor); - } -} - class EditorActionCommandEntry extends BaseCommandEntry { constructor( @@ -405,8 +380,6 @@ export class CommandsHandler extends QuickOpenHandler { @IInstantiationService private instantiationService: IInstantiationService, @IKeybindingService private keybindingService: IKeybindingService, @IMenuService private menuService: IMenuService, - // @ts-ignore unused injected service - @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService ) { super(); diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index 81a4923534a..9f0570fbc06 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -9,7 +9,6 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { Registry } from 'vs/platform/registry/common/platform'; import { IMessageService } from 'vs/platform/message/common/message'; -import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; import { IWindowsService, IWindowService, IWindowsConfiguration } from 'vs/platform/windows/common/windows'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { localize } from 'vs/nls'; @@ -44,8 +43,6 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { @IWindowsService private windowsService: IWindowsService, @IWindowService private windowService: IWindowService, @IConfigurationService private configurationService: IConfigurationService, - // @ts-ignore unused injected service - @IPreferencesService private preferencesService: IPreferencesService, @IEnvironmentService private envService: IEnvironmentService, @IMessageService private messageService: IMessageService, @IWorkspaceContextService private contextService: IWorkspaceContextService, diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 9f6881f0c8a..0c72fa5787d 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -123,8 +123,6 @@ export class OpenFileHandler extends QuickOpenHandler { @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @ISearchService private searchService: ISearchService, - // @ts-ignore unused injected service - @IConfigurationService private configurationService: IConfigurationService, @IEnvironmentService private environmentService: IEnvironmentService ) { super(); diff --git a/src/vs/workbench/parts/search/browser/patternInputWidget.ts b/src/vs/workbench/parts/search/browser/patternInputWidget.ts index 06020f4ef5e..d3101e9b681 100644 --- a/src/vs/workbench/parts/search/browser/patternInputWidget.ts +++ b/src/vs/workbench/parts/search/browser/patternInputWidget.ts @@ -168,8 +168,7 @@ export class PatternInputWidget extends Widget { placeholder: this.placeholder || '', ariaLabel: this.ariaLabel || '', validationOptions: { - validation: null, - showMessage: true + validation: null } }); this._register(attachInputBoxStyler(this.inputBox, this.themeService)); diff --git a/src/vs/workbench/services/backup/node/backupFileService.ts b/src/vs/workbench/services/backup/node/backupFileService.ts index d03f40a59dc..af5ca6bda2b 100644 --- a/src/vs/workbench/services/backup/node/backupFileService.ts +++ b/src/vs/workbench/services/backup/node/backupFileService.ts @@ -95,14 +95,14 @@ export class BackupFileService implements IBackupFileService { private isShuttingDown: boolean; private ready: TPromise; - private ioOperationQueues: ResourceQueue; // queue IO operations to ensure write order + private ioOperationQueues: ResourceQueue; // queue IO operations to ensure write order constructor( backupWorkspacePath: string, @IFileService private fileService: IFileService ) { this.isShuttingDown = false; - this.ioOperationQueues = new ResourceQueue(); + this.ioOperationQueues = new ResourceQueue(); this.initialize(backupWorkspacePath); } diff --git a/src/vs/workbench/services/backup/test/node/backupFileService.test.ts b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts index f7c21bdf2cd..28db9272fcf 100644 --- a/src/vs/workbench/services/backup/test/node/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts @@ -16,25 +16,11 @@ import pfs = require('vs/base/node/pfs'); import Uri from 'vs/base/common/uri'; import { BackupFileService, BackupFilesModel } from 'vs/workbench/services/backup/node/backupFileService'; import { FileService } from 'vs/workbench/services/files/node/fileService'; -import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { parseArgs } from 'vs/platform/environment/node/argv'; import { RawTextSource } from 'vs/editor/common/model/textSource'; import { TestContextService, TestTextResourceConfigurationService, getRandomTestPath } from 'vs/workbench/test/workbenchTestServices'; import { Workspace, toWorkspaceFolders } from 'vs/platform/workspace/common/workspace'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -// @ts-ignore unused type -class TestEnvironmentService extends EnvironmentService { - - constructor(private _backupHome: string, private _backupWorkspacesPath: string) { - super(parseArgs(process.argv), process.execPath); - } - - get backupHome(): string { return this._backupHome; } - - get backupWorkspacesPath(): string { return this._backupWorkspacesPath; } -} - const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'backupfileservice'); const backupHome = path.join(parentDir, 'Backups'); const workspacesJsonPath = path.join(backupHome, 'workspaces.json'); diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 767722336fe..8e1e78ff144 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -27,8 +27,6 @@ let activeEditor: BaseEditor = { let openedEditorInput; let openedEditorOptions; -// @ts-ignore unused local -let openedEditorPosition; function toResource(path) { return URI.from({ scheme: 'custom', path }); @@ -70,7 +68,6 @@ class TestEditorPart implements IEditorPart { public openEditor(input?: EditorInput, options?: EditorOptions, arg?: any): TPromise { openedEditorInput = input; openedEditorOptions = options; - openedEditorPosition = arg; return TPromise.as(activeEditor); } diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index 2db30d6e03e..04c8610f378 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -30,7 +30,6 @@ import { IExpression } from 'vs/base/common/glob'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ResourceGlobMatcher } from 'vs/workbench/common/resources'; -import { IEditorRegistry, Extensions } from 'vs/workbench/browser/editor'; /** * Stores the selection & view state of an editor and allows to compare it to other selection states. @@ -189,8 +188,6 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic private history: (IEditorInput | IResourceInput)[]; private recentlyClosedFiles: IRecentlyClosedFile[]; private loaded: boolean; - // @ts-ignore unused property - private registry: IEditorRegistry; private resourceFilter: ResourceGlobMatcher; constructor( @@ -211,7 +208,6 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic this.stack = []; this.recentlyClosedFiles = []; this.loaded = false; - this.registry = Registry.as(Extensions.Editors); this.resourceFilter = instantiationService.createInstance( ResourceGlobMatcher, (root: URI) => this.getExcludes(root), diff --git a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts index 2e1640fbd73..e81451b195a 100644 --- a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts +++ b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts @@ -102,8 +102,6 @@ export class TextModelResolverService implements ITextModelService { private resourceModelCollection: ResourceModelCollection; constructor( - // @ts-ignore unused injected service - @ITextFileService private textFileService: ITextFileService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IInstantiationService private instantiationService: IInstantiationService, @IModelService private modelService: IModelService diff --git a/src/vs/workbench/test/browser/actionRegistry.test.ts b/src/vs/workbench/test/browser/actionRegistry.test.ts index f0955049db3..2e9e472df7f 100644 --- a/src/vs/workbench/test/browser/actionRegistry.test.ts +++ b/src/vs/workbench/test/browser/actionRegistry.test.ts @@ -10,14 +10,6 @@ import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { prepareActions } from 'vs/workbench/browser/actions'; import { Action } from 'vs/base/common/actions'; - -// @ts-ignore unused type -class MyClass extends Action { - constructor(id: string, label: string) { - super(id, label); - } -} - suite('Workbench Action Registry', () => { test('Workbench Action Bar prepareActions()', function () { diff --git a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts index 9caa11a7e98..fafbd9d733d 100644 --- a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts @@ -339,7 +339,6 @@ suite('Editor Stacks Model', () => { let events = modelListener(model); let group1 = model.openGroup('first'); - // @ts-ignore unused property let group2 = model.openGroup('second'); let group3 = model.openGroup('third'); @@ -365,6 +364,7 @@ suite('Editor Stacks Model', () => { model.moveGroup(group3, 1); assert.equal(events.moved.length, 2); + assert.ok(group2); }); test('Groups - Event Aggregation', function () { diff --git a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts index 41e7bdb6667..505e26e4b22 100644 --- a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts @@ -6,8 +6,6 @@ 'use strict'; import * as assert from 'assert'; -import { EditorModel } from 'vs/workbench/common/editor'; -import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorModel'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -21,11 +19,6 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IModel } from 'vs/editor/common/editorCommon'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -// @ts-ignore unused type -class MyEditorModel extends EditorModel { } -// @ts-ignore unused type -class MyTextEditorModel extends BaseTextEditorModel { } - class ServiceAccessor { constructor( @ITextModelService public textModelResolverService: ITextModelService, diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index b007781516c..9b42bc2bd74 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -72,8 +72,6 @@ export class TestContextService implements IWorkspaceContextService { public _serviceBrand: any; private workspace: IWorkbenchWorkspace; - // @ts-ignore unused property - private id: string; private options: any; private _onDidChangeWorkspaceName: Emitter; @@ -82,7 +80,6 @@ export class TestContextService implements IWorkspaceContextService { constructor(workspace: any = TestWorkspace, options: any = null) { this.workspace = workspace; - this.id = generateUuid(); this.options = options || Object.create(null); this._onDidChangeWorkspaceFolders = new Emitter(); this._onDidChangeWorkbenchState = new Emitter(); @@ -1015,7 +1012,7 @@ export class TestLifecycleService implements ILifecycleService { when(): Thenable { throw notImplemented(); - }; + } public fireShutdown(reason = ShutdownReason.QUIT): void { this._onShutdown.fire(reason); From ea5d70687b7e1be33101d3d7669a0fbbb6506f43 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 10:31:55 -0800 Subject: [PATCH 30/88] Fix dom on for TS's strict function mode (#37748) **background** TS 2.6 introduces a new strict function checking mode. This can catch many common mistakes such as patterns like this: ```js function on(callback: (Base) => void) { ... } on((e: Sub) => {...}); ``` This does an implicit cast in the call to `on`. With strict function checking, this is now flagged as an error **Change** This change fixes dom.on so that it works with strict function checking. This done by making it generic so that the type of the event taken in the callback can be inferred from the callback itself. --- src/vs/base/browser/builder.ts | 16 ++++++++-------- src/vs/base/browser/dom.ts | 14 +++++++------- src/vs/base/browser/globalMouseMoveMonitor.ts | 2 +- src/vs/editor/browser/editorDom.ts | 6 +++--- .../files/browser/editors/textFileEditor.ts | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/vs/base/browser/builder.ts b/src/vs/base/browser/builder.ts index 4ab3711618e..d7e54d6b39b 100644 --- a/src/vs/base/browser/builder.ts +++ b/src/vs/base/browser/builder.ts @@ -559,9 +559,9 @@ export class Builder implements IDisposable { /** * Registers listener on event types on the current element. */ - public on(type: string, fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; - public on(typeArray: string[], fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; - public on(arg1: any, fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder { + public on(type: string, fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; + public on(typeArray: string[], fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; + public on(arg1: any, fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder { // Event Type Array if (types.isArray(arg1)) { @@ -575,7 +575,7 @@ export class Builder implements IDisposable { let type = arg1; // Add Listener - let unbind: IDisposable = DOM.addDisposableListener(this.currentElement, type, (e: Event) => { + let unbind: IDisposable = DOM.addDisposableListener(this.currentElement, type, (e) => { fn(e, this, unbind); // Pass in Builder as Second Argument }, useCapture || false); @@ -641,9 +641,9 @@ export class Builder implements IDisposable { * Registers listener on event types on the current element and removes * them after first invocation. */ - public once(type: string, fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; - public once(typesArray: string[], fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; - public once(arg1: any, fn: (e: Event, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder { + public once(type: string, fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; + public once(typesArray: string[], fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder; + public once(arg1: any, fn: (e: E, builder: Builder, unbind: IDisposable) => void, listenerToUnbindContainer?: IDisposable[], useCapture?: boolean): Builder { // Event Type Array if (types.isArray(arg1)) { @@ -657,7 +657,7 @@ export class Builder implements IDisposable { let type = arg1; // Add Listener - let unbind: IDisposable = DOM.addDisposableListener(this.currentElement, type, (e: Event) => { + let unbind: IDisposable = DOM.addDisposableListener(this.currentElement, type, (e) => { fn(e, this, unbind); // Pass in Builder as Second Argument unbind.dispose(); }, useCapture || false); diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index b8af134f20e..8087c77656e 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -413,18 +413,18 @@ class AnimationFrameQueueItem implements IDisposable { /** * Add a throttled listener. `handler` is fired at most every 16ms or with the next animation frame (if browser supports it). */ -export interface IEventMerger { - (lastEvent: R, currentEvent: Event): R; +export interface IEventMerger { + (lastEvent: R, currentEvent: E): R; } const MINIMUM_TIME_MS = 16; -const DEFAULT_EVENT_MERGER: IEventMerger = function (lastEvent: Event, currentEvent: Event) { +const DEFAULT_EVENT_MERGER: IEventMerger = function (lastEvent: Event, currentEvent: Event) { return currentEvent; }; -class TimeoutThrottledDomListener extends Disposable { +class TimeoutThrottledDomListener extends Disposable { - constructor(node: any, type: string, handler: (event: R) => void, eventMerger: IEventMerger = DEFAULT_EVENT_MERGER, minimumTimeMs: number = MINIMUM_TIME_MS) { + constructor(node: any, type: string, handler: (event: R) => void, eventMerger: IEventMerger = DEFAULT_EVENT_MERGER, minimumTimeMs: number = MINIMUM_TIME_MS) { super(); let lastEvent: R = null; @@ -452,8 +452,8 @@ class TimeoutThrottledDomListener extends Disposable { } } -export function addDisposableThrottledListener(node: any, type: string, handler: (event: R) => void, eventMerger?: IEventMerger, minimumTimeMs?: number): IDisposable { - return new TimeoutThrottledDomListener(node, type, handler, eventMerger, minimumTimeMs); +export function addDisposableThrottledListener(node: any, type: string, handler: (event: R) => void, eventMerger?: IEventMerger, minimumTimeMs?: number): IDisposable { + return new TimeoutThrottledDomListener(node, type, handler, eventMerger, minimumTimeMs); } export function getComputedStyle(el: HTMLElement): CSSStyleDeclaration { diff --git a/src/vs/base/browser/globalMouseMoveMonitor.ts b/src/vs/base/browser/globalMouseMoveMonitor.ts index 3e2e2fc289e..09b2f37842e 100644 --- a/src/vs/base/browser/globalMouseMoveMonitor.ts +++ b/src/vs/base/browser/globalMouseMoveMonitor.ts @@ -96,7 +96,7 @@ export class GlobalMouseMoveMonitor extends Disposable { for (let i = 0; i < windowChain.length; i++) { this.hooks.push(dom.addDisposableThrottledListener(windowChain[i].window.document, 'mousemove', (data: R) => this.mouseMoveCallback(data), - (lastEvent: R, currentEvent: MouseEvent) => this.mouseMoveEventMerger(lastEvent, currentEvent) + (lastEvent: R, currentEvent) => this.mouseMoveEventMerger(lastEvent, currentEvent as MouseEvent) )); this.hooks.push(dom.addDisposableListener(windowChain[i].window.document, 'mouseup', (e: MouseEvent) => this.stopMonitoring(true))); } diff --git a/src/vs/editor/browser/editorDom.ts b/src/vs/editor/browser/editorDom.ts index 504c830dda1..b483b681901 100644 --- a/src/vs/editor/browser/editorDom.ts +++ b/src/vs/editor/browser/editorDom.ts @@ -135,10 +135,10 @@ export class EditorMouseEventFactory { } public onMouseMoveThrottled(target: HTMLElement, callback: (e: EditorMouseEvent) => void, merger: EditorMouseEventMerger, minimumTimeMs: number): IDisposable { - let myMerger: dom.IEventMerger = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => { + let myMerger: dom.IEventMerger = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => { return merger(lastEvent, this._create(currentEvent)); }; - return dom.addDisposableThrottledListener(target, 'mousemove', callback, myMerger, minimumTimeMs); + return dom.addDisposableThrottledListener(target, 'mousemove', callback, myMerger, minimumTimeMs); } } @@ -168,7 +168,7 @@ export class GlobalEditorMouseMoveMonitor extends Disposable { this._globalMouseMoveMonitor.stopMonitoring(true); }, true); - let myMerger: dom.IEventMerger = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => { + let myMerger: dom.IEventMerger = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => { return merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode)); }; diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index b607ba93761..3fb83c894cd 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -190,8 +190,8 @@ export class TextFileEditor extends BaseTextEditor { // Best we can do is to reveal the folder in the explorer if (this.contextService.isInsideWorkspace(input.getResource())) { - this.viewletService.openViewlet(VIEWLET_ID, true).done((viewlet: ExplorerViewlet) => { - return viewlet.getExplorerView().select(input.getResource(), true); + this.viewletService.openViewlet(VIEWLET_ID, true).done(viewlet => { + return (viewlet as ExplorerViewlet).getExplorerView().select(input.getResource(), true); }, errors.onUnexpectedError); } }, errors.onUnexpectedError); From a458da4afb59398055f5ced1114130b164ecd483 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Tue, 7 Nov 2017 10:54:48 -0800 Subject: [PATCH 31/88] Clear tsignores under extensions folder #37212 --- .../extensions/browser/extensionEditor.ts | 39 ++------------ .../extensions/browser/extensionsActions.ts | 52 ++++--------------- .../extensions/browser/extensionsList.ts | 3 -- .../electron-browser/extensionsViewlet.ts | 5 +- .../electron-browser/extensionsViews.ts | 11 +--- .../node/extensionsWorkbenchService.ts | 4 +- 6 files changed, 18 insertions(+), 96 deletions(-) diff --git a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts index 46259772e70..c468fb8b995 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts @@ -17,7 +17,7 @@ import Cache from 'vs/base/common/cache'; import { Action } from 'vs/base/common/actions'; import { isPromiseCanceledError } from 'vs/base/common/errors'; import Severity from 'vs/base/common/severity'; -import { IDisposable, empty, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { Builder } from 'vs/base/browser/builder'; import { domEvent } from 'vs/base/browser/event'; import { append, $, addClass, removeClass, finalHandler, join } from 'vs/base/browser/dom'; @@ -25,13 +25,11 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionGalleryService, IExtensionManifest, IKeyBinding, IView, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManifest, IKeyBinding, IView, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ResolvedKeybinding, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies } from 'vs/workbench/parts/extensions/common/extensions'; import { Renderer, DataSource, Controller } from 'vs/workbench/parts/extensions/browser/dependenciesViewer'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITemplateData } from 'vs/workbench/parts/extensions/browser/extensionsList'; import { RatingsWidget, InstallWidget } from 'vs/workbench/parts/extensions/browser/extensionsWidgets'; import { EditorOptions } from 'vs/workbench/common/editor'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; @@ -165,10 +163,6 @@ export class ExtensionEditor extends BaseEditor { private content: HTMLElement; private recommendation: HTMLElement; private header: HTMLElement; - // @ts-ignore unused property - private _highlight: ITemplateData; - // @ts-ignore unused property - private highlightDisposable: IDisposable; private extensionReadme: Cache; private extensionChangelog: Cache; @@ -185,10 +179,6 @@ export class ExtensionEditor extends BaseEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, - // @ts-ignore unused injected service - @IExtensionGalleryService private galleryService: IExtensionGalleryService, - // @ts-ignore unused injected service - @IConfigurationService private configurationService: IConfigurationService, @IInstantiationService private instantiationService: IInstantiationService, @IViewletService private viewletService: IViewletService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @@ -199,20 +189,17 @@ export class ExtensionEditor extends BaseEditor { @IListService private listService: IListService, @IPartService private partService: IPartService, @IContextViewService private contextViewService: IContextViewService, - // @ts-ignore unused injected service @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionTipsService private extensionTipsService: IExtensionTipsService ) { super(ExtensionEditor.ID, telemetryService, themeService); - this._highlight = null; - this.highlightDisposable = empty; this.disposables = []; this.extensionReadme = null; this.extensionChangelog = null; this.extensionManifest = null; this.extensionDependencies = null; - this.contextKey = KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS.bindTo(contextKeyService); - this.findInputFocusContextKey = KEYBINDING_CONTEXT_EXTENSIONEDITOR_FIND_WIDGET_INPUT_FOCUSED.bindTo(contextKeyService); + this.contextKey = KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS.bindTo(this.contextKeyService); + this.findInputFocusContextKey = KEYBINDING_CONTEXT_EXTENSIONEDITOR_FIND_WIDGET_INPUT_FOCUSED.bindTo(this.contextKeyService); } createEditor(parent: Builder): void { @@ -900,7 +887,6 @@ export class ExtensionEditor extends BaseEditor { } dispose(): void { - this._highlight = null; this.transientDisposables = dispose(this.transientDisposables); this.disposables = dispose(this.disposables); super.dispose(); @@ -932,23 +918,6 @@ const showCommand = new ShowExtensionEditorFindCommand({ }); KeybindingsRegistry.registerCommandAndKeybindingRule(showCommand.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorContrib())); -// @ts-ignore unused type -class HideExtensionEditorFindCommand extends Command { - public runCommand(accessor: ServicesAccessor, args: any): void { - const extensionEditor = this.getExtensionEditor(accessor); - if (extensionEditor) { - extensionEditor.hideFind(); - } - } - - private getExtensionEditor(accessor: ServicesAccessor): ExtensionEditor { - const activeEditor = accessor.get(IWorkbenchEditorService).getActiveEditor() as ExtensionEditor; - if (activeEditor instanceof ExtensionEditor) { - return activeEditor; - } - return null; - } -} const hideCommand = new ShowExtensionEditorFindCommand({ id: 'editor.action.extensioneditor.hidefind', precondition: KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS, diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index 2eefea0dfef..b4a731de182 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -110,11 +110,7 @@ export class UninstallAction extends Action { set extension(extension: IExtension) { this._extension = extension; this.update(); } constructor( - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IMessageService private messageService: IMessageService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super('extensions.uninstall', UninstallAction.UninstallLabel, UninstallAction.UninstallClass, false); @@ -365,11 +361,7 @@ export class ManageExtensionAction extends Action { set extension(extension: IExtension) { this._extension = extension; this._actionItem.extension = extension; this.update(); } constructor( - // @ts-ignore unused injected service - @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, @IInstantiationService private instantiationService: IInstantiationService ) { super(ManageExtensionAction.ID); @@ -430,9 +422,7 @@ export class EnableForWorkspaceAction extends Action implements IExtensionAction constructor(label: string, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService ) { super(EnableForWorkspaceAction.ID, label); @@ -471,9 +461,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction { constructor(label: string, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService ) { super(EnableGloballyAction.ID, label); @@ -569,9 +557,7 @@ export class DisableForWorkspaceAction extends Action implements IExtensionActio constructor(label: string, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(DisableForWorkspaceAction.ID, label); @@ -609,9 +595,7 @@ export class DisableGloballyAction extends Action implements IExtensionAction { set extension(extension: IExtension) { this._extension = extension; this.update(); } constructor(label: string, - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(DisableGloballyAction.ID, label); @@ -810,8 +794,6 @@ export class ReloadAction extends Action { constructor( @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IMessageService private messageService: IMessageService, @IWindowService private windowService: IWindowService, @IExtensionService private extensionService: IExtensionService ) { @@ -919,9 +901,7 @@ export class ShowEnabledExtensionsAction extends Action { constructor( id: string, label: string, - @IViewletService private viewletService: IViewletService, - // @ts-ignore unused injected service - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService + @IViewletService private viewletService: IViewletService ) { super(id, label, 'clear-extensions', true); } @@ -944,9 +924,7 @@ export class ShowInstalledExtensionsAction extends Action { constructor( id: string, label: string, - @IViewletService private viewletService: IViewletService, - // @ts-ignore unused injected service - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService + @IViewletService private viewletService: IViewletService ) { super(id, label, 'clear-extensions', true); } @@ -969,9 +947,7 @@ export class ShowDisabledExtensionsAction extends Action { constructor( id: string, label: string, - @IViewletService private viewletService: IViewletService, - // @ts-ignore unused injected service - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService + @IViewletService private viewletService: IViewletService ) { super(id, label, 'null', true); } @@ -997,9 +973,7 @@ export class ClearExtensionsInputAction extends Action { id: string, label: string, onSearchChange: Event, - @IViewletService private viewletService: IViewletService, - // @ts-ignore unused injected service - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService + @IViewletService private viewletService: IViewletService ) { super(id, label, 'clear-extensions', true); this.enabled = false; @@ -1565,9 +1539,7 @@ export class DisableAllAction extends Action { constructor( id: string = DisableAllAction.ID, label: string = DisableAllAction.LABEL, - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label); this.update(); @@ -1598,9 +1570,7 @@ export class DisableAllWorkpsaceAction extends Action { constructor( id: string = DisableAllWorkpsaceAction.ID, label: string = DisableAllWorkpsaceAction.LABEL, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - // @ts-ignore unused injected service - @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { super(id, label); this.update(); diff --git a/src/vs/workbench/parts/extensions/browser/extensionsList.ts b/src/vs/workbench/parts/extensions/browser/extensionsList.ts index 1fb93a5094f..24eacaef0a0 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsList.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsList.ts @@ -20,7 +20,6 @@ import { InstallAction, UpdateAction, BuiltinStatusLabelAction, ManageExtensionA import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { Label, RatingsWidget, InstallWidget } from 'vs/workbench/parts/extensions/browser/extensionsWidgets'; import { EventType } from 'vs/base/common/events'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -50,8 +49,6 @@ export class Renderer implements IPagedRenderer { constructor( @IInstantiationService private instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IContextMenuService private contextMenuService: IContextMenuService, @IMessageService private messageService: IMessageService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionService private extensionService: IExtensionService, diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 4846b7c9791..361ecfb1c9d 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -85,11 +85,8 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens @IInstantiationService instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorInputService: IEditorGroupService, - // @ts-ignore unused injected service - @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionManagementService private extensionManagementService: IExtensionManagementService, @IMessageService private messageService: IMessageService, - // @ts-ignore unused injected service @IViewletService private viewletService: IViewletService, @IThemeService themeService: IThemeService, @IConfigurationService private configurationService: IConfigurationService, @@ -108,7 +105,7 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens this.searchInstalledExtensionsContextKey = SearchInstalledExtensionsContext.bindTo(contextKeyService); this.recommendedExtensionsContextKey = RecommendedExtensionsContext.bindTo(contextKeyService); - this.disposables.push(viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); + this.disposables.push(this.viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); this.configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(AutoUpdateConfigurationKey)) { diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts index 05ff1d777bd..4f44869ebc0 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts @@ -18,8 +18,6 @@ import { SortBy, SortOrder, IQueryOptions, LocalExtensionType, IExtensionTipsSer import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ICommandService } from 'vs/platform/commands/common/commands'; import { append, $, toggleClass } from 'vs/base/browser/dom'; import { PagedList } from 'vs/base/browser/ui/list/listPaging'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -36,7 +34,6 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IProgressService } from 'vs/platform/progress/common/progress'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { EventType } from 'vs/base/common/events'; @@ -58,19 +55,13 @@ export class ExtensionsListView extends ViewsViewletPanel { @IInstantiationService protected instantiationService: IInstantiationService, @IListService private listService: IListService, @IThemeService private themeService: IThemeService, - // @ts-ignore unused injected service - @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionService private extensionService: IExtensionService, - // @ts-ignore unused injected service - @ICommandService private commandService: ICommandService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorInputService: IEditorGroupService, @IExtensionTipsService private tipsService: IExtensionTipsService, @IModeService private modeService: IModeService, - @ITelemetryService private telemetryService: ITelemetryService, - // @ts-ignore unused injected service - @IProgressService private progressService: IProgressService + @ITelemetryService private telemetryService: ITelemetryService ) { super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService); } diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 09840fcfeb8..3c57bee6e70 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -20,7 +20,7 @@ import { IPager, mapPager, singlePagePager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, IQueryOptions, IExtensionManifest, - InstallExtensionEvent, DidInstallExtensionEvent, LocalExtensionType, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionTipsService, IExtensionIdentifier + InstallExtensionEvent, DidInstallExtensionEvent, LocalExtensionType, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionIdFromLocal, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData, areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -332,8 +332,6 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { @IChoiceService private choiceService: IChoiceService, @IURLService urlService: IURLService, @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, - // @ts-ignore unused injected service - @IExtensionTipsService private tipsService: IExtensionTipsService, @IWorkspaceContextService private workspaceContextService: IWorkspaceContextService, @IWindowService private windowService: IWindowService ) { From 583e14c2ec7bd346c51a3321aed984c02745b66a Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Tue, 7 Nov 2017 11:16:38 -0800 Subject: [PATCH 32/88] Add noUnusedLocals to emmet extension #37212 --- extensions/emmet/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/emmet/tsconfig.json b/extensions/emmet/tsconfig.json index 06d04868a70..3ac3cd9c298 100644 --- a/extensions/emmet/tsconfig.json +++ b/extensions/emmet/tsconfig.json @@ -5,8 +5,8 @@ "es2016" ], "module": "commonjs", - "outDir": "./out" - + "outDir": "./out", + "noUnusedLocals": true }, "exclude": [ "node_modules", From b1747e7b5f5c0e5b59fa90bbc479c061b238ac69 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Tue, 7 Nov 2017 11:19:45 -0800 Subject: [PATCH 33/88] Clear tsignores under suggest folder #37212 --- src/vs/editor/contrib/suggest/browser/suggestWidget.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 31bed3940dd..aa88e693c8c 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -207,7 +207,6 @@ class SuggestionDetails { private widget: SuggestWidget, private editor: ICodeEditor, private markdownRenderer: MarkdownRenderer, - // @ts-ignore unused property private triggerKeybindingLabel: string ) { this.disposables = []; @@ -223,7 +222,7 @@ class SuggestionDetails { this.header = append(this.body, $('.header')); this.close = append(this.header, $('span.close')); - this.close.title = nls.localize('readLess', "Read less...{0}", triggerKeybindingLabel); + this.close.title = nls.localize('readLess', "Read less...{0}", this.triggerKeybindingLabel); this.type = append(this.header, $('p.type')); this.docs = append(this.body, $('p.docs')); From 52f45af7f092ee25045c0a0a2aa33beb5f136ce8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 20:50:36 -0800 Subject: [PATCH 34/88] Add additional no unused checks for php extension --- extensions/php/src/features/completionItemProvider.ts | 2 +- extensions/php/src/features/hoverProvider.ts | 8 +++++--- extensions/php/src/features/signatureHelpProvider.ts | 2 +- extensions/php/src/features/utils/async.ts | 4 ++-- extensions/php/src/features/validationProvider.ts | 2 +- extensions/php/tsconfig.json | 4 ++++ 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/extensions/php/src/features/completionItemProvider.ts b/extensions/php/src/features/completionItemProvider.ts index 3d918dc4cf5..05a0f9f29bc 100644 --- a/extensions/php/src/features/completionItemProvider.ts +++ b/extensions/php/src/features/completionItemProvider.ts @@ -12,7 +12,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider public triggerCharacters = ['.', ':', '$']; - public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise { + public provideCompletionItems(document: TextDocument, position: Position, _token: CancellationToken): Promise { let result: CompletionItem[] = []; let shouldProvideCompletionItems = workspace.getConfiguration('php').get('suggest.basic', true); diff --git a/extensions/php/src/features/hoverProvider.ts b/extensions/php/src/features/hoverProvider.ts index 2e0a137ec0a..f40d210b133 100644 --- a/extensions/php/src/features/hoverProvider.ts +++ b/extensions/php/src/features/hoverProvider.ts @@ -11,15 +11,15 @@ import { textToMarkedString } from './utils/markedTextUtil'; export default class PHPHoverProvider implements HoverProvider { - public provideHover(document: TextDocument, position: Position, token: CancellationToken): Hover | undefined { + public provideHover(document: TextDocument, position: Position, _token: CancellationToken): Hover | undefined { let enable = workspace.getConfiguration('php').get('suggest.basic', true); if (!enable) { - return; + return undefined; } let wordRange = document.getWordRangeAtPosition(position); if (!wordRange) { - return; + return undefined; } let name = document.getText(wordRange); @@ -30,5 +30,7 @@ export default class PHPHoverProvider implements HoverProvider { let contents: MarkedString[] = [textToMarkedString(entry.description), { language: 'php', value: signature }]; return new Hover(contents, wordRange); } + + return undefined; } } diff --git a/extensions/php/src/features/signatureHelpProvider.ts b/extensions/php/src/features/signatureHelpProvider.ts index 42c14b8066a..b3f6c12a306 100644 --- a/extensions/php/src/features/signatureHelpProvider.ts +++ b/extensions/php/src/features/signatureHelpProvider.ts @@ -69,7 +69,7 @@ class BackwardIterator { export default class PHPSignatureHelpProvider implements SignatureHelpProvider { - public provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): Promise | null { + public provideSignatureHelp(document: TextDocument, position: Position, _token: CancellationToken): Promise | null { let enable = workspace.getConfiguration('php').get('suggest.basic', true); if (!enable) { return null; diff --git a/extensions/php/src/features/utils/async.ts b/extensions/php/src/features/utils/async.ts index 5093f7c3eba..78ba0aa582a 100644 --- a/extensions/php/src/features/utils/async.ts +++ b/extensions/php/src/features/utils/async.ts @@ -53,7 +53,7 @@ export class Throttler { return result; }; - this.queuedPromise = new Promise((resolve, reject) => { + this.queuedPromise = new Promise((resolve) => { this.activePromise!.then(onComplete, onComplete).then(resolve); }); } @@ -121,7 +121,7 @@ export class Delayer { this.cancelTimeout(); if (!this.completionPromise) { - this.completionPromise = new Promise((resolve, reject) => { + this.completionPromise = new Promise((resolve) => { this.onResolve = resolve; }).then(() => { this.completionPromise = null; diff --git a/extensions/php/src/features/validationProvider.ts b/extensions/php/src/features/validationProvider.ts index 0a26bbd5a9b..4f7f8cadbb7 100644 --- a/extensions/php/src/features/validationProvider.ts +++ b/extensions/php/src/features/validationProvider.ts @@ -224,7 +224,7 @@ export default class PHPValidationProvider { } private doValidate(textDocument: vscode.TextDocument): Promise { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { let executable = this.executable || 'php'; let decoder = new LineDecoder(); let diagnostics: vscode.Diagnostic[] = []; diff --git a/extensions/php/tsconfig.json b/extensions/php/tsconfig.json index b16347a7524..7e9b0d127b4 100644 --- a/extensions/php/tsconfig.json +++ b/extensions/php/tsconfig.json @@ -6,6 +6,10 @@ ], "module": "commonjs", "outDir": "./out", + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "strict": true }, "include": [ From 7ac8e49eb01a29eb8d74a10ff3513b728b56c551 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 6 Nov 2017 20:50:55 -0800 Subject: [PATCH 35/88] Add additional no unused checks for merge-conflict extension --- .../merge-conflict/src/codelensProvider.ts | 4 ++-- extensions/merge-conflict/src/commandHandler.ts | 16 ++++++++-------- extensions/merge-conflict/src/contentProvider.ts | 10 ---------- .../merge-conflict/src/documentMergeConflict.ts | 2 +- extensions/merge-conflict/src/documentTracker.ts | 2 +- .../merge-conflict/src/mergeConflictParser.ts | 2 +- extensions/merge-conflict/src/services.ts | 6 +++--- extensions/merge-conflict/tsconfig.json | 4 ++++ 8 files changed, 20 insertions(+), 26 deletions(-) diff --git a/extensions/merge-conflict/src/codelensProvider.ts b/extensions/merge-conflict/src/codelensProvider.ts index ca54a189a7a..32b1cb9e381 100644 --- a/extensions/merge-conflict/src/codelensProvider.ts +++ b/extensions/merge-conflict/src/codelensProvider.ts @@ -13,7 +13,7 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro private config: interfaces.IExtensionConfiguration; private tracker: interfaces.IDocumentMergeConflictTracker; - constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { + constructor(trackerService: interfaces.IDocumentMergeConflictTrackerService) { this.tracker = trackerService.createTracker('codelens'); } @@ -46,7 +46,7 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro } } - async provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): Promise { + async provideCodeLenses(document: vscode.TextDocument, _token: vscode.CancellationToken): Promise { if (!this.config || !this.config.enableCodeLens) { return null; diff --git a/extensions/merge-conflict/src/commandHandler.ts b/extensions/merge-conflict/src/commandHandler.ts index 50ce36885b9..1a737cfaf3f 100644 --- a/extensions/merge-conflict/src/commandHandler.ts +++ b/extensions/merge-conflict/src/commandHandler.ts @@ -24,7 +24,7 @@ export default class CommandHandler implements vscode.Disposable { private disposables: vscode.Disposable[] = []; private tracker: interfaces.IDocumentMergeConflictTracker; - constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { + constructor(trackerService: interfaces.IDocumentMergeConflictTrackerService) { this.tracker = trackerService.createTracker('commands'); } @@ -62,19 +62,19 @@ export default class CommandHandler implements vscode.Disposable { return this.accept(interfaces.CommitType.Both, editor, ...args); } - acceptAllCurrent(editor: vscode.TextEditor, ...args: any[]): Promise { + acceptAllCurrent(editor: vscode.TextEditor): Promise { return this.acceptAll(interfaces.CommitType.Current, editor); } - acceptAllIncoming(editor: vscode.TextEditor, ...args: any[]): Promise { + acceptAllIncoming(editor: vscode.TextEditor): Promise { return this.acceptAll(interfaces.CommitType.Incoming, editor); } - acceptAllBoth(editor: vscode.TextEditor, ...args: any[]): Promise { + acceptAllBoth(editor: vscode.TextEditor): Promise { return this.acceptAll(interfaces.CommitType.Both, editor); } - async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null, ...args: any[]) { + async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null) { const fileName = path.basename(editor.document.uri.fsPath); // No conflict, command executed from command palette @@ -102,15 +102,15 @@ export default class CommandHandler implements vscode.Disposable { vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title); } - navigateNext(editor: vscode.TextEditor, ...args: any[]): Promise { + navigateNext(editor: vscode.TextEditor): Promise { return this.navigate(editor, NavigationDirection.Forwards); } - navigatePrevious(editor: vscode.TextEditor, ...args: any[]): Promise { + navigatePrevious(editor: vscode.TextEditor): Promise { return this.navigate(editor, NavigationDirection.Backwards); } - async acceptSelection(editor: vscode.TextEditor, ...args: any[]): Promise { + async acceptSelection(editor: vscode.TextEditor): Promise { let conflict = await this.findConflictContainingSelection(editor); if (!conflict) { diff --git a/extensions/merge-conflict/src/contentProvider.ts b/extensions/merge-conflict/src/contentProvider.ts index 446ab052f22..37e5923e135 100644 --- a/extensions/merge-conflict/src/contentProvider.ts +++ b/extensions/merge-conflict/src/contentProvider.ts @@ -4,21 +4,11 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as vscode from 'vscode'; -import * as interfaces from './interfaces'; export default class MergeConflictContentProvider implements vscode.TextDocumentContentProvider, vscode.Disposable { static scheme = 'merge-conflict.conflict-diff'; - constructor(private context: vscode.ExtensionContext) { - } - - begin(config: interfaces.IExtensionConfiguration) { - this.context.subscriptions.push( - vscode.workspace.registerTextDocumentContentProvider(MergeConflictContentProvider.scheme, this) - ); - } - dispose() { } diff --git a/extensions/merge-conflict/src/documentMergeConflict.ts b/extensions/merge-conflict/src/documentMergeConflict.ts index d8541e0e20a..3bf94a16ea7 100644 --- a/extensions/merge-conflict/src/documentMergeConflict.ts +++ b/extensions/merge-conflict/src/documentMergeConflict.ts @@ -13,7 +13,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict public commonAncestors: interfaces.IMergeRegion[]; public splitter: vscode.Range; - constructor(document: vscode.TextDocument, descriptor: interfaces.IDocumentMergeConflictDescriptor) { + constructor(descriptor: interfaces.IDocumentMergeConflictDescriptor) { this.range = descriptor.range; this.current = descriptor.current; this.incoming = descriptor.incoming; diff --git a/extensions/merge-conflict/src/documentTracker.ts b/extensions/merge-conflict/src/documentTracker.ts index 83c578122fc..f70cd91f185 100644 --- a/extensions/merge-conflict/src/documentTracker.ts +++ b/extensions/merge-conflict/src/documentTracker.ts @@ -116,7 +116,7 @@ export default class DocumentMergeConflictTracker implements vscode.Disposable, this.cache.clear(); } - private getConflictsOrEmpty(document: vscode.TextDocument, origins: string[]): interfaces.IDocumentMergeConflict[] { + private getConflictsOrEmpty(document: vscode.TextDocument, _origins: string[]): interfaces.IDocumentMergeConflict[] { const containsConflict = MergeConflictParser.containsConflict(document); if (!containsConflict) { diff --git a/extensions/merge-conflict/src/mergeConflictParser.ts b/extensions/merge-conflict/src/mergeConflictParser.ts index 4ff9a58e07c..84a4607ac14 100644 --- a/extensions/merge-conflict/src/mergeConflictParser.ts +++ b/extensions/merge-conflict/src/mergeConflictParser.ts @@ -81,7 +81,7 @@ export class MergeConflictParser { return conflictDescriptors .filter(Boolean) - .map(descriptor => new DocumentMergeConflict(document, descriptor)); + .map(descriptor => new DocumentMergeConflict(descriptor)); } private static scanItemTolMergeConflictDescriptor(document: vscode.TextDocument, scanned: IScanMergedConflict): interfaces.IDocumentMergeConflictDescriptor | null { diff --git a/extensions/merge-conflict/src/services.ts b/extensions/merge-conflict/src/services.ts index 320adb3e53e..f3eb0e0630e 100644 --- a/extensions/merge-conflict/src/services.ts +++ b/extensions/merge-conflict/src/services.ts @@ -26,9 +26,9 @@ export default class ServiceWrapper implements vscode.Disposable { this.services.push( documentTracker, - new CommandHandler(this.context, documentTracker), - new CodeLensProvider(this.context, documentTracker), - new ContentProvider(this.context), + new CommandHandler(documentTracker), + new CodeLensProvider(documentTracker), + new ContentProvider(), new Decorator(this.context, documentTracker), ); diff --git a/extensions/merge-conflict/tsconfig.json b/extensions/merge-conflict/tsconfig.json index b67b8ea9a1d..545f2260b61 100644 --- a/extensions/merge-conflict/tsconfig.json +++ b/extensions/merge-conflict/tsconfig.json @@ -6,6 +6,10 @@ ], "module": "commonjs", "outDir": "./out", + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "strict": true, "experimentalDecorators": true }, From c847df3d259f64cd763d8a8d24ecbcb4d697a968 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:09:16 -0800 Subject: [PATCH 36/88] Remove some unused locals and types --- src/vs/base/browser/htmlContentRenderer.ts | 3 --- .../code/electron-browser/contrib/nodeCachedDataCleaner.ts | 4 ---- src/vs/workbench/parts/tasks/node/taskConfiguration.ts | 7 +------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 61a1a593f92..1a0097aadf8 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -50,9 +50,6 @@ export function renderFormattedText(formattedText: string, options: RenderOption export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions = {}): HTMLElement { const element = createElement(options); - //@ts-ignore unused local - const { codeBlockRenderer, actionCallback } = options; - // signal to code-block render that the // element has been created let signalInnerHTML: Function; diff --git a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts index 9ff6f861378..2f56affc386 100644 --- a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts +++ b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts @@ -12,10 +12,6 @@ import { readdir, rimraf, stat } from 'vs/base/node/pfs'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import product from 'vs/platform/node/product'; -declare type OnNodeCachedDataArgs = [{ errorCode: string, path: string, detail?: string }, { path: string, length: number }]; -// @ts-ignore unused local -declare const MonacoEnvironment: { onNodeCachedData: OnNodeCachedDataArgs[] }; - export class NodeCachedDataCleaner { private static _DataMaxAge = product.nameLong.indexOf('Insiders') >= 0 diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts index a69d801d963..280c007955c 100644 --- a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts +++ b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts @@ -14,7 +14,7 @@ import * as Platform from 'vs/base/common/platform'; import * as Types from 'vs/base/common/types'; import * as UUID from 'vs/base/common/uuid'; -import { ValidationStatus, IProblemReporter as IProblemReporterBase, NullProblemReporter as NullProblemReporterBase } from 'vs/base/common/parsers'; +import { ValidationStatus, IProblemReporter as IProblemReporterBase } from 'vs/base/common/parsers'; import { NamedProblemMatcher, ProblemMatcher, ProblemMatcherParser, Config as ProblemMatcherConfig, isNamedProblemMatcher, ProblemMatcherRegistry @@ -1648,11 +1648,6 @@ export interface IProblemReporter extends IProblemReporterBase { clearOutput(): void; } -// @ts-ignore unused type -class NullProblemReporter extends NullProblemReporterBase implements IProblemReporter { - clearOutput(): void { } -} - class UUIDMap { private last: IStringDictionary; From 1db3758c288412249044e109af2774ad91e90bc6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:11:52 -0800 Subject: [PATCH 37/88] Remove unused generic type --- src/vs/base/common/parsers.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vs/base/common/parsers.ts b/src/vs/base/common/parsers.ts index 7758e6ac629..495459f4dd7 100644 --- a/src/vs/base/common/parsers.ts +++ b/src/vs/base/common/parsers.ts @@ -163,8 +163,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables { } resolveAny(value: T): T; - // @ts-ignore unused generic parameter - resolveAny(value: any): any { + resolveAny(value: any): any { if (Types.isString(value)) { return this.resolveString(value); } else if (Types.isArray(value)) { @@ -198,8 +197,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables { } private __resolveAnyLiteral(values: T): T; - // @ts-ignore unused generic parameter - private __resolveAnyLiteral(values: any): any { + private __resolveAnyLiteral(values: any): any { let result: IStringDictionary | string[]> = Object.create(null); Object.keys(values).forEach(key => { let value = values[key]; From 512803f57dcc88f81c32cce62797bf6de45e37bd Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:13:07 -0800 Subject: [PATCH 38/88] Remove some unused locals and write only members --- .../editor/contrib/inPlaceReplace/common/inPlaceReplace.ts | 3 --- .../standalone/browser/inspectTokens/inspectTokens.ts | 3 --- src/vs/editor/standalone/browser/standaloneCodeEditor.ts | 7 ------- 3 files changed, 13 deletions(-) diff --git a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts index b25fc4caa2e..4e5eba2cf32 100644 --- a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts @@ -34,8 +34,6 @@ class InPlaceReplaceController implements IEditorContribution { }); private editor: ICommonCodeEditor; - // @ts-ignore unused property - private requestIdPool: number; private currentRequest: TPromise; private decorationRemover: TPromise; private decorationIds: string[]; @@ -47,7 +45,6 @@ class InPlaceReplaceController implements IEditorContribution { ) { this.editor = editor; this.editorWorkerService = editorWorkerService; - this.requestIdPool = 0; this.currentRequest = TPromise.as(null); this.decorationRemover = TPromise.as(null); this.decorationIds = []; diff --git a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index 4b1ef0da9ec..50f8cab07b9 100644 --- a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -170,8 +170,6 @@ class InspectTokensWidget extends Disposable implements IContentWidget { public allowEditorOverflow = true; private _editor: ICodeEditor; - // @ts-ignore unused injected service - private _standaloneThemeService: IStandaloneThemeService; private _modeService: IModeService; private _tokenizationSupport: ITokenizationSupport; private _model: IModel; @@ -184,7 +182,6 @@ class InspectTokensWidget extends Disposable implements IContentWidget { ) { super(); this._editor = editor; - this._standaloneThemeService = standaloneThemeService; this._modeService = modeService; this._model = this._editor.getModel(); this._domNode = document.createElement('div'); diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 9e3e05dc781..bb23be19f3c 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -307,9 +307,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon private _contextViewService: IEditorContextViewService; - // @ts-ignore unused injected service - private _standaloneKeybindingService: StandaloneKeybindingService; - constructor( domElement: HTMLElement, options: IDiffEditorConstructionOptions, @@ -330,10 +327,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon super(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, messageService); - if (keybindingService instanceof StandaloneKeybindingService) { - this._standaloneKeybindingService = keybindingService; - } - this._contextViewService = contextViewService; this._register(toDispose); From e18ebff45a6b096ffd64f909b42a1c2f728a0f9a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:14:51 -0800 Subject: [PATCH 39/88] Remove some additional unused locals and write only members --- src/vs/base/common/diff/diff2.ts | 11 ----------- src/vs/editor/common/viewLayout/viewLineRenderer.ts | 5 ----- 2 files changed, 16 deletions(-) diff --git a/src/vs/base/common/diff/diff2.ts b/src/vs/base/common/diff/diff2.ts index 877ab0aff27..3bb52c68b94 100644 --- a/src/vs/base/common/diff/diff2.ts +++ b/src/vs/base/common/diff/diff2.ts @@ -57,9 +57,6 @@ export class LcsDiff2 { private ids_for_x: number[]; private ids_for_y: number[]; - // @ts-ignore unused property - private hashFunc: IHashFunction; - private resultX: boolean[]; private resultY: boolean[]; private forwardPrev: number[]; @@ -73,14 +70,6 @@ export class LcsDiff2 { this.ids_for_x = []; this.ids_for_y = []; - if (hashFunc) { - this.hashFunc = hashFunc; - } else { - this.hashFunc = function (sequence, index) { - return sequence[index]; - }; - } - this.resultX = []; this.resultY = []; this.forwardPrev = []; diff --git a/src/vs/editor/common/viewLayout/viewLineRenderer.ts b/src/vs/editor/common/viewLayout/viewLineRenderer.ts index 68dd0b726eb..f0923f2e775 100644 --- a/src/vs/editor/common/viewLayout/viewLineRenderer.ts +++ b/src/vs/editor/common/viewLayout/viewLineRenderer.ts @@ -618,8 +618,6 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render { let _charIndex = charIndex; let _tabsCharDelta = tabsCharDelta; - // @ts-ignore unused local - let _charOffsetInPart = charOffsetInPart; for (; _charIndex < partEndIndex; _charIndex++) { const charCode = lineContent.charCodeAt(_charIndex); @@ -627,13 +625,10 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render if (charCode === CharCode.Tab) { let insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize; _tabsCharDelta += insertSpacesCount - 1; - _charOffsetInPart += insertSpacesCount - 1; partContentCnt += insertSpacesCount; } else { partContentCnt++; } - - _charOffsetInPart++; } } From af4ad417b1509052772865e07f06a9a2a4a928a2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:16:56 -0800 Subject: [PATCH 40/88] Remove unused locals in sash --- src/vs/base/browser/ui/sash/sash.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 22947e67d88..22c9ff134a2 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -12,7 +12,7 @@ import { isIPad } from 'vs/base/browser/browser'; import { isMacintosh } from 'vs/base/common/platform'; import types = require('vs/base/common/types'); import DOM = require('vs/base/browser/dom'); -import { Gesture, EventType, GestureEvent } from 'vs/base/browser/touch'; +import { EventType, GestureEvent } from 'vs/base/browser/touch'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import Event, { Emitter } from 'vs/base/common/event'; @@ -51,7 +51,6 @@ export enum Orientation { export class Sash extends EventEmitter { private $e: Builder; - private gesture: Gesture; private layoutProvider: ISashLayoutProvider; private isDisabled: boolean; private hidden: boolean; @@ -67,8 +66,6 @@ export class Sash extends EventEmitter { this.$e.addClass('mac'); } - this.gesture = new Gesture(this.$e.getHTMLElement()); - this.$e.on(DOM.EventType.MOUSE_DOWN, (e) => { this.onMouseDown(e as MouseEvent); }); this.$e.on(DOM.EventType.DBLCLICK, (e) => { this.emit('reset', e as MouseEvent); }); this.$e.on(EventType.Start, (e) => { this.onTouchStart(e as GestureEvent); }); From c3eb3f5739e1f26aea72732f19a90335987b7362 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:20:23 -0800 Subject: [PATCH 41/88] Remove some unused private members --- src/vs/base/common/paging.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/base/common/paging.ts b/src/vs/base/common/paging.ts index 37153a4bcac..286fa69d08f 100644 --- a/src/vs/base/common/paging.ts +++ b/src/vs/base/common/paging.ts @@ -51,8 +51,7 @@ export class PagedModel implements IPagedModel { get length(): number { return this.pager.total; } - // @ts-ignore unused property - constructor(private arg: IPager | T[], private pageTimeout: number = 500) { + constructor(arg: IPager | T[], private pageTimeout: number = 500) { this.pager = isArray(arg) ? singlePagePager(arg) : arg; this.pages = [{ isResolved: true, promise: null, promiseIndexes: new Set(), elements: this.pager.firstPage.slice() }]; From 68491dafa7abc4f02ef04542a64e878ed14a3544 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:21:36 -0800 Subject: [PATCH 42/88] Remove unused interface and IEditorService member --- .../parts/cli/electron-browser/cli.contribution.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts index 59570f7a220..32a8c8227fc 100644 --- a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts +++ b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts @@ -15,15 +15,8 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; -import { IEditorService } from 'vs/platform/editor/common/editor'; import product from 'vs/platform/node/product'; -// @ts-ignore unused type -interface ILegacyUse { - file: string; - lineNumber: number; -} - function ignore(code: string, value: T = null): (err: any) => TPromise { return err => err.code === code ? TPromise.as(value) : TPromise.wrapError(err); } @@ -43,9 +36,7 @@ class InstallAction extends Action { constructor( id: string, label: string, - @IMessageService private messageService: IMessageService, - // @ts-ignore unused injected service - @IEditorService private editorService: IEditorService + @IMessageService private messageService: IMessageService ) { super(id, label); } From 04f322fc892a364e17e55e89c570c51a691ce3cf Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:29:48 -0800 Subject: [PATCH 43/88] Resolve merge conflict around unused locals --- extensions/emmet/src/test/reflectCssValue.test.ts | 2 +- extensions/emmet/src/test/updateImageSize.test.ts | 2 -- src/vs/base/browser/ui/sash/sash.ts | 5 ----- .../walkThrough/electron-browser/walkThroughPart.ts | 11 +---------- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/extensions/emmet/src/test/reflectCssValue.test.ts b/extensions/emmet/src/test/reflectCssValue.test.ts index 228c62ed960..001ec1c8973 100644 --- a/extensions/emmet/src/test/reflectCssValue.test.ts +++ b/extensions/emmet/src/test/reflectCssValue.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { Selection, commands } from 'vscode'; +import { Selection } from 'vscode'; import { withRandomFileEditor, closeAllEditors } from './testUtils'; import { reflectCssValue } from '../reflectCssValue'; diff --git a/extensions/emmet/src/test/updateImageSize.test.ts b/extensions/emmet/src/test/updateImageSize.test.ts index 2fadbe94d58..cd43863e738 100644 --- a/extensions/emmet/src/test/updateImageSize.test.ts +++ b/extensions/emmet/src/test/updateImageSize.test.ts @@ -7,11 +7,9 @@ import * as assert from 'assert'; import { Selection } from 'vscode'; import { withRandomFileEditor, closeAllEditors } from './testUtils'; import { updateImageSize } from '../updateImageSize'; -import * as path from 'path'; suite('Tests for Emmet actions on html tags', () => { teardown(closeAllEditors); - const filePath = path.join(__dirname, '../../../../resources/linux/code.png'); test('update image css with multiple cursors in css file', () => { const cssContents = ` diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 22c9ff134a2..2569e53d3ab 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -263,11 +263,6 @@ export class Sash extends EventEmitter { this.$e = null; } - if (this.gesture) { - this.gesture.dispose(); - this.gesture = null; - } - super.dispose(); } } diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts index d916ffa0e68..2eb59c0b93d 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts @@ -19,8 +19,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { marked } from 'vs/base/common/marked/marked'; -import { IModeService } from 'vs/editor/common/services/modeService'; -import { IFileService } from 'vs/platform/files/common/files'; import { IModelService } from 'vs/editor/common/services/modelService'; import { CodeEditor } from 'vs/editor/browser/codeEditor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -34,7 +32,6 @@ import { once } from 'vs/base/common/event'; import { isObject } from 'vs/base/common/types'; import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; -import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; @@ -99,18 +96,12 @@ export class WalkThroughPart extends BaseEditor { @IInstantiationService private instantiationService: IInstantiationService, @IThemeService protected themeService: IThemeService, @IOpenerService private openerService: IOpenerService, - // @ts-ignore unused injected service - @IFileService private fileService: IFileService, @IModelService protected modelService: IModelService, @IKeybindingService private keybindingService: IKeybindingService, @IStorageService private storageService: IStorageService, @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, - // @ts-ignore unused injected service - @IModeService private modeService: IModeService, - @IMessageService private messageService: IMessageService, - // @ts-ignore unused injected service - @IPartService private partService: IPartService + @IMessageService private messageService: IMessageService ) { super(WalkThroughPart.ID, telemetryService, themeService); this.editorFocus = WALK_THROUGH_FOCUS.bindTo(this.contextKeyService); From f4194379baec414aad5c000de8ec17ff58d7fba4 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:33:58 -0800 Subject: [PATCH 44/88] Remove unused types --- .../browser/parts/editor/webviewEditor.ts | 6 -- .../debug/electron-browser/debugService.ts | 6 -- .../electron-browser/task.contribution.ts | 60 +------------------ .../electron-browser/terminalTaskSystem.ts | 6 -- .../electron-browser/gettingStarted.ts | 45 -------------- .../node/configurationEditingService.ts | 6 -- 6 files changed, 1 insertion(+), 128 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/webviewEditor.ts b/src/vs/workbench/browser/parts/editor/webviewEditor.ts index fdc9f2fa59a..a1809c369d2 100644 --- a/src/vs/workbench/browser/parts/editor/webviewEditor.ts +++ b/src/vs/workbench/browser/parts/editor/webviewEditor.ts @@ -14,12 +14,6 @@ export interface HtmlPreviewEditorViewState { scrollYPercentage: number; } -// @ts-ignore unused type -interface HtmlPreviewEditorViewStates { - 0?: HtmlPreviewEditorViewState; - 1?: HtmlPreviewEditorViewState; - 2?: HtmlPreviewEditorViewState; -} /** * This class is only intended to be subclassed and not instantiated. diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index f8d476f7ca2..63c63762549 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -60,12 +60,6 @@ const DEBUG_FUNCTION_BREAKPOINTS_KEY = 'debug.functionbreakpoint'; const DEBUG_EXCEPTION_BREAKPOINTS_KEY = 'debug.exceptionbreakpoint'; const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions'; -// @ts-ignore unused type -interface StartSessionResult { - status: 'ok' | 'initialConfiguration' | 'saveConfiguration'; - content?: string; -} - export class DebugService implements debug.IDebugService { public _serviceBrand: any; diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index e889a21f26e..4eb99abea9a 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -71,7 +71,7 @@ import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; -import { ITaskSystem, ITaskResolver, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TaskSystemEvents, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; +import { ITaskSystem, ITaskResolver, ITaskSummary, TaskExecuteKind, TaskError, TaskErrors, TaskSystemEvents, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; import { Task, CustomTask, ConfiguringTask, ContributedTask, InMemoryTask, TaskSet, TaskGroup, GroupType, ExecutionEngine, JsonSchemaVersion, TaskSourceKind, TaskIdentifier, TaskSorter } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskService, TaskServiceEvents, ITaskProvider, TaskEvent, RunOptions, CustomizationProperties } from 'vs/workbench/parts/tasks/common/taskService'; import { templates as taskTemplates } from 'vs/workbench/parts/tasks/common/taskTemplates'; @@ -97,12 +97,6 @@ namespace ConfigureTaskAction { export const TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task"); } -// @ts-ignore unused type -namespace ConfigureBuildTaskAction { - export const ID = 'workbench.action.tasks.configureBuildTask'; - export const TEXT = nls.localize('ConfigureBuildTaskAction.label', "Configure Build Task"); -} - class CloseMessageAction extends Action { public static ID = 'workbench.action.build.closeMessage'; @@ -121,22 +115,6 @@ class CloseMessageAction extends Action { } } -// @ts-ignore unused type -class ViewTerminalAction extends Action { - - public static ID = 'workbench.action.build.viewTerminal'; - public static TEXT = nls.localize('ShowTerminalAction.label', 'View Terminal'); - - constructor( @ITerminalService private terminalService: ITerminalService) { - super(ViewTerminalAction.ID, ViewTerminalAction.TEXT); - } - - public run(): TPromise { - this.terminalService.showPanel(); - return TPromise.as(undefined); - } -} - class BuildStatusBarItem extends Themable implements IStatusbarItem { private activeCount: number; private icons: HTMLElement[]; @@ -386,42 +364,6 @@ class TaskStatusBarItem extends Themable implements IStatusbarItem { } } -// @ts-ignore unused type -interface TaskServiceEventData { - error?: any; -} - -// @ts-ignore unused type -class NullTaskSystem extends EventEmitter implements ITaskSystem { - public run(task: Task): ITaskExecuteResult { - return { - kind: TaskExecuteKind.Started, - promise: TPromise.as({}) - }; - } - public revealTask(task: Task): boolean { - return false; - } - public isActive(): TPromise { - return TPromise.as(false); - } - public isActiveSync(): boolean { - return false; - } - public getActiveTasks(): Task[] { - return []; - } - public canAutoTerminate(): boolean { - return true; - } - public terminate(task: string | Task): TPromise { - return TPromise.as({ success: true, task: undefined }); - } - public terminateAll(): TPromise { - return TPromise.as([]); - } -} - class ProblemReporter implements TaskConfig.IProblemReporter { private _validationStatus: ValidationStatus; diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 0db084bf985..a5cec7639db 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -38,12 +38,6 @@ import { TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; -// @ts-ignore unused type -interface PrimaryTerminal { - terminal: ITerminalInstance; - busy: boolean; -} - interface TerminalData { terminal: ITerminalInstance; lastTask: string; diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts index 74df1a7312d..04541aa4295 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts @@ -11,51 +11,6 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import * as platform from 'vs/base/common/platform'; import product from 'vs/platform/node/product'; -// @ts-ignore unused type -abstract class AbstractGettingStarted implements IWorkbenchContribution { - protected static hideWelcomeSettingskey = 'workbench.hide.welcome'; - - protected welcomePageURL: string; - protected appName: string; - - constructor( - @IStorageService private storageService: IStorageService, - @IEnvironmentService environmentService: IEnvironmentService, - @ITelemetryService private telemetryService: ITelemetryService - ) { - this.appName = product.nameLong; - - if (product.welcomePage && !environmentService.isExtensionDevelopment /* do not open a browser when we run an extension */) { - this.welcomePageURL = product.welcomePage; - this.handleWelcome(); - } - } - - protected handleWelcome(): void { - let firstStartup = !this.storageService.get(AbstractGettingStarted.hideWelcomeSettingskey); - - if (firstStartup && this.welcomePageURL) { - this.telemetryService.getTelemetryInfo().then(info => { - let url = this.getUrl(info); - this.openExternal(url); - this.storageService.store(AbstractGettingStarted.hideWelcomeSettingskey, true); - }); - } - } - - private getUrl(telemetryInfo: ITelemetryInfo): string { - return `${this.welcomePageURL}&&from=${this.appName}&&id=${telemetryInfo.machineId}`; - } - - protected openExternal(url: string) { - throw new Error('implement me'); - } - - getId(): string { - return 'vs.gettingstarted'; - } -} - export class GettingStarted implements IWorkbenchContribution { private static hideWelcomeSettingskey = 'workbench.hide.welcome'; diff --git a/src/vs/workbench/services/configuration/node/configurationEditingService.ts b/src/vs/workbench/services/configuration/node/configurationEditingService.ts index ce0d601fd93..1deacb7b526 100644 --- a/src/vs/workbench/services/configuration/node/configurationEditingService.ts +++ b/src/vs/workbench/services/configuration/node/configurationEditingService.ts @@ -109,12 +109,6 @@ interface IConfigurationEditOperation extends IConfigurationValue { } -// @ts-ignore unused type -interface IValidationResult { - error?: ConfigurationEditingErrorCode; - exists?: boolean; -} - interface ConfigurationEditingOptions extends IConfigurationEditingOptions { force?: boolean; } From 31b7b0bd3e090d1324bf981be10db7ffbd447b7c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:42:00 -0800 Subject: [PATCH 45/88] Remove unused generic parameter --- src/vs/base/browser/ui/list/listWidget.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index df29b26b178..16f8e590c29 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -52,8 +52,7 @@ interface IRenderedElement { index: number; } -// @ts-ignore unused generic parameter -class TraitRenderer implements IRenderer +class TraitRenderer implements IRenderer { private rendered: IRenderedElement[] = []; @@ -108,8 +107,8 @@ class Trait implements ISpliceable, IDisposable { get trait(): string { return this._trait; } @memoize - get renderer(): TraitRenderer { - return new TraitRenderer(this); + get renderer(): TraitRenderer { + return new TraitRenderer(this); } constructor(private _trait: string) { From 0137b582212510a0a49d3bd05dd2158ffcc627ca Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:47:44 -0800 Subject: [PATCH 46/88] Remove unused properties --- src/vs/base/browser/ui/splitview/panelview.ts | 3 +-- src/vs/base/browser/ui/splitview/splitview.ts | 3 +-- src/vs/base/parts/ipc/common/ipc.electron.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index 746ef764007..00e111e5668 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -338,8 +338,7 @@ export class PanelView implements IDisposable { readonly onDidSashChange: Event; - // @ts-ignore unused property - constructor(private container: HTMLElement, options: IPanelViewOptions = {}) { + constructor(container: HTMLElement, options: IPanelViewOptions = {}) { this.dnd = !!options.dnd; this.el = append(container, $('.monaco-panel-view')); this.splitview = new SplitView(this.el); diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index ac2c0d95c41..64c18622cb4 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -76,8 +76,7 @@ export class SplitView implements IDisposable { get length(): number { return this.viewItems.length; } - // @ts-ignore unused property - constructor(private container: HTMLElement, options: ISplitViewOptions = {}) { + constructor(container: HTMLElement, options: ISplitViewOptions = {}) { this.orientation = types.isUndefined(options.orientation) ? Orientation.VERTICAL : options.orientation; this.el = document.createElement('div'); diff --git a/src/vs/base/parts/ipc/common/ipc.electron.ts b/src/vs/base/parts/ipc/common/ipc.electron.ts index c69b7eac88b..1223020a9ff 100644 --- a/src/vs/base/parts/ipc/common/ipc.electron.ts +++ b/src/vs/base/parts/ipc/common/ipc.electron.ts @@ -18,8 +18,7 @@ export class Protocol implements IMessagePassingProtocol { private _onMessage: Event; get onMessage(): Event { return this._onMessage; } - // @ts-ignore unused property - constructor(private sender: Sender, private onMessageEvent: Event) { + constructor(private sender: Sender, onMessageEvent: Event) { const emitter = new Emitter(); onMessageEvent(msg => emitter.fire(msg)); this._onMessage = emitter.event; From 4b4ac1b4d9eb8f6901369f4510bd80ade45e3d88 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:48:38 -0800 Subject: [PATCH 47/88] Remove unused generic types --- src/vs/platform/configuration/common/configurationModels.ts | 6 ++---- .../instantiation/test/common/instantiationServiceMock.ts | 6 ++---- src/vs/workbench/api/node/extHost.api.impl.ts | 3 +-- src/vs/workbench/browser/parts/views/viewsRegistry.ts | 3 +-- .../test/electron-browser/terminalConfigHelper.test.ts | 3 +-- .../node/configurationResolverService.ts | 6 ++---- .../test/node/configurationResolverService.test.ts | 4 +--- 7 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index 6eff3d729e9..6ae3de36627 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -55,8 +55,7 @@ export class ConfigurationModel implements IConfigurationModel { addToValueTree(override.contents, key, value, e => { throw new Error(e); }); } - // @ts-ignore unused generic parameter - public override(identifier: string): ConfigurationModel { + public override(identifier: string): ConfigurationModel { const overrideContents = this.getContentsForOverrideIdentifer(identifier); if (!overrideContents || typeof overrideContents !== 'object' || !Object.keys(overrideContents).length) { @@ -386,8 +385,7 @@ export class Configuration { }); } - // @ts-ignore unused generic parameter - private getConsolidateConfigurationModel(overrides: IConfigurationOverrides, workspace: Workspace): ConfigurationModel { + private getConsolidateConfigurationModel(overrides: IConfigurationOverrides, workspace: Workspace): ConfigurationModel { let configurationModel = this.getConsolidatedConfigurationModelForResource(overrides, workspace); return overrides.overrideIdentifier ? configurationModel.override(overrides.overrideIdentifier) : configurationModel; } diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index c09fb7e714b..da3a17eb8b0 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -73,8 +73,7 @@ export class TestInstantiationService extends InstantiationService { public stubPromise(service?: ServiceIdentifier, fnProperty?: string, value?: any): T | sinon.SinonStub; public stubPromise(service?: ServiceIdentifier, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub; public stubPromise(service?: ServiceIdentifier, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub; - // @ts-ignore unused generic parameter - public stubPromise(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub { + public stubPromise(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub { arg3 = typeof arg2 === 'string' ? TPromise.as(arg3) : arg3; arg4 = typeof arg2 !== 'string' && typeof arg3 === 'string' ? TPromise.as(arg4) : arg4; return this.stub(arg1, arg2, arg3, arg4); @@ -88,8 +87,7 @@ export class TestInstantiationService extends InstantiationService { private _create(serviceMock: IServiceMock, options: SinonOptions, reset?: boolean): any; private _create(ctor: any, options: SinonOptions): any; - // @ts-ignore unused generic parameter - private _create(arg1: any, options: SinonOptions, reset: boolean = false): any { + private _create(arg1: any, options: SinonOptions, reset: boolean = false): any { if (this.isServiceMock(arg1)) { let service = this._getOrCreateService(arg1, options, reset); this._serviceCollection.set(arg1.id, service); diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index eb450597c93..275da883ed8 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -142,8 +142,7 @@ export function createApiFactory( // namespace: commands const commands: typeof vscode.commands = { - // @ts-ignore unused generic parameter - registerCommand(id: string, command: (...args: any[]) => T | Thenable, thisArgs?: any): vscode.Disposable { + registerCommand(id: string, command: (...args: any[]) => T | Thenable, thisArgs?: any): vscode.Disposable { return extHostCommands.registerCommand(id, command, thisArgs); }, registerTextEditorCommand(id: string, callback: (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => void, thisArg?: any): vscode.Disposable { diff --git a/src/vs/workbench/browser/parts/views/viewsRegistry.ts b/src/vs/workbench/browser/parts/views/viewsRegistry.ts index 411f4181f60..b5c6f618b02 100644 --- a/src/vs/workbench/browser/parts/views/viewsRegistry.ts +++ b/src/vs/workbench/browser/parts/views/viewsRegistry.ts @@ -122,8 +122,7 @@ export const ViewsRegistry: IViewsRegistry = new class { this._onViewsDeregistered.fire(viewsToDeregister); } - // @ts-ignore unused generic parameter - registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { + registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { if (!this.isDataProviderRegistered(id)) { // TODO: throw error } diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index 25b6767742d..d1a46066f45 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -21,8 +21,7 @@ class MockConfigurationService implements IConfigurationService { public keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; } public getConfiguration(): any { return this.configuration; } public getValue(key: string, overrides?: IConfigurationOverrides): T { return getConfigurationValue(this.getConfiguration(), key); } - // @ts-ignore unused generic parameter - public updateValue(): TPromise { return null; } + public updateValue(): TPromise { return null; } public getConfigurationData(): any { return null; } public onDidChangeConfiguration() { return { dispose() { } }; } public reloadConfiguration() { return null; } diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index cb7c2dce949..80a59f403e7 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -133,8 +133,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } public resolveAny(root: IWorkspaceFolder, value: T): T; - // @ts-ignore unused generic parameter - public resolveAny(root: IWorkspaceFolder, value: any): any { + public resolveAny(root: IWorkspaceFolder, value: any): any { try { this._lastWorkspaceFolder = root; if (types.isString(value)) { @@ -206,8 +205,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } private resolveAnyLiteral(root: IWorkspaceFolder, values: T): T; - // @ts-ignore unused generic parameter - private resolveAnyLiteral(root: IWorkspaceFolder, values: any): any { + private resolveAnyLiteral(root: IWorkspaceFolder, values: any): any { let result: IStringDictionary | string[]> = Object.create(null); Object.keys(values).forEach(key => { let value = values[key]; diff --git a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts index b44f10acfd8..a7ad4e84a3f 100644 --- a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts @@ -364,9 +364,7 @@ class MockCommandService implements ICommandService { public callCount = 0; onWillExecuteCommand = () => ({ dispose: () => { } }); - - // @ts-ignore unused generic parameter - public executeCommand(commandId: string, ...args: any[]): TPromise { + public executeCommand(commandId: string, ...args: any[]): TPromise { this.callCount++; return TPromise.as(commandId); } From 503a0f3397a6eafa7c78870a25f18a8b8472cd62 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 11:51:38 -0800 Subject: [PATCH 48/88] Remove unused members --- src/vs/base/parts/tree/browser/treeImpl.ts | 19 +++++++------------ src/vs/base/parts/tree/browser/treeModel.ts | 3 --- src/vs/base/parts/tree/browser/treeView.ts | 3 --- .../browser/controller/textAreaHandler.ts | 6 ------ .../editor/browser/viewParts/rulers/rulers.ts | 4 ---- 5 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/vs/base/parts/tree/browser/treeImpl.ts b/src/vs/base/parts/tree/browser/treeImpl.ts index dae1fff48f2..0397e0171f4 100644 --- a/src/vs/base/parts/tree/browser/treeImpl.ts +++ b/src/vs/base/parts/tree/browser/treeImpl.ts @@ -64,9 +64,6 @@ const defaultStyles: _.ITreeStyles = { export class Tree extends Events.EventEmitter implements _.ITree { private container: HTMLElement; - // @ts-ignore unused property - private configuration: _.ITreeConfiguration; - private options: _.ITreeOptions; private context: _.ITreeContext; private model: Model.TreeModel; @@ -88,16 +85,14 @@ export class Tree extends Events.EventEmitter implements _.ITree { this.toDispose.push(this._onDispose, this._onHighlightChange); this.container = container; - this.configuration = configuration; - this.options = options; - mixin(this.options, defaultStyles, false); + mixin(options, defaultStyles, false); - this.options.twistiePixels = typeof this.options.twistiePixels === 'number' ? this.options.twistiePixels : 32; - this.options.showTwistie = this.options.showTwistie === false ? false : true; - this.options.indentPixels = typeof this.options.indentPixels === 'number' ? this.options.indentPixels : 12; - this.options.alwaysFocused = this.options.alwaysFocused === true ? true : false; - this.options.useShadows = this.options.useShadows === false ? false : true; - this.options.paddingOnRow = this.options.paddingOnRow === false ? false : true; + options.twistiePixels = typeof options.twistiePixels === 'number' ? options.twistiePixels : 32; + options.showTwistie = options.showTwistie === false ? false : true; + options.indentPixels = typeof options.indentPixels === 'number' ? options.indentPixels : 12; + options.alwaysFocused = options.alwaysFocused === true ? true : false; + options.useShadows = options.useShadows === false ? false : true; + options.paddingOnRow = options.paddingOnRow === false ? false : true; this.context = new TreeContext(this, configuration, options); this.model = new Model.TreeModel(this.context); diff --git a/src/vs/base/parts/tree/browser/treeModel.ts b/src/vs/base/parts/tree/browser/treeModel.ts index c2119257743..cfeafa0b078 100644 --- a/src/vs/base/parts/tree/browser/treeModel.ts +++ b/src/vs/base/parts/tree/browser/treeModel.ts @@ -205,8 +205,6 @@ export class Item extends Events.EventEmitter { public next: Item; public firstChild: Item; public lastChild: Item; - // @ts-ignore unused property - private userContent: HTMLElement; private height: number; private depth: number; @@ -238,7 +236,6 @@ export class Item extends Events.EventEmitter { this.firstChild = null; this.lastChild = null; - this.userContent = null; this.traits = {}; this.depth = 0; this.expanded = this.context.dataSource.shouldAutoexpand && this.context.dataSource.shouldAutoexpand(this.context.tree, element); diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index bbd6e4c4476..2aea91d703f 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -392,8 +392,6 @@ export class TreeView extends HeightMap { private isRefreshing = false; private refreshingPreviousChildrenIds: { [id: string]: string[] } = {}; - // @ts-ignore unused property - private dragAndDropListeners: { (): void; }[]; private currentDragAndDropData: _.IDragAndDropData; private currentDropElement: any; private currentDropElementReaction: _.IDragOverReaction; @@ -437,7 +435,6 @@ export class TreeView extends HeightMap { this.modelListeners = []; this.viewListeners = []; - this.dragAndDropListeners = []; this.model = null; this.items = {}; diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts index 6b7f630467c..d4428d9ce78 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -54,8 +54,6 @@ export class TextAreaHandler extends ViewPart { private readonly _viewController: ViewController; private readonly _viewHelper: ITextAreaHandlerHelper; - // @ts-ignore unused property - private _pixelRatio: number; private _accessibilitySupport: platform.AccessibilitySupport; private _contentLeft: number; private _contentWidth: number; @@ -86,7 +84,6 @@ export class TextAreaHandler extends ViewPart { const conf = this._context.configuration.editor; - this._pixelRatio = conf.pixelRatio; this._accessibilitySupport = conf.accessibilitySupport; this._contentLeft = conf.layoutInfo.contentLeft; this._contentWidth = conf.layoutInfo.contentWidth; @@ -306,9 +303,6 @@ export class TextAreaHandler extends ViewPart { if (e.lineHeight) { this._lineHeight = conf.lineHeight; } - if (e.pixelRatio) { - this._pixelRatio = conf.pixelRatio; - } if (e.accessibilitySupport) { this._accessibilitySupport = conf.accessibilitySupport; this._textAreaInput.writeScreenReaderContent('strategy changed'); diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 813a995c000..036ff988cb7 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -20,8 +20,6 @@ export class Rulers extends ViewPart { public domNode: FastDomNode; private _renderedRulers: FastDomNode[]; private _rulers: number[]; - // @ts-ignore unused property - private _height: number; private _typicalHalfwidthCharacterWidth: number; constructor(context: ViewContext) { @@ -32,7 +30,6 @@ export class Rulers extends ViewPart { this.domNode.setClassName('view-rulers'); this._renderedRulers = []; this._rulers = this._context.configuration.editor.viewInfo.rulers; - this._height = this._context.configuration.editor.layoutInfo.contentHeight; this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth; } @@ -45,7 +42,6 @@ export class Rulers extends ViewPart { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { if (e.viewInfo || e.layoutInfo || e.fontInfo) { this._rulers = this._context.configuration.editor.viewInfo.rulers; - this._height = this._context.configuration.editor.layoutInfo.contentHeight; this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth; return true; } From c3a8519ecd002467a1a5842704aa15e04d99293d Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 7 Nov 2017 11:58:09 -0800 Subject: [PATCH 49/88] Fix ts-ignore rules in terminal files Part of #37212 --- .../terminal/browser/terminalQuickOpen.ts | 7 +---- .../terminal/browser/terminalWidgetManager.ts | 3 --- .../terminal/electron-browser/terminal.ts | 5 ---- .../electron-browser/terminalActions.ts | 8 +----- .../electron-browser/terminalConfigHelper.ts | 2 -- .../electron-browser/terminalInstance.ts | 26 ++----------------- .../electron-browser/terminalLinkHandler.ts | 3 --- .../electron-browser/terminalPanel.ts | 9 ++----- .../electron-browser/terminalService.ts | 5 +--- .../electron-browser/windowsShellHelper.ts | 5 ---- .../terminalConfigHelper.test.ts | 15 +++++------ .../terminalLinkHandler.test.ts | 10 +++---- 12 files changed, 19 insertions(+), 79 deletions(-) diff --git a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts index c49786a93eb..5ae1d3e6fb0 100644 --- a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts +++ b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts @@ -10,7 +10,6 @@ import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel import { QuickOpenModel, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { stripWildcards } from 'vs/base/common/strings'; import { matchesFuzzy } from 'vs/base/common/filters'; @@ -50,8 +49,6 @@ export class CreateTerminal extends QuickOpenEntry { constructor( private label: string, - // @ts-ignore unused injected service - private terminalService: ITerminalService, private commandService: ICommandService ) { super(); @@ -82,8 +79,6 @@ export class TerminalPickerHandler extends QuickOpenHandler { constructor( @ITerminalService private terminalService: ITerminalService, @ICommandService private commandService: ICommandService, - // @ts-ignore unused injected service - @IPanelService private panelService: IPanelService ) { super(); } @@ -93,7 +88,7 @@ export class TerminalPickerHandler extends QuickOpenHandler { const normalizedSearchValueLowercase = stripWildcards(searchValue).toLowerCase(); const terminalEntries: QuickOpenEntry[] = this.getTerminals(); - terminalEntries.push(new CreateTerminal(nls.localize("'workbench.action.terminal.newplus", "$(plus) Create New Integrated Terminal"), this.terminalService, this.commandService)); + terminalEntries.push(new CreateTerminal(nls.localize("'workbench.action.terminal.newplus", "$(plus) Create New Integrated Terminal"), this.commandService)); const entries = terminalEntries.filter(e => { if (!searchValue) { diff --git a/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts b/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts index bfa10fd50a8..4a1fb003d5e 100644 --- a/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts +++ b/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; export class TerminalWidgetManager { @@ -14,8 +13,6 @@ export class TerminalWidgetManager { private _messageListeners: IDisposable[] = []; constructor( - // @ts-ignore unused property - private _configHelper: ITerminalConfigHelper, terminalWrapper: HTMLElement ) { this._container = document.createElement('div'); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.ts index 1e4d71a8c2d..b73b020260e 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import * as cp from 'child_process'; import * as os from 'os'; import * as platform from 'vs/base/common/platform'; import * as processes from 'vs/base/node/processes'; @@ -26,10 +25,6 @@ const powerShellPath = `${process.env.windir}\\${is32ProcessOn64Windows ? 'Sysna export const TERMINAL_DEFAULT_SHELL_WINDOWS = isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell(); -export interface ITerminalProcessFactory { - create(env: { [key: string]: string }): cp.ChildProcess; -} - if (platform.isLinux) { const file = '/etc/os-release'; fileExists(file).then(exists => { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index dc0db1cebf3..3db89bc5d53 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -729,10 +729,6 @@ export class ShowPreviousFindTermTerminalFindWidgetAction extends Action { export class QuickOpenActionTermContributor extends ActionBarContributor { constructor( - // @ts-ignore unused injected service - @ITerminalService private terminalService: ITerminalService, - // @ts-ignore unused injected service - @IQuickOpenService private quickOpenService: IQuickOpenService, @IInstantiationService private instantiationService: IInstantiationService ) { super(); @@ -776,9 +772,7 @@ export class RenameTerminalQuickOpenAction extends RenameTerminalAction { id: string, label: string, private terminal: TerminalEntry, @IQuickOpenService quickOpenService: IQuickOpenService, - @ITerminalService terminalService: ITerminalService, - // @ts-ignore unused injected service - @IInstantiationService private instantiationService: IInstantiationService + @ITerminalService terminalService: ITerminalService ) { super(id, label, quickOpenService, terminalService); this.class = 'quick-open-terminal-configure'; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index 079dc144f86..3724726111a 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -42,8 +42,6 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { private _lastFontMeasurement: ITerminalFont; public constructor( - // @ts-ignore unused property - private _platform: platform.Platform, @IConfigurationService private _configurationService: IConfigurationService, @IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService, @IChoiceService private _choiceService: IChoiceService, diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 40869c941d0..46cc64e1c2f 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -21,9 +21,6 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IStringDictionary } from 'vs/base/common/collections'; import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; -import { ITerminalProcessFactory } from 'vs/workbench/parts/terminal/electron-browser/terminal'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { TabFocus } from 'vs/editor/common/config/commonEditorConfig'; @@ -47,15 +44,6 @@ XTermTerminal.loadAddon('search'); // Enable the winpty compatibility addon which will simulate wraparound mode XTermTerminal.loadAddon('winptyCompat'); -class StandardTerminalProcessFactory implements ITerminalProcessFactory { - public create(env: { [key: string]: string }): cp.ChildProcess { - return cp.fork('./terminalProcess', [], { - env, - cwd: Uri.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath - }); - } -} - enum ProcessState { // The process has not been initialized yet. UNINITIALIZED, @@ -78,8 +66,6 @@ enum ProcessState { export class TerminalInstance implements ITerminalInstance { private static readonly EOL_REGEX = /\r?\n/g; - // @ts-ignore unused property - private static _terminalProcessFactory: ITerminalProcessFactory = new StandardTerminalProcessFactory(); private static _lastKnownDimensions: Dimension = null; private static _idCounter = 1; @@ -134,10 +120,6 @@ export class TerminalInstance implements ITerminalInstance { @IKeybindingService private _keybindingService: IKeybindingService, @IMessageService private _messageService: IMessageService, @IPanelService private _panelService: IPanelService, - // @ts-ignore unused injected service - @IWorkspaceContextService private _contextService: IWorkspaceContextService, - // @ts-ignore unused injected service - @IWorkbenchEditorService private _editorService: IWorkbenchEditorService, @IInstantiationService private _instantiationService: IInstantiationService, @IClipboardService private _clipboardService: IClipboardService, @IHistoryService private _historyService: IHistoryService, @@ -173,7 +155,7 @@ export class TerminalInstance implements ITerminalInstance { if (platform.isWindows) { this._processReady.then(() => { if (!this._isDisposed) { - this._windowsShellHelper = new WindowsShellHelper(this._processId, this._shellLaunchConfig.executable, this, this._xterm); + this._windowsShellHelper = new WindowsShellHelper(this._processId, this, this._xterm); } }); } @@ -380,7 +362,7 @@ export class TerminalInstance implements ITerminalInstance { })); this._wrapperElement.appendChild(this._xtermElement); - this._widgetManager = new TerminalWidgetManager(this._configHelper, this._wrapperElement); + this._widgetManager = new TerminalWidgetManager(this._wrapperElement); this._linkHandler.setWidgetManager(this._widgetManager); this._container.appendChild(this._wrapperElement); @@ -1022,10 +1004,6 @@ export class TerminalInstance implements ITerminalInstance { }); } - public static setTerminalProcessFactory(factory: ITerminalProcessFactory): void { - this._terminalProcessFactory = factory; - } - public setTitle(title: string, eventFromProcess: boolean): void { if (!title) { return; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index 33d3783991a..22634f79026 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -9,7 +9,6 @@ import * as platform from 'vs/base/common/platform'; import * as pfs from 'vs/base/node/pfs'; import Uri from 'vs/base/common/uri'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -67,8 +66,6 @@ export class TerminalLinkHandler { private _platform: platform.Platform, private _initialCwd: string, @IOpenerService private _openerService: IOpenerService, - // @ts-ignore unused injected service - @IWorkbenchEditorService private _editorService: IWorkbenchEditorService, @IConfigurationService private _configurationService: IConfigurationService, @ITerminalService private _terminalService: ITerminalService ) { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index 130c0e5c601..2dd16ba5775 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -12,10 +12,10 @@ import { Action, IAction } from 'vs/base/common/actions'; import { Builder, Dimension } from 'vs/base/browser/builder'; import { IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ITerminalService, ITerminalFont, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { TerminalFindWidget } from './terminalFindWidget'; import { editorHoverBackground, editorHoverBorder, editorForeground } from 'vs/platform/theme/common/colorRegistry'; @@ -33,8 +33,6 @@ export class TerminalPanel extends Panel { private _copyContextMenuAction: IAction; private _contextMenuActions: IAction[]; private _cancelContextMenu: boolean = false; - // @ts-ignore unused property - private _font: ITerminalFont; private _fontStyleElement: HTMLElement; private _parentDomElement: HTMLElement; private _terminalContainer: HTMLElement; @@ -44,8 +42,6 @@ export class TerminalPanel extends Panel { constructor( @IConfigurationService private _configurationService: IConfigurationService, @IContextMenuService private _contextMenuService: IContextMenuService, - // @ts-ignore unused injected service - @IContextViewService private _contextViewService: IContextViewService, @IInstantiationService private _instantiationService: IInstantiationService, @ITerminalService private _terminalService: ITerminalService, @IThemeService protected themeService: IThemeService, @@ -310,7 +306,6 @@ export class TerminalPanel extends Panel { if (this._terminalService.terminalInstances.length === 0) { return; } - this._font = this._terminalService.configHelper.getFont(); // TODO: Can we support ligatures? // dom.toggleClass(this._parentDomElement, 'enable-ligatures', this._terminalService.configHelper.config.fontLigatures); this.layout(new Dimension(this._parentDomElement.offsetWidth, this._parentDomElement.offsetHeight)); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index 7038f2887a7..d498d16a71f 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -23,7 +23,6 @@ import Severity from 'vs/base/common/severity'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { TERMINAL_DEFAULT_SHELL_WINDOWS } from 'vs/workbench/parts/terminal/electron-browser/terminal'; import { TerminalPanel } from 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; -import { IWindowService } from 'vs/platform/windows/common/windows'; export class TerminalService extends AbstractTerminalService implements ITerminalService { private _configHelper: TerminalConfigHelper; @@ -36,8 +35,6 @@ export class TerminalService extends AbstractTerminalService implements ITermina @IPartService _partService: IPartService, @ILifecycleService _lifecycleService: ILifecycleService, @IInstantiationService private _instantiationService: IInstantiationService, - // @ts-ignore unused injected service - @IWindowService private _windowService: IWindowService, @IQuickOpenService private _quickOpenService: IQuickOpenService, @IChoiceService private _choiceService: IChoiceService, @IStorageService private _storageService: IStorageService, @@ -45,7 +42,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina ) { super(_contextKeyService, _configurationService, _panelService, _partService, _lifecycleService); - this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper, platform.platform); + this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper); } public createInstance(shell: IShellLaunchConfig = {}, wasNewTerminalAction?: boolean): ITerminalInstance { diff --git a/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts index fb4a1f38096..da9a2b515ea 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts @@ -14,8 +14,6 @@ const SHELL_EXECUTABLES = ['cmd.exe', 'powershell.exe', 'bash.exe']; let windowsProcessTree; export class WindowsShellHelper { - // @ts-ignore unused property - private _childProcessIdStack: number[]; private _onCheckShell: Emitter>; private _isDisposed: boolean; private _currentRequest: TPromise; @@ -23,8 +21,6 @@ export class WindowsShellHelper { public constructor( private _rootProcessId: number, - // @ts-ignore unused property - private _rootShellExecutable: string, private _terminalInstance: ITerminalInstance, private _xterm: XTermTerminal ) { @@ -36,7 +32,6 @@ export class WindowsShellHelper { windowsProcessTree = require.__$__nodeRequire('windows-process-tree'); } - this._childProcessIdStack = [this._rootProcessId]; this._isDisposed = false; this._onCheckShell = new Emitter>(); // The debounce is necessary to prevent multiple processes from spawning when diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index d1a46066f45..42997830e2b 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -7,7 +7,6 @@ import * as assert from 'assert'; import { IConfigurationService, getConfigurationValue, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; -import { Platform } from 'vs/base/common/platform'; import { TPromise } from 'vs/base/common/winjs.base'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; @@ -48,7 +47,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontFamily, 'bar', 'terminal.integrated.fontFamily should be selected over editor.fontFamily'); @@ -62,7 +61,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; if (isFedora) { assert.equal(configHelper.getFont().fontFamily, '\'DejaVu Sans Mono\'', 'Fedora should have its font overridden when terminal.integrated.fontFamily not set'); @@ -87,7 +86,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 10, 'terminal.integrated.fontSize should be selected over editor.fontSize'); @@ -102,7 +101,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 6, 'The minimum terminal font size should be used when terminal.integrated.fontSize less than it'); @@ -117,7 +116,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, EDITOR_FONT_DEFAULTS.fontSize, 'The default editor font size should be used when terminal.integrated.fontSize is not set'); }); @@ -138,7 +137,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().lineHeight, 2, 'terminal.integrated.lineHeight should be selected over editor.lineHeight'); @@ -154,7 +153,7 @@ suite('Workbench - TerminalConfigHelper', () => { } } }); - configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); + configHelper = new TerminalConfigHelper(configurationService, null, null, null); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().lineHeight, 1, 'editor.lineHeight should be 1 when terminal.integrated.lineHeight not set'); }); diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts index 491637a485c..77d9fed7145 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -35,7 +35,7 @@ interface LinkFormatInfo { suite('Workbench - TerminalLinkHandler', () => { suite('localLinkRegex', () => { test('Windows', () => { - const terminalLinkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null, null, null, null); + const terminalLinkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null, null, null); function testLink(link: string, linkUrl: string, lineNo?: string, columnNo?: string) { assert.equal(terminalLinkHandler.extractLinkUrl(link), linkUrl); assert.equal(terminalLinkHandler.extractLinkUrl(`:${link}:`), linkUrl); @@ -105,7 +105,7 @@ suite('Workbench - TerminalLinkHandler', () => { }); test('Linux', () => { - const terminalLinkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null, null); + const terminalLinkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null); function testLink(link: string, linkUrl: string, lineNo?: string, columnNo?: string) { assert.equal(terminalLinkHandler.extractLinkUrl(link), linkUrl); assert.equal(terminalLinkHandler.extractLinkUrl(`:${link}:`), linkUrl); @@ -169,7 +169,7 @@ suite('Workbench - TerminalLinkHandler', () => { suite('preprocessPath', () => { test('Windows', () => { - const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, 'C:\\base', null, null, null, null); + const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, 'C:\\base', null, null, null); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '\\' + arg2; @@ -182,7 +182,7 @@ suite('Workbench - TerminalLinkHandler', () => { }); test('Linux', () => { - const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, '/base', null, null, null, null); + const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, '/base', null, null, null); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '/' + arg2; @@ -195,7 +195,7 @@ suite('Workbench - TerminalLinkHandler', () => { }); test('No Workspace', () => { - const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null, null); + const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null); assert.equal(linkHandler.preprocessPath('./src/file1'), null); assert.equal(linkHandler.preprocessPath('src/file2'), null); From 762cc7698e43664752f63688444c9564f6382032 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 12:55:00 -0800 Subject: [PATCH 50/88] Enable noImplicitThis compiler option --- src/tsconfig.json | 1 + src/vs/base/common/decorators.ts | 2 +- src/vs/base/common/functional.ts | 2 +- src/vs/base/test/common/types.test.ts | 2 +- src/vs/base/test/common/utils.ts | 2 +- src/vs/base/test/node/flow.test.ts | 36 +++++++++---------- .../electron-browser/telemetryService.test.ts | 26 +++++++------- .../test/browser/fileEditorInput.test.ts | 36 +++++++++---------- .../test/browser/fileEditorTracker.test.ts | 30 ++++++++-------- .../editor/test/browser/editorService.test.ts | 20 +++++------ .../services/files/node/fileService.ts | 4 +-- .../textfile/test/textFileService.test.ts | 2 +- .../electron-browser/workbenchThemeService.ts | 2 +- 13 files changed, 83 insertions(+), 82 deletions(-) diff --git a/src/tsconfig.json b/src/tsconfig.json index 177b075ce61..2d516dd2313 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -11,6 +11,7 @@ "declaration": true, "noImplicitReturns": true, "noUnusedLocals": true, + "noImplicitThis": true, "baseUrl": ".", "typeRoots": [ "typings" diff --git a/src/vs/base/common/decorators.ts b/src/vs/base/common/decorators.ts index 0690c2b4662..8f7578c29fc 100644 --- a/src/vs/base/common/decorators.ts +++ b/src/vs/base/common/decorators.ts @@ -62,7 +62,7 @@ export function debounce(delay: number): Function { return createDecorator((fn, key) => { const timerKey = `$debounce$${key}`; - return function (...args: any[]) { + return function (this: any, ...args: any[]) { clearTimeout(this[timerKey]); this[timerKey] = setTimeout(() => fn.apply(this, args), delay); }; diff --git a/src/vs/base/common/functional.ts b/src/vs/base/common/functional.ts index f4f84befbd1..a352dc9d7df 100644 --- a/src/vs/base/common/functional.ts +++ b/src/vs/base/common/functional.ts @@ -10,7 +10,7 @@ export function not(fn: Function): Function { return (...args) => !fn(...args); } -export function once(fn: T): T { +export function once(this: any, fn: T): T { const _this = this; let didCall = false; let result: any; diff --git a/src/vs/base/test/common/types.test.ts b/src/vs/base/test/common/types.test.ts index 07d8804bdaf..205c0b088c7 100644 --- a/src/vs/base/test/common/types.test.ts +++ b/src/vs/base/test/common/types.test.ts @@ -198,7 +198,7 @@ suite('Types', () => { assert(types.create(zeroConstructor) instanceof zeroConstructor); assert(types.isObject(types.create(zeroConstructor))); - let manyArgConstructor = function (foo, bar) { + let manyArgConstructor = function (this: any, foo, bar) { this.foo = foo; this.bar = bar; }; diff --git a/src/vs/base/test/common/utils.ts b/src/vs/base/test/common/utils.ts index f69d864e509..0dc656251c2 100644 --- a/src/vs/base/test/common/utils.ts +++ b/src/vs/base/test/common/utils.ts @@ -85,6 +85,6 @@ export function onError(error: Error, done: () => void): void { done(); } -export function toResource(path) { +export function toResource(this: any, path: string) { return URI.file(paths.join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path)); } diff --git a/src/vs/base/test/node/flow.test.ts b/src/vs/base/test/node/flow.test.ts index 0988096b322..3794e841926 100644 --- a/src/vs/base/test/node/flow.test.ts +++ b/src/vs/base/test/node/flow.test.ts @@ -27,7 +27,7 @@ suite('Flow', () => { callback(error, null); }, - function getFirst() { + function getFirst(this: any) { syncThrowsError(this); }, @@ -176,17 +176,17 @@ suite('Flow', () => { errorCount++; }, - function getFirst() { + function getFirst(this: any) { syncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; syncGet('2', this); }, - function handleSecond(second) { + function handleSecond(this: any, second) { assert.deepEqual('2', second); assertionCount++; syncGet(null, this); @@ -212,17 +212,17 @@ suite('Flow', () => { errorCount++; }, - function getFirst() { + function getFirst(this: any) { asyncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; asyncGet('2', this); }, - function handleSecond(second) { + function handleSecond(this: any, second) { assert.deepEqual('2', second); assertionCount++; asyncGet(null, this); @@ -252,11 +252,11 @@ suite('Flow', () => { done(); }, - function getFirst() { + function getFirst(this: any) { syncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; syncGet('2', this); @@ -289,11 +289,11 @@ suite('Flow', () => { done(); }, - function getFirst() { + function getFirst(this: any) { syncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; syncGetError('2', this); @@ -318,11 +318,11 @@ suite('Flow', () => { done(); }, - function getFirst() { + function getFirst(this: any) { asyncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; asyncGet('2', this); @@ -355,11 +355,11 @@ suite('Flow', () => { done(); }, - function getFirst() { + function getFirst(this: any) { asyncGet('1', this); }, - function handleFirst(first) { + function handleFirst(this: any, first) { assert.deepEqual('1', first); assertionCount++; asyncGetError('2', this); @@ -377,7 +377,7 @@ suite('Flow', () => { done(); }, - function getFirst() { + function getFirst(this: any) { syncSequenceGetThrowsError('1', this); } ); @@ -392,11 +392,11 @@ suite('Flow', () => { errorCount++; }, - function getFirst() { + function getFirst(this: any) { this(true); }, - function getSecond(result) { + function getSecond(this: any, result) { assert.equal(result, true); this(false); }, diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts index 69d2f789bb6..c2f49745a7b 100644 --- a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts @@ -203,7 +203,7 @@ suite('TelemetryService', () => { }); })); - test('Error events', sinon.test(function () { + test('Error events', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); @@ -262,7 +262,7 @@ suite('TelemetryService', () => { // } // })); - test('Handle global errors', sinon.test(function () { + test('Handle global errors', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; @@ -289,7 +289,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Uncaught Error Telemetry removes PII from filename', sinon.test(function () { + test('Uncaught Error Telemetry removes PII from filename', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; let settings = new ErrorTestingSettings(); @@ -318,7 +318,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Unexpected Error Telemetry removes PII', sinon.test(function () { + test('Unexpected Error Telemetry removes PII', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); try { @@ -348,7 +348,7 @@ suite('TelemetryService', () => { } })); - test('Uncaught Error Telemetry removes PII', sinon.test(function () { + test('Uncaught Error Telemetry removes PII', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; let settings = new ErrorTestingSettings(); @@ -374,7 +374,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function () { + test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); @@ -409,7 +409,7 @@ suite('TelemetryService', () => { } })); - test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function () { + test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; let settings = new ErrorTestingSettings(); @@ -437,7 +437,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () { + test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); @@ -472,7 +472,7 @@ suite('TelemetryService', () => { } })); - test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () { + test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; let settings = new ErrorTestingSettings(); @@ -500,7 +500,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () { + test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); @@ -535,7 +535,7 @@ suite('TelemetryService', () => { } })); - test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () { + test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) { let errorStub = sinon.stub(); window.onerror = errorStub; let settings = new ErrorTestingSettings(); @@ -564,7 +564,7 @@ suite('TelemetryService', () => { service.dispose(); })); - test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () { + test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); @@ -599,7 +599,7 @@ suite('TelemetryService', () => { } })); - test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () { + test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) { let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); Errors.setUnexpectedErrorHandler(() => { }); diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts index 63cf176c46d..494443216a4 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts @@ -19,8 +19,8 @@ import { Verbosity } from 'vs/platform/editor/common/editor'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModelService } from 'vs/editor/common/services/modelService'; -function toResource(path) { - return URI.file(join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path)); +function toResource(self, path) { + return URI.file(join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path)); } class ServiceAccessor { @@ -44,9 +44,9 @@ suite('Files - FileEditorInput', () => { }); test('Basics', function (done) { - let input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0); - const otherInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, 'foo/bar/otherfile.js'), void 0); - const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource.call(this, 'foo/bar/file.js'), void 0); + let input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); + const otherInput = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/otherfile.js'), void 0); + const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/file.js'), void 0); assert(input.matches(input)); assert(input.matches(otherInputSame)); @@ -58,13 +58,13 @@ suite('Files - FileEditorInput', () => { assert.strictEqual('file.js', input.getName()); - assert.strictEqual(toResource.call(this, '/foo/bar/file.js').fsPath, input.getResource().fsPath); + assert.strictEqual(toResource(this, '/foo/bar/file.js').fsPath, input.getResource().fsPath); assert(input.getResource() instanceof URI); - input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar.html'), void 0); + input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar.html'), void 0); - const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0); - const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0); + const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); + const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0); return inputToResolve.resolve(true).then(resolved => { assert.ok(inputToResolve.isResolved()); @@ -108,10 +108,10 @@ suite('Files - FileEditorInput', () => { }); test('matches', function () { - const input1 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); - const input2 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); - const input3 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/other.js'), void 0); - const input2Upper = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/UPDATEFILE.js'), void 0); + const input1 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input2 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); + const input3 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/other.js'), void 0); + const input2Upper = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/UPDATEFILE.js'), void 0); assert.strictEqual(input1.matches(null), false); assert.strictEqual(input1.matches(input1), true); @@ -122,7 +122,7 @@ suite('Files - FileEditorInput', () => { }); test('getEncoding/setEncoding', function (done) { - const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); input.setEncoding('utf16', EncodingMode.Encode); assert.equal(input.getEncoding(), 'utf16'); @@ -137,7 +137,7 @@ suite('Files - FileEditorInput', () => { }); test('save', function (done) { - const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); return input.resolve(true).then((resolved: TextFileEditorModel) => { resolved.textEditorModel.setValue('changed'); @@ -154,7 +154,7 @@ suite('Files - FileEditorInput', () => { }); test('revert', function (done) { - const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); return input.resolve(true).then((resolved: TextFileEditorModel) => { resolved.textEditorModel.setValue('changed'); @@ -171,7 +171,7 @@ suite('Files - FileEditorInput', () => { }); test('resolve handles binary files', function (done) { - const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0); + const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0); accessor.textFileService.setResolveTextContentErrorOnce(new FileOperationError('error', FileOperationResult.FILE_IS_BINARY)); @@ -185,7 +185,7 @@ suite('Files - FileEditorInput', () => { }); test('disposes model when not open anymore', function (done) { - const resource = toResource.call(this, '/path/index.txt'); + const resource = toResource(this, '/path/index.txt'); const input = createFileInput(instantiationService, resource); diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts index 93b1c4d0ae9..dab717dcf66 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts @@ -27,8 +27,8 @@ class TestFileEditorTracker extends FileEditorTracker { } } -function toResource(path) { - return URI.file(join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path)); +function toResource(self: any, path: string) { + return URI.file(join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path)); } class ServiceAccessor { @@ -58,8 +58,8 @@ suite('Files - FileEditorTracker', () => { const tracker = instantiationService.createInstance(FileEditorTracker); assert.ok(tracker); - const parent = toResource.call(this, '/foo/bar'); - const resource = toResource.call(this, '/foo/bar/updatefile.js'); + const parent = toResource(this, '/foo/bar'); + const resource = toResource(this, '/foo/bar/updatefile.js'); let input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); @@ -72,7 +72,7 @@ suite('Files - FileEditorTracker', () => { input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); - const other = toResource.call(this, '/foo/barfoo'); + const other = toResource(this, '/foo/barfoo'); accessor.fileService.fireAfterOperation(new FileOperationEvent(other, FileOperation.DELETE)); assert.ok(!input.isDisposed()); @@ -81,7 +81,7 @@ suite('Files - FileEditorTracker', () => { assert.ok(input.isDisposed()); // Move - const to = toResource.call(this, '/foo/barfoo/change.js'); + const to: any = toResource(this, '/foo/barfoo/change.js'); accessor.fileService.fireAfterOperation(new FileOperationEvent(resource, FileOperation.MOVE, to)); assert.ok(input.isDisposed()); @@ -96,8 +96,8 @@ suite('Files - FileEditorTracker', () => { tracker.setCloseOnFileDelete(false); assert.ok(tracker); - const parent = toResource.call(this, '/foo/bar'); - const resource = toResource.call(this, '/foo/bar/updatefile.js'); + const parent = toResource(this, '/foo/bar'); + const resource = toResource(this, '/foo/bar/updatefile.js'); let input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); @@ -110,7 +110,7 @@ suite('Files - FileEditorTracker', () => { input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); - const other = toResource.call(this, '/foo/barfoo'); + const other = toResource(this, '/foo/barfoo'); accessor.fileService.fireAfterOperation(new FileOperationEvent(other, FileOperation.DELETE)); assert.ok(!input.isDisposed()); @@ -119,7 +119,7 @@ suite('Files - FileEditorTracker', () => { assert.ok(input.isDisposed()); // Move - const to = toResource.call(this, '/foo/barfoo/change.js'); + const to: any = toResource(this, '/foo/barfoo/change.js'); accessor.fileService.fireAfterOperation(new FileOperationEvent(resource, FileOperation.MOVE, to)); assert.ok(input.isDisposed()); @@ -133,8 +133,8 @@ suite('Files - FileEditorTracker', () => { const tracker = instantiationService.createInstance(FileEditorTracker); assert.ok(tracker); - const parent = toResource.call(this, '/foo/bar'); - const resource = toResource.call(this, '/foo/bar/updatefile.js'); + const parent = toResource(this, '/foo/bar'); + const resource = toResource(this, '/foo/bar/updatefile.js'); let input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); @@ -149,7 +149,7 @@ suite('Files - FileEditorTracker', () => { input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); - const other = toResource.call(this, '/foo/barfoo'); + const other = toResource(this, '/foo/barfoo'); accessor.fileService.fireFileChanges(new FileChangesEvent([{ resource: other, type: FileChangeType.DELETED }])); assert.ok(!input.isDisposed()); @@ -173,7 +173,7 @@ suite('Files - FileEditorTracker', () => { tracker.setCloseOnFileDelete(false); assert.ok(tracker); - const resource = toResource.call(this, '/foo/bar/updatefile.js'); + const resource = toResource(this, '/foo/bar/updatefile.js'); let input = instantiationService.createInstance(FileEditorInput, resource, void 0); group.openEditor(input); @@ -187,7 +187,7 @@ suite('Files - FileEditorTracker', () => { test('file change event updates model', function (done) { const tracker = instantiationService.createInstance(FileEditorTracker); - const resource = toResource.call(this, '/path/index.txt'); + const resource = toResource(this, '/path/index.txt'); accessor.textFileService.models.loadOrCreate(resource).then((model: TextFileEditorModel) => { model.textEditorModel.setValue('Super Good'); diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 8e1e78ff144..6a8d70c17dc 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -32,8 +32,8 @@ function toResource(path) { return URI.from({ scheme: 'custom', path }); } -function toFileResource(path) { - return URI.file(paths.join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path)); +function toFileResource(self, path) { + return URI.file(paths.join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path)); } class TestEditorPart implements IEditorPart { @@ -94,7 +94,7 @@ suite('WorkbenchEditorService', () => { test('basics', function () { let instantiationService = workbenchInstantiationService(); - let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0); + let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0); let testEditorPart = new TestEditorPart(); testEditorPart.setActiveEditorInput(activeInput); @@ -121,12 +121,12 @@ suite('WorkbenchEditorService', () => { }); // Open Untyped Input (file) - service.openEditor({ resource: toFileResource.call(this, '/index.html'), options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => { + service.openEditor({ resource: toFileResource(this, '/index.html'), options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => { assert.strictEqual(editor, activeEditor); assert(openedEditorInput instanceof FileEditorInput); let contentInput = openedEditorInput; - assert.strictEqual(contentInput.getResource().fsPath, toFileResource.call(this, '/index.html').fsPath); + assert.strictEqual(contentInput.getResource().fsPath, toFileResource(this, '/index.html').fsPath); assert(openedEditorOptions instanceof TextEditorOptions); let textEditorOptions = openedEditorOptions; @@ -134,7 +134,7 @@ suite('WorkbenchEditorService', () => { }); // Open Untyped Input (file, encoding) - service.openEditor({ resource: toFileResource.call(this, '/index.html'), encoding: 'utf16le', options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => { + service.openEditor({ resource: toFileResource(this, '/index.html'), encoding: 'utf16le', options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => { assert.strictEqual(editor, activeEditor); assert(openedEditorInput instanceof FileEditorInput); @@ -179,18 +179,18 @@ suite('WorkbenchEditorService', () => { test('caching', function () { let instantiationService = workbenchInstantiationService(); - let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0); + let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0); let testEditorPart = new TestEditorPart(); testEditorPart.setActiveEditorInput(activeInput); let service: WorkbenchEditorService = instantiationService.createInstance(WorkbenchEditorService, testEditorPart); // Cached Input (Files) - const fileResource1 = toFileResource.call(this, '/foo/bar/cache1.js'); + const fileResource1 = toFileResource(this, '/foo/bar/cache1.js'); const fileInput1 = service.createInput({ resource: fileResource1 }); assert.ok(fileInput1); - const fileResource2 = toFileResource.call(this, '/foo/bar/cache2.js'); + const fileResource2 = toFileResource(this, '/foo/bar/cache2.js'); const fileInput2 = service.createInput({ resource: fileResource2 }); assert.ok(fileInput2); @@ -232,7 +232,7 @@ suite('WorkbenchEditorService', () => { test('delegate', function (done) { let instantiationService = workbenchInstantiationService(); - let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0); + let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0); let testEditorPart = new TestEditorPart(); testEditorPart.setActiveEditorInput(activeInput); diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index a942280b1c7..48910f60660 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -919,11 +919,11 @@ export class StatResolver { clb(null, null); // return - we might not have permissions to read the folder or stat the file }, - function stat(): void { + function stat(this: any): void { fs.stat(fileResource.fsPath, this); }, - function countChildren(fsstat: fs.Stats): void { + function countChildren(this: any, fsstat: fs.Stats): void { fileStat = fsstat; if (fileStat.isDirectory()) { diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/textFileService.test.ts index 6416edee36b..3fe68e030d9 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.test.ts @@ -371,7 +371,7 @@ suite('Files - TextFileService', () => { }); }); - function hotExitTest(setting: string, shutdownReason: ShutdownReason, multipleWindows: boolean, workspace: true, shouldVeto: boolean, done: () => void): void { + function hotExitTest(this: any, setting: string, shutdownReason: ShutdownReason, multipleWindows: boolean, workspace: true, shouldVeto: boolean, done: () => void): void { model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/file.txt'), 'utf8'); (accessor.textFileService.models).add(model.getResource(), model); diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 526ffd67dec..0adedb4a6a7 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -477,7 +477,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { } } -function _applyIconTheme(data: FileIconThemeData, onApply: (theme: FileIconThemeData) => TPromise): TPromise { +function _applyIconTheme(this: any, data: FileIconThemeData, onApply: (theme: FileIconThemeData) => TPromise): TPromise { if (!data) { _applyRules('', iconThemeRulesClassName); return TPromise.as(onApply(data)); From a48e16eccec7eb906a85c2a6b1789ff0f7bad3a9 Mon Sep 17 00:00:00 2001 From: Anton Vildyaev Date: Tue, 7 Nov 2017 21:57:15 +0100 Subject: [PATCH 51/88] Rename to openDebug --- src/vs/workbench/parts/debug/common/debug.ts | 4 ++-- .../parts/debug/electron-browser/debug.contribution.ts | 2 +- src/vs/workbench/parts/debug/electron-browser/debugService.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 4979ba978c4..6c4a538b7c2 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -50,7 +50,7 @@ export const INTERNAL_CONSOLE_OPTIONS_SCHEMA = { export const OPEN_DEBUG_OPTIONS_SCHEMA = { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], default: 'openOnFirstSessionStart', - description: nls.localize('openDebugOnStart', "Controls whether debug viewlet should be open on debugging session start.") + description: nls.localize('openDebug', "Controls whether debug viewlet should be open on debugging session start.") }; // raw @@ -324,7 +324,7 @@ export enum State { export interface IDebugConfiguration { allowBreakpointsEverywhere: boolean; - openDebugOnStart: string; + openDebug: string; openExplorerOnEnd: boolean; inlineValues: boolean; hideActionBar: boolean; diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 3f9b85b0abd..d89e1410e07 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -188,7 +188,7 @@ configurationRegistry.registerConfiguration({ default: false }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, - 'debug.openDebugOnStart': OPEN_DEBUG_OPTIONS_SCHEMA, + 'debug.openDebug': OPEN_DEBUG_OPTIONS_SCHEMA, 'launch': { type: 'object', description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"), diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 3386d49584c..0e773388d07 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -872,8 +872,8 @@ export class DebugService implements debug.IDebugService { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } - const openDebugOptions = this.configurationService.getConfiguration('debug').openDebugOnStart; - // Open debug viewlet based on the visibility of the side bar and openDebugOnStart setting + const openDebugOptions = this.configurationService.getConfiguration('debug').openDebug; + // Open debug viewlet based on the visibility of the side bar and openDebug setting if ((this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) && ((openDebugOptions === 'openOnSessionStart') || (openDebugOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState))) { From e71d6c99b74a1e3e03c8cea6dcb95cd4f30bf37b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 13:58:07 -0800 Subject: [PATCH 52/88] Fix a number of no implicit any errors --- src/vs/base/common/async.ts | 4 +- src/vs/base/common/collections.ts | 8 +- src/vs/base/common/objects.ts | 6 +- src/vs/base/common/parsers.ts | 2 +- src/vs/base/node/event.ts | 2 +- src/vs/base/test/browser/builder.test.ts | 94 +++++++++---------- src/vs/base/test/common/async.test.ts | 8 +- src/vs/workbench/electron-browser/window.ts | 26 ++--- .../debug/electron-browser/debugViewer.ts | 2 +- .../electron-browser/terminalService.test.ts | 42 ++++----- .../search/test/common/searchModel.test.ts | 4 +- .../terminalColorRegistry.test.ts | 4 +- .../terminalConfigHelper.test.ts | 4 +- .../electron-browser/terminalInstance.test.ts | 6 +- .../terminalLinkHandler.test.ts | 4 +- .../configuration/common/configuration.ts | 2 +- .../node/configurationEditingService.test.ts | 8 +- .../editor/test/browser/editorService.test.ts | 14 +-- .../test/node/keybindingEditing.test.ts | 2 +- .../browser/parts/editor/baseEditor.test.ts | 2 +- .../parts/editor/editorStacksModel.test.ts | 13 +-- 21 files changed, 129 insertions(+), 128 deletions(-) diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index 37c69b0f5bd..86bde35d804 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -672,11 +672,11 @@ export class RunOnceScheduler { export function nfcall(fn: Function, ...args: any[]): Promise; export function nfcall(fn: Function, ...args: any[]): TPromise; export function nfcall(fn: Function, ...args: any[]): any { - return new TPromise((c, e) => fn(...args, (err, result) => err ? e(err) : c(result)), () => null); + return new TPromise((c, e) => fn(...args, (err: any, result: any) => err ? e(err) : c(result)), () => null); } export function ninvoke(thisArg: any, fn: Function, ...args: any[]): Promise; export function ninvoke(thisArg: any, fn: Function, ...args: any[]): TPromise; export function ninvoke(thisArg: any, fn: Function, ...args: any[]): any { - return new TPromise((c, e) => fn.call(thisArg, ...args, (err, result) => err ? e(err) : c(result)), () => null); + return new TPromise((c, e) => fn.call(thisArg, ...args, (err: any, result: any) => err ? e(err) : c(result)), () => null); } diff --git a/src/vs/base/common/collections.ts b/src/vs/base/common/collections.ts index 20e27735d7d..70b2e7310f8 100644 --- a/src/vs/base/common/collections.ts +++ b/src/vs/base/common/collections.ts @@ -31,7 +31,7 @@ export function values(from: IStringDictionary | INumberDictionary): T[ const result: T[] = []; for (let key in from) { if (hasOwnProperty.call(from, key)) { - result.push(from[key]); + result.push((from as any)[key]); } } return result; @@ -54,8 +54,8 @@ export function size(from: IStringDictionary | INumberDictionary): numb export function forEach(from: IStringDictionary | INumberDictionary, callback: (entry: { key: any; value: T; }, remove: Function) => any): void { for (let key in from) { if (hasOwnProperty.call(from, key)) { - const result = callback({ key: key, value: from[key] }, function () { - delete from[key]; + const result = callback({ key: key, value: (from as any)[key] }, function () { + delete (from as any)[key]; }); if (result === false) { return; @@ -72,7 +72,7 @@ export function remove(from: IStringDictionary | INumberDictionary, key if (!hasOwnProperty.call(from, key)) { return false; } - delete from[key]; + delete (from as any)[key]; return true; } diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index e2be7bda662..4ffedf05809 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -16,7 +16,7 @@ export function clone(obj: T): T { return obj as any; } const result = (Array.isArray(obj)) ? [] : {}; - Object.keys(obj).forEach(key => { + Object.keys(obj).forEach((key: keyof T) => { if (obj[key] && typeof obj[key] === 'object') { result[key] = clone(obj[key]); } else { @@ -31,7 +31,7 @@ export function deepClone(obj: T): T { return obj; } const result = (Array.isArray(obj)) ? [] : {}; - Object.getOwnPropertyNames(obj).forEach(key => { + Object.getOwnPropertyNames(obj).forEach((key: keyof T) => { if (obj[key] && typeof obj[key] === 'object') { result[key] = deepClone(obj[key]); } else { @@ -73,7 +73,7 @@ function _cloneAndChange(obj: any, changer: (orig: any) => any, encounteredObjec const r2 = {}; for (let i2 in obj) { if (hasOwnProperty.call(obj, i2)) { - r2[i2] = _cloneAndChange(obj[i2], changer, encounteredObjects); + (r2 as any)[i2] = _cloneAndChange(obj[i2], changer, encounteredObjects); } } encounteredObjects.pop(); diff --git a/src/vs/base/common/parsers.ts b/src/vs/base/common/parsers.ts index 495459f4dd7..48938d10a4e 100644 --- a/src/vs/base/common/parsers.ts +++ b/src/vs/base/common/parsers.ts @@ -112,7 +112,7 @@ export abstract class Parser { } protected static merge(destination: T, source: T, overwrite: boolean): void { - Object.keys(source).forEach((key) => { + Object.keys(source).forEach((key: keyof T) => { let destValue = destination[key]; let sourceValue = source[key]; if (Types.isUndefined(sourceValue)) { diff --git a/src/vs/base/node/event.ts b/src/vs/base/node/event.ts index b522285db02..037701d2431 100644 --- a/src/vs/base/node/event.ts +++ b/src/vs/base/node/event.ts @@ -9,7 +9,7 @@ import Event, { Emitter } from 'vs/base/common/event'; import { EventEmitter } from 'events'; export function fromEventEmitter(emitter: EventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event { - const fn = (...args) => result.fire(map(...args)); + const fn = (...args: any[]) => result.fire(map(...args)); const onFirstListenerAdd = () => emitter.on(eventName, fn); const onLastListenerRemove = () => emitter.removeListener(eventName, fn); const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); diff --git a/src/vs/base/test/browser/builder.test.ts b/src/vs/base/test/browser/builder.test.ts index 99c3f4ec4ee..b6e496b7277 100644 --- a/src/vs/base/test/browser/builder.test.ts +++ b/src/vs/base/test/browser/builder.test.ts @@ -22,7 +22,7 @@ let withElementsBySelector = function (selector: string, offdom: boolean = false return new MultiBuilder(builders); }; -let withBuilder = function (builder, offdom) { +let withBuilder = function (builder: Builder, offdom: boolean) { if (builder instanceof MultiBuilder) { return new MultiBuilder(builder); } @@ -107,7 +107,7 @@ suite('Builder', () => { assert(allDivs instanceof MultiBuilder); for (let key in b) { - if (b.hasOwnProperty(key) && Types.isFunction(b[key])) { + if (b.hasOwnProperty(key) && Types.isFunction((b as any)[key])) { assert(allDivs.hasOwnProperty(key)); } } @@ -121,7 +121,7 @@ suite('Builder', () => { assert(noElement instanceof MultiBuilder); for (let key in b) { - if (b.hasOwnProperty(key) && Types.isFunction(b[key])) { + if (b.hasOwnProperty(key) && Types.isFunction((b as any)[key])) { assert(noElement.hasOwnProperty(key)); } } @@ -381,15 +381,15 @@ suite('Builder', () => { test('Builder Multibuilder fn call that returns Multibuilder', function () { let b = Build.withElementById(fixtureId); - b.div(function (div) { + b.div(function (div: Builder) { div.span(); }); - b.div(function (div) { + b.div(function (div: Builder) { div.span(); }); - b.div(function (div) { + b.div(function (div: Builder) { div.span(); }); @@ -402,13 +402,13 @@ suite('Builder', () => { test('Builder.p() and other elements', function () { let b = Build.withElementById(fixtureId); b.empty(); - b.div(function (div) { + b.div(function (div: Builder) { assert(div !== b); assert.strictEqual('div', div.getHTMLElement().nodeName.toLowerCase()); - div.p(function (p) { - p.ul(function (ul) { - ul.li(function (li) { + div.p(function (p: Builder) { + p.ul(function (ul: Builder) { + ul.li(function (li: Builder) { li.span({ id: 'builderspan', innerHtml: 'Foo Bar' @@ -485,10 +485,10 @@ suite('Builder', () => { test('Builder.p() and other elements', function () { let b = Build.withElementById(fixtureId); - b.element('div', function (div) { - div.element('p', function (p) { - p.element('ul', function (ul) { - ul.element('li', function (li) { + b.element('div', function (div: Builder) { + div.element('p', function (p: Builder) { + p.element('ul', function (ul: Builder) { + ul.element('li', function (li: Builder) { li.element('span', { id: 'builderspan', innerHtml: 'Foo Bar' @@ -908,7 +908,7 @@ suite('Builder', () => { assert(b.children().length === 0); let divB; - b.div(function (div) { + b.div(function (div: Builder) { divB = div.clone(); div.span(); }); @@ -1018,7 +1018,7 @@ suite('Builder', () => { type: 'button' }); - let listeners = []; + let listeners: Builder[] = []; let counter = 0; b.on(DomUtils.EventType.CLICK, function (e) { counter++; @@ -1042,7 +1042,7 @@ suite('Builder', () => { type: 'button' }); - let listeners = []; + let listeners: Builder[] = []; let counter = 0; b.on(DomUtils.EventType.CLICK, function (e) { counter++; @@ -1064,8 +1064,8 @@ suite('Builder', () => { }); test('Builder.empty()', function () { - let inputs = []; - let bindings = []; + let inputs: Builder[] = []; + let bindings: Builder[] = []; let b = Build.withElementById(fixtureId); let counter1 = 0; @@ -1076,33 +1076,33 @@ suite('Builder', () => { let counter6 = 0; let counter7 = 0; - b.div(function (div) { + b.div(function (div: Builder) { div.bind('Foo Bar'); div.setProperty('Foo', 'Bar'); bindings.push(div.clone()); div.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { counter1++; assert(counter1 <= 1); }); inputs.push(div.clone()); - div.p(function (p) { + div.p(function (p: Builder) { p.bind('Foo Bar'); p.setProperty('Foo', 'Bar'); bindings.push(p.clone()); p.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { counter2++; assert(counter2 <= 1); }); inputs.push(p.clone()); - p.ul(function (ul) { + p.ul(function (ul: Builder) { ul.bind('Foo Bar'); ul.setProperty('Foo', 'Bar'); bindings.push(ul.clone()); @@ -1115,7 +1115,7 @@ suite('Builder', () => { }); inputs.push(ul.clone()); - ul.li(function (li) { + ul.li(function (li: Builder) { li.bind('Foo Bar'); li.setProperty('Foo', 'Bar'); bindings.push(li.clone()); @@ -1220,7 +1220,7 @@ suite('Builder', () => { let old = DomUtils.addDisposableListener; try { - (DomUtils as any).addDisposableListener = function (node, type, handler) { + (DomUtils as any).addDisposableListener = function (node: any, type: any, handler: any) { let unbind: IDisposable = old.call(null, node, type, handler); return { @@ -1231,13 +1231,13 @@ suite('Builder', () => { }; }; - b.div(function (div) { - div.p(function (p) { + b.div(function (div: Builder) { + div.p(function (p: Builder) { p.span().on([DomUtils.EventType.CLICK, DomUtils.EventType.KEY_DOWN], function (e) { }); p.img().on([DomUtils.EventType.KEY_PRESS, DomUtils.EventType.MOUSE_OUT], function (e) { }, null, true); // useCapture - p.a(function (a) { + p.a(function (a: Builder) { a.span().on([DomUtils.EventType.CLICK, DomUtils.EventType.KEY_DOWN], function (e) { }); }).on([DomUtils.EventType.SELECT, DomUtils.EventType.BLUR], function (e) { }); }); @@ -1251,8 +1251,8 @@ suite('Builder', () => { }); test('Builder.destroy()', function () { - let inputs = []; - let bindings = []; + let inputs: Builder[] = []; + let bindings: Builder[] = []; let b = Build.withElementById(fixtureId); let counter1 = 0; @@ -1263,7 +1263,7 @@ suite('Builder', () => { let counter6 = 0; let counter7 = 0; - b.div(function (div) { + b.div(function (div: Builder) { div.bind('Foo Bar'); div.setProperty('Foo', 'Bar'); bindings.push(div.clone()); @@ -1276,7 +1276,7 @@ suite('Builder', () => { }, null, true); // useCapture inputs.push(div.clone()); - div.p(function (p) { + div.p(function (p: Builder) { p.bind('Foo Bar'); p.setProperty('Foo', 'Bar'); bindings.push(p.clone()); @@ -1289,7 +1289,7 @@ suite('Builder', () => { }); inputs.push(p.clone()); - p.ul(function (ul) { + p.ul(function (ul: Builder) { ul.bind('Foo Bar'); ul.setProperty('Foo', 'Bar'); bindings.push(ul.clone()); @@ -1302,14 +1302,14 @@ suite('Builder', () => { }); inputs.push(ul.clone()); - ul.li(function (li) { + ul.li(function (li: Builder) { li.bind('Foo Bar'); li.setProperty('Foo', 'Bar'); bindings.push(li.clone()); li.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { counter4++; assert(counter4 <= 1); }); @@ -1407,7 +1407,7 @@ suite('Builder', () => { let old = DomUtils.addDisposableListener; try { - (DomUtils as any).addDisposableListener = function (node, type, handler) { + (DomUtils as any).addDisposableListener = function (node: any, type: any, handler: any) { let unbind: IDisposable = old.call(null, node, type, handler); return { @@ -1418,13 +1418,13 @@ suite('Builder', () => { }; }; - b.div(function (div) { - div.p(function (p) { + b.div(function (div: Builder) { + div.p(function (p: Builder) { p.span().on([DomUtils.EventType.CLICK, DomUtils.EventType.KEY_DOWN], function (e) { }); p.img().on([DomUtils.EventType.KEY_PRESS, DomUtils.EventType.MOUSE_OUT], function (e) { }); - p.a(function (a) { + p.a(function (a: Builder) { a.span().on([DomUtils.EventType.CLICK, DomUtils.EventType.KEY_DOWN], function (e) { }); }).on([DomUtils.EventType.SELECT, DomUtils.EventType.BLUR], function (e) { }); }); @@ -1441,13 +1441,13 @@ suite('Builder', () => { test('Builder.empty() MultiBuilder', function () { let b = Build.withElementById(fixtureId); - let inputs = []; + let inputs: Builder[] = []; let firstCounter = 0; - b.div(function (div) { + b.div(function (div: Builder) { div.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { firstCounter++; }); @@ -1455,10 +1455,10 @@ suite('Builder', () => { }); let secondCounter = 0; - b.div(function (div) { + b.div(function (div: Builder) { div.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { secondCounter++; }); @@ -1466,10 +1466,10 @@ suite('Builder', () => { }); let thirdCounter = 0; - b.div(function (div) { + b.div(function (div: Builder) { div.element('input', { type: 'button' - }).on(DomUtils.EventType.CLICK, function (e) { + }).on(DomUtils.EventType.CLICK, function () { thirdCounter++; }); diff --git a/src/vs/base/test/common/async.test.ts b/src/vs/base/test/common/async.test.ts index 08b5eef4fd2..3eeede50e2d 100644 --- a/src/vs/base/test/common/async.test.ts +++ b/src/vs/base/test/common/async.test.ts @@ -472,7 +472,7 @@ suite('Async', () => { test('Queue - order is kept', function (done) { let queue = new Async.Queue(); - let res = []; + let res: number[] = []; let f1 = () => TPromise.as(true).then(() => res.push(1)); let f2 = () => TPromise.timeout(10).then(() => res.push(2)); @@ -498,7 +498,7 @@ suite('Async', () => { test('Queue - errors bubble individually but not cause stop', function (done) { let queue = new Async.Queue(); - let res = []; + let res: number[] = []; let error = false; let f1 = () => TPromise.as(true).then(() => res.push(1)); @@ -525,7 +525,7 @@ suite('Async', () => { test('Queue - order is kept (chained)', function (done) { let queue = new Async.Queue(); - let res = []; + let res: number[] = []; let f1 = () => TPromise.as(true).then(() => res.push(1)); let f2 = () => TPromise.timeout(10).then(() => res.push(2)); @@ -560,7 +560,7 @@ suite('Async', () => { done(); }); - let res = []; + let res: number[] = []; let f1 = () => TPromise.timeout(10).then(() => res.push(2)); let f2 = () => TPromise.timeout(20).then(() => res.push(4)); diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index 6e7206117f5..d345792b727 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -121,7 +121,7 @@ export class ElectronWindow extends Themable { }); // Support runAction event - ipc.on('vscode:runAction', (event, request: IRunActionInWindowRequest) => { + ipc.on('vscode:runAction', (_event: any, request: IRunActionInWindowRequest) => { const args: any[] = []; // If we run an action from the touchbar, we fill in the currently active resource @@ -152,7 +152,7 @@ export class ElectronWindow extends Themable { }); // Support resolve keybindings event - ipc.on('vscode:resolveKeybindings', (event, rawActionIds: string) => { + ipc.on('vscode:resolveKeybindings', (_event: any, rawActionIds: string) => { let actionIds: string[] = []; try { actionIds = JSON.parse(rawActionIds); @@ -168,7 +168,7 @@ export class ElectronWindow extends Themable { }, () => errors.onUnexpectedError); }); - ipc.on('vscode:reportError', (event, error) => { + ipc.on('vscode:reportError', (_event: any, error: string) => { if (error) { const errorParsed = JSON.parse(error); errorParsed.mainProcess = true; @@ -177,36 +177,36 @@ export class ElectronWindow extends Themable { }); // Support openFiles event for existing and new files - ipc.on('vscode:openFiles', (event, request: IOpenFileRequest) => this.onOpenFiles(request)); + ipc.on('vscode:openFiles', (_event: any, request: IOpenFileRequest) => this.onOpenFiles(request)); // Support addFolders event if we have a workspace opened - ipc.on('vscode:addFolders', (event, request: IAddFoldersRequest) => this.onAddFolders(request)); + ipc.on('vscode:addFolders', (_event: any, request: IAddFoldersRequest) => this.onAddFolders(request)); // Message support - ipc.on('vscode:showInfoMessage', (event, message: string) => { + ipc.on('vscode:showInfoMessage', (_event: any, message: string) => { this.messageService.show(Severity.Info, message); }); // Support toggling auto save - ipc.on('vscode.toggleAutoSave', event => { + ipc.on('vscode.toggleAutoSave', () => { this.toggleAutoSave(); }); // Fullscreen Events - ipc.on('vscode:enterFullScreen', event => { + ipc.on('vscode:enterFullScreen', () => { this.partService.joinCreation().then(() => { browser.setFullscreen(true); }); }); - ipc.on('vscode:leaveFullScreen', event => { + ipc.on('vscode:leaveFullScreen', () => { this.partService.joinCreation().then(() => { browser.setFullscreen(false); }); }); // High Contrast Events - ipc.on('vscode:enterHighContrast', event => { + ipc.on('vscode:enterHighContrast', () => { const windowConfig = this.configurationService.getConfiguration('window'); if (windowConfig && windowConfig.autoDetectHighContrast) { this.partService.joinCreation().then(() => { @@ -215,7 +215,7 @@ export class ElectronWindow extends Themable { } }); - ipc.on('vscode:leaveHighContrast', event => { + ipc.on('vscode:leaveHighContrast', () => { const windowConfig = this.configurationService.getConfiguration('window'); if (windowConfig && windowConfig.autoDetectHighContrast) { this.partService.joinCreation().then(() => { @@ -225,12 +225,12 @@ export class ElectronWindow extends Themable { }); // keyboard layout changed event - ipc.on('vscode:keyboardLayoutChanged', event => { + ipc.on('vscode:keyboardLayoutChanged', () => { KeyboardMapperFactory.INSTANCE._onKeyboardLayoutChanged(); }); // keyboard layout changed event - ipc.on('vscode:accessibilitySupportChanged', (event, accessibilitySupportEnabled: boolean) => { + ipc.on('vscode:accessibilitySupportChanged', (_event: any, accessibilitySupportEnabled: boolean) => { browser.setAccessibilitySupport(accessibilitySupportEnabled ? platform.AccessibilitySupport.Enabled : platform.AccessibilitySupport.Disabled); }); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index 43abfd9ca01..57811167418 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -53,7 +53,7 @@ export interface IRenderValueOptions { } function replaceWhitespace(value: string): string { - const map = { '\n': '\\n', '\r': '\\r', '\t': '\\t' }; + const map: { [x: string]: string } = { '\n': '\\n', '\r': '\\r', '\t': '\\t' }; return value.replace(/[\n\r\t]/g, char => map[char]); } diff --git a/src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts b/src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts index e26b830c9dd..9eb9e7b123e 100644 --- a/src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts +++ b/src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts @@ -10,9 +10,9 @@ import { WinTerminalService, LinuxTerminalService, MacTerminalService } from 'vs import { DEFAULT_TERMINAL_WINDOWS, DEFAULT_TERMINAL_LINUX_READY, DEFAULT_TERMINAL_OSX } from 'vs/workbench/parts/execution/electron-browser/terminal'; suite('Execution - TerminalService', () => { - let mockOnExit; - let mockOnError; - let mockConfig; + let mockOnExit: Function; + let mockOnError: Function; + let mockConfig: any; setup(() => { mockConfig = { @@ -25,22 +25,22 @@ suite('Execution - TerminalService', () => { } } }; - mockOnExit = s => s; - mockOnError = e => e; + mockOnExit = (s: any) => s; + mockOnError = (e: any) => e; }); test(`WinTerminalService - uses terminal from configuration`, done => { let testShell = 'cmd'; let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(command, testShell, 'shell should equal expected'); equal(args[args.length - 1], mockConfig.terminal.external.windowsExec, 'terminal should equal expected'); equal(opts.cwd, testCwd, 'opts.cwd should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -59,12 +59,12 @@ suite('Execution - TerminalService', () => { let testShell = 'cmd'; let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(args[args.length - 1], DEFAULT_TERMINAL_WINDOWS, 'terminal should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -84,12 +84,12 @@ suite('Execution - TerminalService', () => { let testShell = 'cmd'; let testCwd = 'c:/foo'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(opts.cwd, 'C:/foo', 'cwd should be uppercase regardless of the case that\'s passed in'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -109,12 +109,12 @@ suite('Execution - TerminalService', () => { mockConfig.terminal.external.windowsExec = 'cmder'; let testCwd = 'c:/foo'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert deepEqual(args, ['C:/foo']); equal(opts, undefined); done(); - return { on: (evt) => evt }; + return { on: (evt: any) => evt }; } }; let testService = new WinTerminalService(mockConfig); @@ -131,12 +131,12 @@ suite('Execution - TerminalService', () => { test(`MacTerminalService - uses terminal from configuration`, done => { let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(args[1], mockConfig.terminal.external.osxExec, 'terminal should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -153,12 +153,12 @@ suite('Execution - TerminalService', () => { test(`MacTerminalService - uses default terminal when configuration.terminal.external.osxExec is undefined`, done => { let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(args[1], DEFAULT_TERMINAL_OSX, 'terminal should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -176,13 +176,13 @@ suite('Execution - TerminalService', () => { test(`LinuxTerminalService - uses terminal from configuration`, done => { let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(command, mockConfig.terminal.external.linuxExec, 'terminal should equal expected'); equal(opts.cwd, testCwd, 'opts.cwd should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; @@ -200,12 +200,12 @@ suite('Execution - TerminalService', () => { DEFAULT_TERMINAL_LINUX_READY.then(defaultTerminalLinux => { let testCwd = 'path/to/workspace'; let mockSpawner = { - spawn: (command, args, opts) => { + spawn: (command: any, args: any, opts: any) => { // assert equal(command, defaultTerminalLinux, 'terminal should equal expected'); done(); return { - on: (evt) => evt + on: (evt: any) => evt }; } }; diff --git a/src/vs/workbench/parts/search/test/common/searchModel.test.ts b/src/vs/workbench/parts/search/test/common/searchModel.test.ts index c969aa57335..315d2b182fe 100644 --- a/src/vs/workbench/parts/search/test/common/searchModel.test.ts +++ b/src/vs/workbench/parts/search/test/common/searchModel.test.ts @@ -44,7 +44,7 @@ const nullEvent = new class { suite('SearchModel', () => { let instantiationService: TestInstantiationService; - let restoreStubs; + let restoreStubs: sinon.SinonStub[]; const testSearchStats: IUncachedSearchStats = { fromCache: false, @@ -306,7 +306,7 @@ suite('SearchModel', () => { return { preview, lineNumber, offsetAndLengths }; } - function stub(arg1, arg2, arg3): sinon.SinonStub { + function stub(arg1: any, arg2: any, arg3: any): sinon.SinonStub { const stub = sinon.stub(arg1, arg2, arg3); restoreStubs.push(stub); return stub; diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts index 8a0820c4ac7..fa5448c879a 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { Extensions as ThemeingExtensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry'; +import { Extensions as ThemeingExtensions, IColorRegistry, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; import { ansiColorIdentifiers, registerColors } from 'vs/workbench/parts/terminal/electron-browser/terminalColorRegistry'; import { ITheme, ThemeType } from 'vs/platform/theme/common/themeService'; @@ -20,7 +20,7 @@ function getMockTheme(type: ThemeType): ITheme { selector: '', label: '', type: type, - getColor: (colorId) => themingRegistry.resolveDefaultColor(colorId, theme), + getColor: (colorId: ColorIdentifier): Color => themingRegistry.resolveDefaultColor(colorId, theme), defines: () => true }; return theme; diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index 42997830e2b..3dfbf80c376 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -17,13 +17,13 @@ class MockConfigurationService implements IConfigurationService { public serviceId = IConfigurationService; public constructor(private configuration: any = {}) { } public inspect(key: string, overrides?: IConfigurationOverrides): any { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key), workspace: void 0, workspaceFolder: void 0 }; } - public keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; } + public keys() { return { default: [] as string[], user: [] as string[], workspace: [] as string[], workspaceFolder: [] as string[] }; } public getConfiguration(): any { return this.configuration; } public getValue(key: string, overrides?: IConfigurationOverrides): T { return getConfigurationValue(this.getConfiguration(), key); } public updateValue(): TPromise { return null; } public getConfigurationData(): any { return null; } public onDidChangeConfiguration() { return { dispose() { } }; } - public reloadConfiguration() { return null; } + public reloadConfiguration(): TPromise { return null; } } suite('Workbench - TerminalConfigHelper', () => { diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts index 2083ae505e9..5ba6d31a84f 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts @@ -59,7 +59,7 @@ suite('Workbench - TerminalInstance', () => { assert.equal(env1['PTYCWD'], '/foo', 'PTYCWD is equal to requested cwd'); assert.equal(env1['LANG'], 'en_AU.UTF-8', 'LANG is equal to the requested locale with UTF-8'); - const shell2 = { + const shell2: IShellLaunchConfig = { executable: '/bin/foosh', args: [] }; @@ -114,7 +114,7 @@ suite('Workbench - TerminalInstance', () => { a: 'b', c: 'd' }; - const other = { + const other: IStringDictionary = { a: null }; TerminalInstance.mergeEnvironments(parent, other); @@ -131,7 +131,7 @@ suite('Workbench - TerminalInstance', () => { a: 'b', c: 'd' }; - const other = { + const other: IStringDictionary = { A: null }; TerminalInstance.mergeEnvironments(parent, other); diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts index 77d9fed7145..a16322808aa 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -171,7 +171,7 @@ suite('Workbench - TerminalLinkHandler', () => { test('Windows', () => { const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, 'C:\\base', null, null, null); - let stub = sinon.stub(path, 'join', function (arg1, arg2) { + let stub = sinon.stub(path, 'join', function (arg1: string, arg2: string) { return arg1 + '\\' + arg2; }); assert.equal(linkHandler.preprocessPath('./src/file1'), 'C:\\base\\./src/file1'); @@ -184,7 +184,7 @@ suite('Workbench - TerminalLinkHandler', () => { test('Linux', () => { const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, '/base', null, null, null); - let stub = sinon.stub(path, 'join', function (arg1, arg2) { + let stub = sinon.stub(path, 'join', function (arg1: string, arg2: string) { return arg1 + '/' + arg2; }); diff --git a/src/vs/workbench/services/configuration/common/configuration.ts b/src/vs/workbench/services/configuration/common/configuration.ts index 3d4eb1394b2..d6f6475490b 100644 --- a/src/vs/workbench/services/configuration/common/configuration.ts +++ b/src/vs/workbench/services/configuration/common/configuration.ts @@ -27,6 +27,6 @@ export const folderSettingsSchemaId = 'vscode://schemas/settings/folder'; export const TASKS_CONFIGURATION_KEY = 'tasks'; export const LAUNCH_CONFIGURATION_KEY = 'launch'; -export const WORKSPACE_STANDALONE_CONFIGURATIONS = {}; +export const WORKSPACE_STANDALONE_CONFIGURATIONS = Object.create(null); WORKSPACE_STANDALONE_CONFIGURATIONS[TASKS_CONFIGURATION_KEY] = `${WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME}/tasks.json`; WORKSPACE_STANDALONE_CONFIGURATIONS[LAUNCH_CONFIGURATION_KEY] = `${WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME}/launch.json`; \ No newline at end of file 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 8bfb2c6fbe5..9966a0a9fa5 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -38,7 +38,7 @@ import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; class SettingsTestEnvironmentService extends EnvironmentService { - constructor(args: ParsedArgs, _execPath: string, private customAppSettingsHome) { + constructor(args: ParsedArgs, _execPath: string, private customAppSettingsHome: string) { super(args, _execPath); } @@ -49,9 +49,9 @@ suite('ConfigurationEditingService', () => { let instantiationService: TestInstantiationService; let testObject: ConfigurationEditingService; - let parentDir; - let workspaceDir; - let globalSettingsFile; + let parentDir: string; + let workspaceDir: string; + let globalSettingsFile: string; let workspaceSettingsDir; suiteSetup(() => { diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 6a8d70c17dc..a3fb588c56d 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import { Promise, TPromise } from 'vs/base/common/winjs.base'; import paths = require('vs/base/common/paths'); -import { Position, Direction, IEditor } from 'vs/platform/editor/common/editor'; +import { Position, Direction, IEditor, IEditorInput } from 'vs/platform/editor/common/editor'; import URI from 'vs/base/common/uri'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, TextEditorOptions } from 'vs/workbench/common/editor'; @@ -25,19 +25,19 @@ let activeEditor: BaseEditor = { } }; -let openedEditorInput; -let openedEditorOptions; +let openedEditorInput: EditorInput; +let openedEditorOptions: EditorOptions; -function toResource(path) { +function toResource(path: string) { return URI.from({ scheme: 'custom', path }); } -function toFileResource(self, path) { +function toFileResource(self: any, path: string) { return URI.file(paths.join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path)); } class TestEditorPart implements IEditorPart { - private activeInput; + private activeInput: EditorInput; public getId(): string { return null; @@ -260,7 +260,7 @@ suite('WorkbenchEditorService', () => { let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.parse('my://resource')); let delegate = instantiationService.createInstance(DelegatingWorkbenchEditorService); - delegate.setEditorOpenHandler((input, options?) => { + delegate.setEditorOpenHandler((input: IEditorInput, options?: EditorOptions) => { assert.strictEqual(input, inp); return TPromise.as(ed); diff --git a/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts index a3f9d2f1c0f..242aebeffca 100644 --- a/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts @@ -56,7 +56,7 @@ suite('Keybindings Editing', () => { let instantiationService: TestInstantiationService; let testObject: KeybindingsEditingService; let testDir: string; - let keybindingsFile; + let keybindingsFile: string; setup(() => { return setUpWorkspace().then(() => { diff --git a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts index 1e7826a9ae6..25246bcaa3c 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -75,7 +75,7 @@ class MyInputFactory implements IEditorInputFactory { } class MyInput extends EditorInput { - getPreferredEditorId(ids) { + getPreferredEditorId(ids: string[]) { return ids[1]; } diff --git a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts index fafbd9d733d..6308cacd798 100644 --- a/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorStacksModel.test.ts @@ -17,11 +17,12 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { Registry } from 'vs/platform/registry/common/platform'; -import { Position, Direction } from 'vs/platform/editor/common/editor'; +import { Position, Direction, IEditorModel } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; +import { TPromise } from 'vs/base/common/winjs.base'; function create(): EditorStacksModel { let inst = new TestInstantiationService(); @@ -60,7 +61,7 @@ interface GroupEvents { } function modelListener(model: EditorStacksModel): ModelEvents { - const modelEvents = { + const modelEvents: ModelEvents = { opened: [], activated: [], closed: [], @@ -86,7 +87,7 @@ function modelListener(model: EditorStacksModel): ModelEvents { } function groupListener(group: EditorGroup): GroupEvents { - const groupEvents = { + const groupEvents: GroupEvents = { opened: [], closed: [], activated: [], @@ -111,7 +112,7 @@ class TestEditorInput extends EditorInput { super(); } public getTypeId() { return 'testEditorInput'; } - public resolve() { return null; } + public resolve(): TPromise { return null; } public matches(other: TestEditorInput): boolean { return other && this.id === other.id && other instanceof TestEditorInput; @@ -131,7 +132,7 @@ class NonSerializableTestEditorInput extends EditorInput { super(); } public getTypeId() { return 'testEditorInput-nonSerializable'; } - public resolve() { return null; } + public resolve(): TPromise { return null; } public matches(other: TestEditorInput): boolean { return other && this.id === other.id && other instanceof NonSerializableTestEditorInput; @@ -144,7 +145,7 @@ class TestFileEditorInput extends EditorInput implements IFileEditorInput { super(); } public getTypeId() { return 'testFileEditorInput'; } - public resolve() { return null; } + public resolve(): TPromise { return null; } public matches(other: TestEditorInput): boolean { return other && this.id === other.id && other instanceof TestFileEditorInput; From 67f9ef0b017cca62c7eef0d35237307058eb8684 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 7 Nov 2017 14:00:53 -0800 Subject: [PATCH 53/88] Uplevel xterm.js Pulls in the selection event. Part of #36271 --- npm-shrinkwrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a07afb10466..c7ff262ecec 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -591,7 +591,7 @@ "xterm": { "version": "2.9.1", "from": "Tyriar/xterm.js#vscode-release/1.19", - "resolved": "git+https://github.com/Tyriar/xterm.js.git#004d47b7255f0d5eea4093e6a336a2da3157bc8d" + "resolved": "git+https://github.com/Tyriar/xterm.js.git#d242c552cb5c88125ac257ccaebed7fe336d9266" }, "yauzl": { "version": "2.8.0", From bfec1318960ded07656b95bf277b9d772b4ff19e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:10:30 -0800 Subject: [PATCH 54/88] Fix no implicit any errors in a few more test files --- .../appInsightsAppender.test.ts | 8 ++-- .../electron-browser/commonProperties.test.ts | 8 ++-- .../electron-browser/telemetryService.test.ts | 24 +++++------ .../api/extHostMessagerService.test.ts | 43 ++++++++++--------- 4 files changed, 42 insertions(+), 41 deletions(-) diff --git a/src/vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts b/src/vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts index 2522b642f74..67f985b052e 100644 --- a/src/vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts @@ -9,8 +9,8 @@ import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppen interface IAppInsightsEvent { eventName: string; - properties?: { string?: string; }; - measurements?: { string?: number; }; + properties?: { [x: string]: string; }; + measurements?: { [x: string]: number; }; } class AppInsightsMock { @@ -34,7 +34,7 @@ class AppInsightsMock { this.exceptions.push(exception); } - public sendPendingData(callback): void { + public sendPendingData(_callback: any): void { // called on dispose } } @@ -85,7 +85,7 @@ suite('AIAdapter', () => { } assert(reallyLongPropertyValue.length > 1024); - var data = {}; + var data = Object.create(null); data[reallyLongPropertyName] = '1234'; data['reallyLongPropertyValue'] = reallyLongPropertyValue; adapter.log('testEvent', data); diff --git a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts index 2e558045818..ff36faa14f5 100644 --- a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts @@ -12,10 +12,10 @@ import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; suite('Telemetry - common properties', function () { - const commit = void 0; - const version = void 0; - const source = void 0; - let storageService; + const commit: string = void 0; + const version: string = void 0; + const source: string = void 0; + let storageService: StorageService; setup(() => { storageService = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace.id); diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts index c2f49745a7b..341ba75b477 100644 --- a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts @@ -40,16 +40,16 @@ class TestTelemetryAppender implements ITelemetryAppender { } class ErrorTestingSettings { - public personalInfo; - public importantInfo; - public filePrefix; - public dangerousPathWithoutImportantInfo; - public dangerousPathWithImportantInfo; - public missingModelPrefix; - public missingModelMessage; - public noSuchFilePrefix; - public noSuchFileMessage; - public stack; + public personalInfo: string; + public importantInfo: string; + public filePrefix: string; + public dangerousPathWithoutImportantInfo: string; + public dangerousPathWithImportantInfo: string; + public missingModelPrefix: string; + public missingModelMessage: string; + public noSuchFilePrefix: string; + public noSuchFileMessage: string; + public stack: string[]; constructor() { this.personalInfo = 'DANGEROUS/PATH'; @@ -684,7 +684,7 @@ suite('TelemetryService', () => { getValue(key) { return getConfigurationValue(this.getConfiguration(), key); }, - updateValue() { + updateValue(): TPromise { return null; }, inspect(key: string) { @@ -698,7 +698,7 @@ suite('TelemetryService', () => { }, keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; }, onDidChangeConfiguration: emitter.event, - reloadConfiguration() { return null; }, + reloadConfiguration(): TPromise { return null; }, getConfigurationData() { return null; } }); diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index 0876cbf5b90..9295045ecf9 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -9,18 +9,19 @@ import * as assert from 'assert'; import { Action } from 'vs/base/common/actions'; import { MainThreadMessageService } from 'vs/workbench/api/electron-browser/mainThreadMessageService'; import { TPromise as Promise } from 'vs/base/common/winjs.base'; +import { IMessageService, IChoiceService } from 'vs/platform/message/common/message'; suite('ExtHostMessageService', function () { test('propagte handle on select', function () { - let service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + let service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { assert.equal(m.actions.length, 1); setImmediate(() => m.actions[0].run()); return () => { }; } - }, { + } as IMessageService, { choose() { throw new Error('not implemented'); } @@ -34,11 +35,11 @@ suite('ExtHostMessageService', function () { test('isCloseAffordance', function () { let actions: Action[]; - let service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + let service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { actions = m.actions; } - }, { + } as IMessageService, { choose() { throw new Error('not implemented'); } @@ -62,15 +63,15 @@ suite('ExtHostMessageService', function () { let actions: Action[]; let c: number; - let service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + let service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { c = 0; actions = m.actions; return () => { c += 1; }; } - }, { + } as IMessageService, { choose() { throw new Error('not implemented'); } @@ -85,11 +86,11 @@ suite('ExtHostMessageService', function () { suite('modal', () => { test('calls choice service', () => { - const service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + const service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { throw new Error('not implemented'); } - }, { + } as IMessageService, { choose(severity, message, options, modal) { assert.equal(severity, 1); assert.equal(message, 'h'); @@ -97,7 +98,7 @@ suite('ExtHostMessageService', function () { assert.equal(options[1], 'Cancel'); return Promise.as(0); } - }); + } as IChoiceService); return service.$showMessage(1, 'h', { modal: true }, [{ handle: 42, title: 'a thing', isCloseAffordance: false }]).then(handle => { assert.equal(handle, 42); @@ -105,15 +106,15 @@ suite('ExtHostMessageService', function () { }); test('returns undefined when cancelled', () => { - const service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + const service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { throw new Error('not implemented'); } - }, { + } as IMessageService, { choose(severity, message, options, modal) { return Promise.as(1); } - }); + } as IChoiceService); return service.$showMessage(1, 'h', { modal: true }, [{ handle: 42, title: 'a thing', isCloseAffordance: false }]).then(handle => { assert.equal(handle, undefined); @@ -121,16 +122,16 @@ suite('ExtHostMessageService', function () { }); test('hides Cancel button when not needed', () => { - const service = new MainThreadMessageService(null, { - show(sev: number, m: { message; actions: Action[] }) { + const service = new MainThreadMessageService(null, { + show(sev: number, m: { actions: Action[] }) { throw new Error('not implemented'); } - }, { + } as IMessageService, { choose(severity, message, options, modal) { assert.equal(options.length, 1); return Promise.as(0); } - }); + } as IChoiceService); return service.$showMessage(1, 'h', { modal: true }, [{ handle: 42, title: 'a thing', isCloseAffordance: true }]).then(handle => { assert.equal(handle, 42); From 0234e7151258d344128f60946968fbf1a75c502e Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 7 Nov 2017 14:35:25 -0800 Subject: [PATCH 55/88] Stricter branch name check for exporting configuration.json in build --- build/gulpfile.vscode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 78531a2a0ca..bb04933439a 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -452,7 +452,7 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => { const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json'); gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => { const branch = process.env.BUILD_SOURCEBRANCH; - if (!branch.endsWith('/master') && !branch.indexOf('/release/') >= 0) { + if (!branch.endsWith('/master') && !branch.startsWith('release/')) { console.log(`Only runs on master and release branches, not ${branch}`); return; } From bc347c43b6fbb1256635a0b1ba55da8765cebb5a Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 7 Nov 2017 14:36:23 -0800 Subject: [PATCH 56/88] Add instructions comment to top of setting search feedback page --- .../preferences/browser/preferencesRenderers.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index 5d01c19c744..3924c749686 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -6,6 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as nls from 'vs/nls'; import { Delayer } from 'vs/base/common/async'; +import * as strings from 'vs/base/common/strings'; import { tail } from 'vs/base/common/arrays'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IAction } from 'vs/base/common/actions'; @@ -555,8 +556,13 @@ export class HiddenAreasRenderer extends Disposable { } export class FeedbackWidgetRenderer extends Disposable { - private static DEFAULT_COMMENT_TEXT = 'Modify the below results to match your expectations. Assign scores to indicate their relevance. Replace this comment with any text feedback.'; + private static DEFAULT_COMMENT_TEXT = 'Replace this comment with any text feedback.'; private static DEFAULT_ALTS = ['alt 1', 'alt 2']; + private static INSTRUCTION_TEXT = [ + '// Modify the "resultScores" section to contain only your expected results. Assign scores to indicate their relevance.', + '// Results present in "resultScores" will be automatically "boosted" for this query, if they are not already at the top of the result set.', + '// Add phrase pairs to the "alts" section to have them considered to be synonyms in queries.' + ].join('\n'); private _feedbackWidget: FloatingClickWidget; private _currentResult: IFilterResult; @@ -590,7 +596,7 @@ export class FeedbackWidgetRenderer extends Disposable { } private getFeedback(): void { - if (!this.telemetryService.isOptedIn) { + if (!this.telemetryService.isOptedIn && this.environmentService.appQuality) { this.messageService.show(Severity.Error, 'Can\'t send feedback, user is opted out of telemetry'); return; } @@ -607,7 +613,7 @@ export class FeedbackWidgetRenderer extends Disposable { }); feedbackQuery['alts'] = [FeedbackWidgetRenderer.DEFAULT_ALTS]; - const contents = JSON.stringify(feedbackQuery, undefined, ' '); + const contents = FeedbackWidgetRenderer.INSTRUCTION_TEXT + '\n' + JSON.stringify(feedbackQuery, undefined, ' '); this.editorService.openEditor({ contents, language: 'json' }, /*sideBySide=*/true).then(feedbackEditor => { const sendFeedbackWidget = this._register(this.instantiationService.createInstance(FloatingClickWidget, feedbackEditor.getControl(), 'Send feedback', null)); sendFeedbackWidget.render(); @@ -625,7 +631,9 @@ export class FeedbackWidgetRenderer extends Disposable { private sendFeedback(feedbackEditor: ICodeEditor, result: IFilterResult, actualResults: IScoredResults): TPromise { const model = feedbackEditor.getModel(); - const expectedQueryLines = model.getLinesContent(); + const expectedQueryLines = model.getLinesContent() + .filter(line => !strings.startsWith(line, '//')); + let expectedQuery: any; try { expectedQuery = JSON.parse(expectedQueryLines.join('\n')); From 8639e21bbab52e9fe65d7dd3e7a608128566466d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:19:29 -0800 Subject: [PATCH 57/88] Remove some unneeded casts --- src/vs/base/common/objects.ts | 6 +++--- src/vs/base/test/node/glob.test.ts | 2 +- src/vs/editor/common/services/webWorker.ts | 2 +- .../find/test/common/findController.test.ts | 8 ++++---- .../contrib/format/browser/formatActions.ts | 4 ++-- .../test/common/multicursor.test.ts | 4 ++-- .../test/common/core/editorState.test.ts | 4 ++-- .../parts/search/browser/searchViewlet.ts | 2 +- .../electron-browser/terminalInstance.test.ts | 6 +++--- .../test/common/gettingStarted.test.ts | 4 ++-- .../progress/test/progressService.test.ts | 2 +- .../api/extHostMessagerService.test.ts | 18 +++++++++--------- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index 4ffedf05809..308c65519a6 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -15,7 +15,7 @@ export function clone(obj: T): T { // See https://github.com/Microsoft/TypeScript/issues/10990 return obj as any; } - const result = (Array.isArray(obj)) ? [] : {}; + const result: any = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach((key: keyof T) => { if (obj[key] && typeof obj[key] === 'object') { result[key] = clone(obj[key]); @@ -30,7 +30,7 @@ export function deepClone(obj: T): T { if (!obj || typeof obj !== 'object') { return obj; } - const result = (Array.isArray(obj)) ? [] : {}; + const result: any = Array.isArray(obj) ? [] : {}; Object.getOwnPropertyNames(obj).forEach((key: keyof T) => { if (obj[key] && typeof obj[key] === 'object') { result[key] = deepClone(obj[key]); @@ -231,7 +231,7 @@ export function derive(baseClass: any, derivedClass: any): void { } // Cast to any due to Bug 16188:PropertyDescriptor set and get function should be optional. - Object.defineProperty(derivedClass.prototype, 'constructor', { value: derivedClass, writable: true, configurable: true, enumerable: true }); + Object.defineProperty(derivedClass.prototype, 'constructor', { value: derivedClass, writable: true, configurable: true, enumerable: true }); } /** diff --git a/src/vs/base/test/node/glob.test.ts b/src/vs/base/test/node/glob.test.ts index 702e20f36d8..de91bfb6ab5 100644 --- a/src/vs/base/test/node/glob.test.ts +++ b/src/vs/base/test/node/glob.test.ts @@ -416,7 +416,7 @@ suite('Glob', () => { assert.strictEqual(glob.match(expression, 'test.js', () => siblings), null); - expression = { + expression = { '**/*.js': { } }; diff --git a/src/vs/editor/common/services/webWorker.ts b/src/vs/editor/common/services/webWorker.ts index f44ecfe24db..670357d8030 100644 --- a/src/vs/editor/common/services/webWorker.ts +++ b/src/vs/editor/common/services/webWorker.ts @@ -84,7 +84,7 @@ class MonacoWebWorkerImpl extends EditorWorkerClient implements MonacoWebWork }; }; - let foreignProxy = {}; + let foreignProxy = {} as T; for (let i = 0; i < foreignMethods.length; i++) { foreignProxy[foreignMethods[i]] = createProxyMethod(foreignMethods[i], proxyMethodRequest); } diff --git a/src/vs/editor/contrib/find/test/common/findController.test.ts b/src/vs/editor/contrib/find/test/common/findController.test.ts index 323f3f0ce42..4a0f9c37130 100644 --- a/src/vs/editor/contrib/find/test/common/findController.test.ts +++ b/src/vs/editor/contrib/find/test/common/findController.test.ts @@ -71,11 +71,11 @@ function fromRange(rng: Range): number[] { suite('FindController', () => { let queryState: { [key: string]: any; } = {}; let serviceCollection = new ServiceCollection(); - serviceCollection.set(IStorageService, { + serviceCollection.set(IStorageService, { get: (key: string) => queryState[key], getBoolean: (key: string) => !!queryState[key], store: (key: string, value: any) => { queryState[key] = value; } - }); + } as IStorageService); test('issue #1857: F3, Find Next, acts like "Find Under Cursor"', () => { withMockCodeEditor([ @@ -392,11 +392,11 @@ suite('FindController query options persistence', () => { queryState['editor.matchCase'] = false; queryState['editor.wholeWord'] = false; let serviceCollection = new ServiceCollection(); - serviceCollection.set(IStorageService, { + serviceCollection.set(IStorageService, { get: (key: string) => queryState[key], getBoolean: (key: string) => !!queryState[key], store: (key: string, value: any) => { queryState[key] = value; } - }); + } as IStorageService); test('matchCase', () => { withMockCodeEditor([ diff --git a/src/vs/editor/contrib/format/browser/formatActions.ts b/src/vs/editor/contrib/format/browser/formatActions.ts index 17df91fbcee..f663af59899 100644 --- a/src/vs/editor/contrib/format/browser/formatActions.ts +++ b/src/vs/editor/contrib/format/browser/formatActions.ts @@ -11,7 +11,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution, IActionOptions } from 'vs/editor/common/editorCommonExtensions'; import { OnTypeFormattingEditProviderRegistry, DocumentRangeFormattingEditProviderRegistry } from 'vs/editor/common/modes'; import { getOnTypeFormattingEdits, getDocumentFormattingEdits, getDocumentRangeFormattingEdits, NoProviderError } from '../common/format'; import { EditOperationsCommand } from '../common/formatCommand'; @@ -366,7 +366,7 @@ CommandsRegistry.registerCommand('editor.action.format', accessor => { if (editor) { return new class extends AbstractFormatAction { constructor() { - super({}); + super({} as IActionOptions); } _getFormattingEdits(editor: editorCommon.ICommonCodeEditor): TPromise { const model = editor.getModel(); diff --git a/src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts b/src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts index 93c8377b9d0..438ca8dd54f 100644 --- a/src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts +++ b/src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts @@ -53,11 +53,11 @@ function fromRange(rng: Range): number[] { suite('Multicursor selection', () => { let queryState: { [key: string]: any; } = {}; let serviceCollection = new ServiceCollection(); - serviceCollection.set(IStorageService, { + serviceCollection.set(IStorageService, { get: (key: string) => queryState[key], getBoolean: (key: string) => !!queryState[key], store: (key: string, value: any) => { queryState[key] = value; } - }); + } as IStorageService); test('issue #8817: Cursor position changes when you cancel multicursor', () => { withMockCodeEditor([ diff --git a/src/vs/editor/test/common/core/editorState.test.ts b/src/vs/editor/test/common/core/editorState.test.ts index d629a01987d..f5ca66e9dd4 100644 --- a/src/vs/editor/test/common/core/editorState.test.ts +++ b/src/vs/editor/test/common/core/editorState.test.ts @@ -91,13 +91,13 @@ suite('Editor Core - Editor State', () => { function createEditor({ model, position, selection, scroll }: IStubEditorState = {}): ICommonCodeEditor { let mappedModel = model ? { uri: model.uri ? model.uri : URI.parse('http://dummy.org'), getVersionId: () => model.version } : null; - return { + return { getModel: (): IModel => mappedModel, getPosition: (): Position => position, getSelection: (): Selection => selection, getScrollLeft: (): number => scroll && scroll.left, getScrollTop: (): number => scroll && scroll.top - }; + } as ICommonCodeEditor; } }); diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index d0dfc7755ab..679dd2d65bd 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -257,7 +257,7 @@ export class SearchViewlet extends Viewlet { this.createSearchResultsView(builder); - this.actionRegistry = {}; + this.actionRegistry = {}; let actions: Action[] = [new CollapseDeepestExpandedLevelAction(this), new RefreshAction(this), new ClearSearchResultsAction(this)]; actions.forEach((action) => { this.actionRegistry[action.id] = action; diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts index 5ba6d31a84f..608a9e5f8bc 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts @@ -45,9 +45,9 @@ suite('Workbench - TerminalInstance', () => { executable: '/bin/foosh', args: ['-bar', 'baz'] }; - const parentEnv1: IStringDictionary = { + const parentEnv1: IStringDictionary = { ok: true - }; + } as any; const env1 = TerminalInstance.createTerminalEnv(parentEnv1, shell1, '/foo', 'en-au'); assert.ok(env1['ok'], 'Parent environment is copied'); assert.deepStrictEqual(parentEnv1, { ok: true }, 'Parent environment is unchanged'); @@ -63,7 +63,7 @@ suite('Workbench - TerminalInstance', () => { executable: '/bin/foosh', args: [] }; - const parentEnv2: IStringDictionary = { + const parentEnv2: IStringDictionary = { LANG: 'en_US.UTF-8' }; const env2 = TerminalInstance.createTerminalEnv(parentEnv2, shell2, '/foo', 'en-au'); diff --git a/src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts b/src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts index 39c4c2697dd..7427ca510f2 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts @@ -18,7 +18,7 @@ suite('Workbench - GettingStarted', () => { suiteSetup(() => { instantiation = new TestInstantiationService(); - instantiation.stub(IWorkspaceContextService, { + instantiation.stub(IWorkspaceContextService, { getConfiguration: () => { return { env: { @@ -28,7 +28,7 @@ suite('Workbench - GettingStarted', () => { }; } }); - instantiation.stub(IStorageService, { + instantiation.stub(IStorageService, { get: () => hideWelcomeSettingsValue, store: (value) => hideWelcomeSettingsValue = value }); diff --git a/src/vs/workbench/services/progress/test/progressService.test.ts b/src/vs/workbench/services/progress/test/progressService.test.ts index 9a4a2dd281b..de459cb1241 100644 --- a/src/vs/workbench/services/progress/test/progressService.test.ts +++ b/src/vs/workbench/services/progress/test/progressService.test.ts @@ -17,7 +17,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { Emitter } from 'vs/base/common/event'; -let activeViewlet: Viewlet = {}; +let activeViewlet: Viewlet = {}; class TestViewletService implements IViewletService { public _serviceBrand: any; diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index 9295045ecf9..ed06fa678dc 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -21,11 +21,11 @@ suite('ExtHostMessageService', function () { setImmediate(() => m.actions[0].run()); return () => { }; } - } as IMessageService, { - choose() { + } as IMessageService, { + choose(severity, message, options, modal) { throw new Error('not implemented'); } - }); + } as IChoiceService); return service.$showMessage(1, 'h', {}, [{ handle: 42, title: 'a thing', isCloseAffordance: true }]).then(handle => { assert.equal(handle, 42); @@ -39,11 +39,11 @@ suite('ExtHostMessageService', function () { show(sev: number, m: { actions: Action[] }) { actions = m.actions; } - } as IMessageService, { - choose() { + } as IMessageService, { + choose(severity, message, options, modal) { throw new Error('not implemented'); } - }); + } as IChoiceService); // default close action service.$showMessage(1, '', {}, [{ title: 'a thing', isCloseAffordance: false, handle: 0 }]); @@ -71,11 +71,11 @@ suite('ExtHostMessageService', function () { c += 1; }; } - } as IMessageService, { - choose() { + } as IMessageService, { + choose(severity, message, options, modal) { throw new Error('not implemented'); } - }); + } as IChoiceService); service.$showMessage(1, '', {}, [{ title: 'a thing', isCloseAffordance: true, handle: 0 }]); assert.equal(actions.length, 1); From 8c97c1d130ae1e0638f05dcb857b5feef73726d4 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:22:06 -0800 Subject: [PATCH 58/88] Use `as any` instead of `` for casting in a few places --- .../api/extHostDocumentData.test.ts | 14 +++++++------- src/vs/workbench/test/electron-browser/api/mock.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts index d4a3a7a422f..b89cbfe82dd 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts @@ -42,18 +42,18 @@ suite('ExtHostDocumentData', () => { }); test('readonly-ness', function () { - assert.throws(() => (data).document.uri = null); - assert.throws(() => (data).document.fileName = 'foofile'); - assert.throws(() => (data).document.isDirty = false); - assert.throws(() => (data).document.isUntitled = false); - assert.throws(() => (data).document.languageId = 'dddd'); - assert.throws(() => (data).document.lineCount = 9); + assert.throws((): void => (data as any).document.uri = null); + assert.throws(() => (data as any).document.fileName = 'foofile'); + assert.throws(() => (data as any).document.isDirty = false); + assert.throws(() => (data as any).document.isUntitled = false); + assert.throws(() => (data as any).document.languageId = 'dddd'); + assert.throws(() => (data as any).document.lineCount = 9); }); test('save, when disposed', function () { let saved: URI; let data = new ExtHostDocumentData(new class extends mock() { - $trySaveDocument(uri) { + $trySaveDocument(uri: URI) { assert.ok(!saved); saved = uri; return TPromise.as(true); diff --git a/src/vs/workbench/test/electron-browser/api/mock.ts b/src/vs/workbench/test/electron-browser/api/mock.ts index 622f52cade3..9e8c56e11bc 100644 --- a/src/vs/workbench/test/electron-browser/api/mock.ts +++ b/src/vs/workbench/test/electron-browser/api/mock.ts @@ -10,5 +10,5 @@ export interface Ctor { } export function mock(): Ctor { - return function () { }; + return function () { } as any; } From dff8887e09d3c770756a9b9e8040206dd8ee4a1b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:36:15 -0800 Subject: [PATCH 59/88] Fix more noImplicitAny errors in vs code tests --- src/vs/base/test/browser/dom.test.ts | 6 +- src/vs/base/test/common/arrays.test.ts | 4 +- src/vs/base/test/common/assert.test.ts | 2 +- src/vs/base/test/common/event.test.ts | 28 +++++----- src/vs/base/test/common/filters.test.ts | 11 ++-- src/vs/base/test/common/objects.test.ts | 10 ++-- .../common/winjs.polyfill.promise.test.ts | 24 ++++---- src/vs/base/test/node/flow.test.ts | 56 +++++++++---------- src/vs/workbench/test/common/memento.test.ts | 8 +-- 9 files changed, 75 insertions(+), 74 deletions(-) diff --git a/src/vs/base/test/browser/dom.test.ts b/src/vs/base/test/browser/dom.test.ts index 4b8239985f1..012be3b61be 100644 --- a/src/vs/base/test/browser/dom.test.ts +++ b/src/vs/base/test/browser/dom.test.ts @@ -86,11 +86,11 @@ suite('dom', () => { //}); test('safeStringify', function () { - let obj1 = { + let obj1: any = { friend: null }; - let obj2 = { + let obj2: any = { friend: null }; @@ -100,7 +100,7 @@ suite('dom', () => { let arr: any = [1]; arr.push(arr); - let circular = { + let circular: any = { a: 42, b: null, c: [ diff --git a/src/vs/base/test/common/arrays.test.ts b/src/vs/base/test/common/arrays.test.ts index 59de9d7a5a4..ca7a9bc7996 100644 --- a/src/vs/base/test/common/arrays.test.ts +++ b/src/vs/base/test/common/arrays.test.ts @@ -202,7 +202,7 @@ suite('Arrays', () => { }); test('top', function () { - const cmp = (a, b) => { + const cmp = (a: number, b: number) => { assert.strictEqual(typeof a, 'number', 'typeof a'); assert.strictEqual(typeof b, 'number', 'typeof b'); return a - b; @@ -218,7 +218,7 @@ suite('Arrays', () => { }); test('topAsync', function (done) { - const cmp = (a, b) => { + const cmp = (a: number, b: number) => { assert.strictEqual(typeof a, 'number', 'typeof a'); assert.strictEqual(typeof b, 'number', 'typeof b'); return a - b; diff --git a/src/vs/base/test/common/assert.test.ts b/src/vs/base/test/common/assert.test.ts index 8ccd53a455f..a28f77f0fe8 100644 --- a/src/vs/base/test/common/assert.test.ts +++ b/src/vs/base/test/common/assert.test.ts @@ -23,7 +23,7 @@ suite('Assert', () => { assert.throws(function () { ok(null, 'Foo Bar'); - }, function (e) { + }, function (e: Error) { return e.message.indexOf('Foo Bar') >= 0; }); diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts index c11572642b1..fb2386be509 100644 --- a/src/vs/base/test/common/event.test.ts +++ b/src/vs/base/test/common/event.test.ts @@ -399,7 +399,7 @@ suite('Event utils', () => { suite('buffer', () => { test('should buffer events', () => { - const result = []; + const result: number[] = []; const emitter = new Emitter(); const event = emitter.event; const bufferedEvent = buffer(event); @@ -421,7 +421,7 @@ suite('Event utils', () => { }); test('should buffer events on next tick', () => { - const result = []; + const result: number[] = []; const emitter = new Emitter(); const event = emitter.event; const bufferedEvent = buffer(event, true); @@ -445,7 +445,7 @@ suite('Event utils', () => { }); test('should fire initial buffer events', () => { - const result = []; + const result: number[] = []; const emitter = new Emitter(); const event = emitter.event; const bufferedEvent = buffer(event, false, [-2, -1, 0]); @@ -463,7 +463,7 @@ suite('Event utils', () => { suite('echo', () => { test('should echo events', () => { - const result = []; + const result: number[] = []; const emitter = new Emitter(); const event = emitter.event; const echoEvent = echo(event); @@ -485,8 +485,8 @@ suite('Event utils', () => { }); test('should echo events for every listener', () => { - const result1 = []; - const result2 = []; + const result1: number[] = []; + const result2: number[] = []; const emitter = new Emitter(); const event = emitter.event; const echoEvent = echo(event); @@ -524,7 +524,7 @@ suite('Event utils', () => { suite('EventMultiplexer', () => { test('works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); m.event(r => result.push(r)); @@ -538,7 +538,7 @@ suite('Event utils', () => { }); test('multiplexer dispose works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); m.event(r => result.push(r)); @@ -558,7 +558,7 @@ suite('Event utils', () => { }); test('event dispose works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); m.event(r => result.push(r)); @@ -578,7 +578,7 @@ suite('Event utils', () => { }); test('mutliplexer event dispose works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); m.event(r => result.push(r)); @@ -598,7 +598,7 @@ suite('Event utils', () => { }); test('hot start works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); m.event(r => result.push(r)); @@ -616,7 +616,7 @@ suite('Event utils', () => { }); test('cold start works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); const e1 = new Emitter(); @@ -635,7 +635,7 @@ suite('Event utils', () => { }); test('late add works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); const e1 = new Emitter(); @@ -656,7 +656,7 @@ suite('Event utils', () => { }); test('add dispose works', () => { - const result = []; + const result: number[] = []; const m = new EventMultiplexer(); const e1 = new Emitter(); diff --git a/src/vs/base/test/common/filters.test.ts b/src/vs/base/test/common/filters.test.ts index 2480ab7171d..45018c5a8e4 100644 --- a/src/vs/base/test/common/filters.test.ts +++ b/src/vs/base/test/common/filters.test.ts @@ -5,7 +5,7 @@ 'use strict'; import * as assert from 'assert'; -import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString, matchesWords, fuzzyScore, nextTypoPermutation, fuzzyScoreGraceful } from 'vs/base/common/filters'; +import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString, matchesWords, fuzzyScore, nextTypoPermutation, fuzzyScoreGraceful, IMatch } from 'vs/base/common/filters'; function filterOk(filter: IFilter, word: string, wordToMatchAgainst: string, highlights?: { start: number; end: number; }[]) { let r = filter(word, wordToMatchAgainst); @@ -15,15 +15,16 @@ function filterOk(filter: IFilter, word: string, wordToMatchAgainst: string, hig } } -function filterNotOk(filter, word, suggestion) { +function filterNotOk(filter: IFilter, word: string, suggestion: string) { assert(!filter(word, suggestion)); } suite('Filters', () => { test('or', function () { - let filter, counters; - let newFilter = function (i, r) { - return function () { counters[i]++; return r; }; + let filter: IFilter; + let counters: number[]; + let newFilter = function (i: number, r: boolean): IFilter { + return function (): IMatch[] { counters[i]++; return r as any; }; }; counters = [0, 0]; diff --git a/src/vs/base/test/common/objects.test.ts b/src/vs/base/test/common/objects.test.ts index 48379430d93..3ee70c7d407 100644 --- a/src/vs/base/test/common/objects.test.ts +++ b/src/vs/base/test/common/objects.test.ts @@ -7,12 +7,12 @@ import * as assert from 'assert'; import objects = require('vs/base/common/objects'); -let check = (one, other, msg) => { +let check = (one: any, other: any, msg: string) => { assert(objects.equals(one, other), msg); assert(objects.equals(other, one), '[reverse] ' + msg); }; -let checkNot = (one, other, msg) => { +let checkNot = (one: any, other: any, msg: string) => { assert(!objects.equals(one, other), msg); assert(!objects.equals(other, one), '[reverse] ' + msg); }; @@ -92,11 +92,11 @@ suite('Objects', () => { }); test('safeStringify', function () { - let obj1 = { + let obj1: any = { friend: null }; - let obj2 = { + let obj2: any = { friend: null }; @@ -106,7 +106,7 @@ suite('Objects', () => { let arr: any = [1]; arr.push(arr); - let circular = { + let circular: any = { a: 42, b: null, c: [ diff --git a/src/vs/base/test/common/winjs.polyfill.promise.test.ts b/src/vs/base/test/common/winjs.polyfill.promise.test.ts index a11908fe9ad..5114888d419 100644 --- a/src/vs/base/test/common/winjs.polyfill.promise.test.ts +++ b/src/vs/base/test/common/winjs.polyfill.promise.test.ts @@ -65,30 +65,30 @@ suite('Polyfill Promise', function () { ([Promise, PolyfillPromise]).forEach(PromiseCtor => { test(PromiseCtor.name + ', resolved value', function () { - return new PromiseCtor(resolve => resolve(1)).then(value => assert.equal(value, 1)); + return new PromiseCtor((resolve: Function) => resolve(1)).then((value: number) => assert.equal(value, 1)); }); test(PromiseCtor.name + ', rejected value', function () { - return new PromiseCtor((_, reject) => reject(1)).then(null, value => assert.equal(value, 1)); + return new PromiseCtor((_: Function, reject: Function) => reject(1)).then(null, (value: number) => assert.equal(value, 1)); }); test(PromiseCtor.name + ', catch', function () { - return new PromiseCtor((_, reject) => reject(1)).catch(value => assert.equal(value, 1)); + return new PromiseCtor((_: Function, reject: Function) => reject(1)).catch((value: number) => assert.equal(value, 1)); }); test(PromiseCtor.name + ', static-resolve', function () { - return PromiseCtor.resolve(42).then(value => assert.equal(value, 42)); + return PromiseCtor.resolve(42).then((value: number) => assert.equal(value, 42)); }); test(PromiseCtor.name + ', static-reject', function () { - return PromiseCtor.reject(42).then(null, value => assert.equal(value, 42)); + return PromiseCtor.reject(42).then(null, (value: number) => assert.equal(value, 42)); }); test(PromiseCtor.name + ', static-all, 1', function () { return PromiseCtor.all([ PromiseCtor.resolve(1), PromiseCtor.resolve(2) - ]).then(values => { + ]).then((values: number[]) => { assert.deepEqual(values, [1, 2]); }); }); @@ -98,7 +98,7 @@ suite('Polyfill Promise', function () { PromiseCtor.resolve(1), 3, PromiseCtor.resolve(2) - ]).then(values => { + ]).then((values: number[]) => { assert.deepEqual(values, [1, 3, 2]); }); }); @@ -108,7 +108,7 @@ suite('Polyfill Promise', function () { PromiseCtor.resolve(1), PromiseCtor.reject(13), PromiseCtor.reject(12), - ]).catch(values => { + ]).catch((values: number) => { assert.deepEqual(values, 13); }); }); @@ -117,7 +117,7 @@ suite('Polyfill Promise', function () { return PromiseCtor.race([ PromiseCtor.resolve(1), PromiseCtor.resolve(2), - ]).then(value => { + ]).then((value: number) => { assert.deepEqual(value, 1); }); }); @@ -126,7 +126,7 @@ suite('Polyfill Promise', function () { return PromiseCtor.race([ PromiseCtor.reject(-1), PromiseCtor.resolve(2), - ]).catch(value => { + ]).catch((value: number) => { assert.deepEqual(value, -1); }); }); @@ -135,7 +135,7 @@ suite('Polyfill Promise', function () { return PromiseCtor.race([ PromiseCtor.resolve(1), PromiseCtor.reject(2), - ]).then(value => { + ]).then((value: number) => { assert.deepEqual(value, 1); }); }); @@ -143,7 +143,7 @@ suite('Polyfill Promise', function () { test(PromiseCtor.name + ', throw in ctor', function () { return new PromiseCtor(() => { throw new Error('sooo bad'); - }).catch(err => { + }).catch((err: Error) => { assert.equal(err.message, 'sooo bad'); }); }); diff --git a/src/vs/base/test/node/flow.test.ts b/src/vs/base/test/node/flow.test.ts index 3794e841926..f1edf9c98de 100644 --- a/src/vs/base/test/node/flow.test.ts +++ b/src/vs/base/test/node/flow.test.ts @@ -13,15 +13,15 @@ const sequence = flow.sequence; const parallel = flow.parallel; suite('Flow', () => { - function assertCounterEquals(counter, expected): void { + function assertCounterEquals(counter: number, expected: number): void { assert.ok(counter === expected, 'Expected ' + expected + ' assertions, but got ' + counter); } - function syncThrowsError(callback): void { + function syncThrowsError(callback: any): void { callback(new Error('foo'), null); } - function syncSequenceGetThrowsError(value, callback) { + function syncSequenceGetThrowsError(value: any, callback: any) { sequence( function onError(error) { callback(error, null); @@ -31,27 +31,27 @@ suite('Flow', () => { syncThrowsError(this); }, - function handleFirst(first) { + function handleFirst(first: number) { //Foo } ); } - function syncGet(value, callback): void { + function syncGet(value: any, callback: any): void { callback(null, value); } - function syncGetError(value, callback): void { + function syncGetError(value: any, callback: any): void { callback(new Error(''), null); } - function asyncGet(value, callback): void { + function asyncGet(value: any, callback: any): void { process.nextTick(function () { callback(null, value); }); } - function asyncGetError(value, callback): void { + function asyncGetError(value: any, callback: any): void { process.nextTick(function () { callback(new Error(''), null); }); @@ -72,7 +72,7 @@ suite('Flow', () => { }); test('loopByFunctionSync', function (done: () => void) { - const elements = function (callback) { + const elements = function (callback: Function) { callback(null, ['1', '2', '3']); }; @@ -87,7 +87,7 @@ suite('Flow', () => { }); test('loopByFunctionAsync', function (done: () => void) { - const elements = function (callback) { + const elements = function (callback: Function) { process.nextTick(function () { callback(null, ['1', '2', '3']); }); @@ -180,19 +180,19 @@ suite('Flow', () => { syncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; syncGet('2', this); }, - function handleSecond(this: any, second) { + function handleSecond(this: any, second: any) { assert.deepEqual('2', second); assertionCount++; syncGet(null, this); }, - function handleThird(third) { + function handleThird(third: any) { assert.ok(!third); assertionCount++; @@ -216,19 +216,19 @@ suite('Flow', () => { asyncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; asyncGet('2', this); }, - function handleSecond(this: any, second) { + function handleSecond(this: any, second: number) { assert.deepEqual('2', second); assertionCount++; asyncGet(null, this); }, - function handleThird(third) { + function handleThird(third: number) { assert.ok(!third); assertionCount++; @@ -256,13 +256,13 @@ suite('Flow', () => { syncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; syncGet('2', this); }, - function handleSecond(second) { + function handleSecond(second: number) { if (true) { throw new Error(''); } @@ -270,7 +270,7 @@ suite('Flow', () => { // syncGet(null, this); }, - function handleThird(third) { + function handleThird(third: number) { throw new Error('We should not be here'); } ); @@ -293,13 +293,13 @@ suite('Flow', () => { syncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; syncGetError('2', this); }, - function handleSecond(second) { + function handleSecond(second: number) { throw new Error('We should not be here'); } ); @@ -322,13 +322,13 @@ suite('Flow', () => { asyncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; asyncGet('2', this); }, - function handleSecond(second) { + function handleSecond(second: number) { if (true) { throw new Error(''); } @@ -336,7 +336,7 @@ suite('Flow', () => { // asyncGet(null, this); }, - function handleThird(third) { + function handleThird(third: number) { throw new Error('We should not be here'); } ); @@ -359,13 +359,13 @@ suite('Flow', () => { asyncGet('1', this); }, - function handleFirst(this: any, first) { + function handleFirst(this: any, first: number) { assert.deepEqual('1', first); assertionCount++; asyncGetError('2', this); }, - function handleSecond(second) { + function handleSecond(second: number) { throw new Error('We should not be here'); } ); @@ -396,12 +396,12 @@ suite('Flow', () => { this(true); }, - function getSecond(this: any, result) { + function getSecond(this: any, result: boolean) { assert.equal(result, true); this(false); }, - function last(result) { + function last(result: boolean) { assert.equal(result, false); assertionCount++; diff --git a/src/vs/workbench/test/common/memento.test.ts b/src/vs/workbench/test/common/memento.test.ts index 686250e7b1b..8a3eb9d9219 100644 --- a/src/vs/workbench/test/common/memento.test.ts +++ b/src/vs/workbench/test/common/memento.test.ts @@ -13,8 +13,8 @@ import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; suite('Workbench Memento', () => { - let context; - let storage; + let context: Scope = undefined; + let storage: StorageService; setup(() => { storage = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace.id); @@ -70,9 +70,9 @@ suite('Workbench Memento', () => { assert.deepEqual(memento, {}); // Assert the Mementos are also removed from storage - assert.strictEqual(storage.get('memento/memento.test', Scope.GLOBAL, null), null); + assert.strictEqual(storage.get('memento/memento.test', StorageScope.GLOBAL, null), null); - assert.strictEqual(storage.get('memento/memento.test', Scope.WORKSPACE, null), null); + assert.strictEqual(storage.get('memento/memento.test', StorageScope.WORKSPACE, null), null); }); test('Save and Load', () => { From 882ec13a1a6da994ee4980051c5c7c5ec0652966 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:41:22 -0800 Subject: [PATCH 60/88] Fix cast for progressServiceTest --- src/vs/workbench/services/progress/test/progressService.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/progress/test/progressService.test.ts b/src/vs/workbench/services/progress/test/progressService.test.ts index de459cb1241..ef327a11f63 100644 --- a/src/vs/workbench/services/progress/test/progressService.test.ts +++ b/src/vs/workbench/services/progress/test/progressService.test.ts @@ -17,7 +17,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { Emitter } from 'vs/base/common/event'; -let activeViewlet: Viewlet = {}; +let activeViewlet: Viewlet = {} as any; class TestViewletService implements IViewletService { public _serviceBrand: any; From d8aa66d88d35f9e33145325580d52500e3e81e31 Mon Sep 17 00:00:00 2001 From: MXI Date: Wed, 8 Nov 2017 01:43:09 +0300 Subject: [PATCH 61/88] region folding for css --- extensions/css/language-configuration.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/css/language-configuration.json b/extensions/css/language-configuration.json index ae86befcd2a..bd3151ea17e 100644 --- a/extensions/css/language-configuration.json +++ b/extensions/css/language-configuration.json @@ -20,5 +20,11 @@ ["(", ")"], ["\"", "\""], ["'", "'"] - ] -} \ No newline at end of file + ], + "folding": { + "markers": { + "start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + "end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + } +} From a50a1466512acc0c0235e3364effc5a342dabad2 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 7 Nov 2017 14:46:58 -0800 Subject: [PATCH 62/88] Include buildNumber in remote settings search query --- .../preferences/browser/preferencesSearch.ts | 91 ++++++++++--------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/preferencesSearch.ts b/src/vs/workbench/parts/preferences/browser/preferencesSearch.ts index bf9d27cd179..eda9991fce8 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesSearch.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesSearch.ts @@ -52,7 +52,7 @@ export class PreferencesSearchProvider { } startSearch(filter: string, remote: boolean): PreferencesSearchModel { - return new PreferencesSearchModel(this, filter, remote); + return new PreferencesSearchModel(this, filter, remote, this.environmentService); } } @@ -60,11 +60,11 @@ export class PreferencesSearchModel { private _localProvider: LocalSearchProvider; private _remoteProvider: RemoteSearchProvider; - constructor(private provider: PreferencesSearchProvider, private filter: string, remote: boolean) { + constructor(private provider: PreferencesSearchProvider, private filter: string, remote: boolean, environmentService: IEnvironmentService) { this._localProvider = new LocalSearchProvider(filter); if (remote && filter) { - this._remoteProvider = new RemoteSearchProvider(filter, this.provider.endpoint); + this._remoteProvider = new RemoteSearchProvider(filter, this.provider.endpoint, environmentService); } } @@ -109,9 +109,9 @@ class RemoteSearchProvider { private _filter: string; private _remoteSearchP: TPromise; - constructor(filter: string, endpoint: IEndpointDetails) { + constructor(filter: string, endpoint: IEndpointDetails, private environmentService: IEnvironmentService) { this._filter = filter; - this._remoteSearchP = filter ? getSettingsFromBing(filter, endpoint) : TPromise.wrap(null); + this._remoteSearchP = filter ? this.getSettingsFromBing(filter, endpoint) : TPromise.wrap(null); } filterPreferences(preferencesModel: ISettingsEditorModel): TPromise { @@ -139,47 +139,47 @@ class RemoteSearchProvider { } }); } -} -function getSettingsFromBing(filter: string, endpoint: IEndpointDetails): TPromise { - const url = prepareUrl(filter, endpoint); - console.log('fetching: ' + url); - const start = Date.now(); - const p = fetch(url, { - headers: new Headers({ - 'User-Agent': 'request', - 'Content-Type': 'application/json; charset=utf-8', - 'api-key': endpoint.key + private getSettingsFromBing(filter: string, endpoint: IEndpointDetails): TPromise { + const url = prepareUrl(filter, endpoint, this.environmentService.settingsSearchBuildId); + console.log('fetching: ' + url); + const start = Date.now(); + const p = fetch(url, { + headers: new Headers({ + 'User-Agent': 'request', + 'Content-Type': 'application/json; charset=utf-8', + 'api-key': endpoint.key + }) }) - }) - .then(r => r.json()) - .then(result => { - const timestamp = Date.now(); - const duration = timestamp - start; - console.log('time: ' + duration / 1000); - const suggestions = (result.value || []) - .map(r => ({ - name: r.setting || r.Setting, - score: r['@search.score'] - })); + .then(r => r.json()) + .then(result => { + const timestamp = Date.now(); + const duration = timestamp - start; + console.log('time: ' + duration / 1000); + const suggestions = (result.value || []) + .map(r => ({ + name: r.setting || r.Setting, + score: r['@search.score'] + })); - const scoredResults = Object.create(null); - suggestions.forEach(s => { - const name = s.name - .replace(/^"/, '') - .replace(/"$/, ''); - scoredResults[name] = s.score; + const scoredResults = Object.create(null); + suggestions.forEach(s => { + const name = s.name + .replace(/^"/, '') + .replace(/"$/, ''); + scoredResults[name] = s.score; + }); + + return { + remoteUrl: url, + duration, + timestamp, + scoredResults + }; }); - return { - remoteUrl: url, - duration, - timestamp, - scoredResults - }; - }); - - return TPromise.as(p as any); + return TPromise.as(p as any); + } } const API_VERSION = 'api-version=2016-09-01-Preview'; @@ -193,7 +193,7 @@ function escapeSpecialChars(query: string): string { .trim(); } -function prepareUrl(query: string, endpoint: IEndpointDetails): string { +function prepareUrl(query: string, endpoint: IEndpointDetails, buildNumber: number): string { query = escapeSpecialChars(query); const boost = endpoint.boost || 1; const userQuery = `(${query})^${boost}`; @@ -201,7 +201,12 @@ function prepareUrl(query: string, endpoint: IEndpointDetails): string { // Appending Fuzzy after each word. query = query.replace(/\ +/g, '~ ') + '~'; - return `${endpoint.urlBase}?${API_VERSION}&search=${encodeURIComponent(userQuery + ' || ' + query)}&${QUERY_TYPE}&${SCORING_PROFILE}`; + let url = `${endpoint.urlBase}?${API_VERSION}&search=${encodeURIComponent(userQuery + ' || ' + query)}&${QUERY_TYPE}&${SCORING_PROFILE}`; + if (buildNumber) { + url += `&$filter startbuildno le ${buildNumber} and endbuildno ge ${buildNumber}`; + } + + return url; } class SettingMatches { From 69832fddf67d1be6c89e1daa3a72c99b93b7a997 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 7 Nov 2017 14:54:11 -0800 Subject: [PATCH 63/88] use import mocha instead of for some tests --- extensions/emmet/src/test/abbreviationAction.test.ts | 7 ++++--- .../emmet/src/test/editPointSelectItemBalance.test.ts | 5 +++-- extensions/emmet/src/test/incrementDecrement.test.ts | 1 + extensions/emmet/src/test/reflectCssValue.test.ts | 1 + extensions/emmet/src/test/tagActions.test.ts | 1 + extensions/emmet/src/test/toggleComment.test.ts | 1 + extensions/emmet/src/test/updateImageSize.test.ts | 1 + extensions/emmet/src/typings/refs.d.ts | 1 - extensions/git/src/test/git.test.ts | 1 + extensions/git/src/typings/refs.d.ts | 1 - extensions/html/server/src/test/embedded.test.ts | 1 + extensions/html/server/src/test/formatting.test.ts | 1 + extensions/html/server/src/test/javascriptMode.test.ts | 1 + extensions/html/server/src/test/ref.d.ts | 1 - extensions/vscode-api-tests/src/commands.test.ts | 1 + extensions/vscode-api-tests/src/configuration.test.ts | 1 + extensions/vscode-api-tests/src/typings/ref.d.ts | 1 - extensions/vscode-colorize-tests/src/colorizer.test.ts | 1 + extensions/vscode-colorize-tests/src/typings/ref.d.ts | 1 - .../services/editor/test/browser/editorService.test.ts | 4 ++-- 20 files changed, 21 insertions(+), 12 deletions(-) delete mode 100644 extensions/html/server/src/test/ref.d.ts diff --git a/extensions/emmet/src/test/abbreviationAction.test.ts b/extensions/emmet/src/test/abbreviationAction.test.ts index 0a43576e2bb..0f599e37b86 100644 --- a/extensions/emmet/src/test/abbreviationAction.test.ts +++ b/extensions/emmet/src/test/abbreviationAction.test.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import 'mocha'; import * as assert from 'assert'; import { Selection, workspace } from 'vscode'; import { withRandomFileEditor, closeAllEditors } from './testUtils'; @@ -221,13 +222,13 @@ m10 .hoo { background: } - } + } ` return withRandomFileEditor(scssContentsNoExpand, 'scss', (editor, doc) => { editor.selections = [ new Selection(1, 3, 1, 3), // outside rule - new Selection(5, 15, 5, 15) // in the value part of property value + new Selection(5, 15, 5, 15) // in the value part of property value ]; return expandEmmetAbbreviation(null).then(() => { assert.equal(editor.document.getText(), scssContentsNoExpand); @@ -344,7 +345,7 @@ suite('Tests for Wrap with Abbreviations', () => { suite('Tests for jsx, xml and xsl', () => { teardown(closeAllEditors); - + test('Expand abbreviation with className instead of class in jsx', () => { return withRandomFileEditor('ul.nav', 'javascriptreact', (editor, doc) => { editor.selection = new Selection(0, 6, 0, 6); diff --git a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts index 427ee166f95..f8c4e04bfdc 100644 --- a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts +++ b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import 'mocha'; import * as assert from 'assert'; import { Selection } from 'vscode'; import { withRandomFileEditor, closeAllEditors } from './testUtils'; @@ -18,7 +19,7 @@ suite('Tests for Next/Previous Select/Edit point and Balance actions', () => { margin: 20px 10px; background-image: url('tryme.png'); } - + .boo .hoo { margin: 10px; } @@ -45,7 +46,7 @@ suite('Tests for Next/Previous Select/Edit point and Balance actions', () => {
- +