Skip to content

Commit 0438b90

Browse files
committed
remove ts-ignore
1 parent 9fdf885 commit 0438b90

File tree

6 files changed

+16
-56
lines changed

6 files changed

+16
-56
lines changed

src/vs/base/parts/tree/test/browser/treeModel.test.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -1439,13 +1439,11 @@ suite('TreeModel - Dynamic data model', () => {
14391439

14401440
var gotTimes = 0;
14411441
var gotListener = dataModel.addListener('gotChildren', (element) => { gotTimes++; });
1442-
// @ts-ignore unused local
1443-
var p1, p2;
14441442

14451443
var p1Completes = [];
14461444
dataModel.promiseFactory = () => { return new WinJS.TPromise((c) => { p1Completes.push(c); }); };
14471445

1448-
p1 = model.refresh('grandfather');
1446+
model.refresh('grandfather');
14491447

14501448
// just a single get
14511449
assert.equal(refreshTimes, 1); // (+1) grandfather
@@ -1462,7 +1460,7 @@ suite('TreeModel - Dynamic data model', () => {
14621460

14631461
var p2Complete;
14641462
dataModel.promiseFactory = () => { return new WinJS.TPromise((c) => { p2Complete = c; }); };
1465-
p2 = model.refresh('father');
1463+
var p2 = model.refresh('father');
14661464

14671465
// same situation still
14681466
assert.equal(refreshTimes, 3); // (+1) second father refresh
@@ -1517,13 +1515,12 @@ suite('TreeModel - Dynamic data model', () => {
15171515
var gotTimes = 0;
15181516
var getListener = dataModel.addListener('getChildren', (element) => { getTimes++; });
15191517
var gotListener = dataModel.addListener('gotChildren', (element) => { gotTimes++; });
1520-
// @ts-ignore unused local
1521-
var p1, p2;
1518+
var p2;
15221519

15231520
var p1Complete;
15241521
dataModel.promiseFactory = () => { return new WinJS.TPromise((c) => { p1Complete = c; }); };
15251522

1526-
p1 = model.refresh('father');
1523+
model.refresh('father');
15271524

15281525
assert.equal(getTimes, 1);
15291526
assert.equal(gotTimes, 0);

src/vs/workbench/api/electron-browser/mainThreadSCM.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import Event, { Emitter } from 'vs/base/common/event';
1111
import { assign } from 'vs/base/common/objects';
1212
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
1313
import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, ISCMResourceCollection, ISCMResourceSplice } from 'vs/workbench/services/scm/common/scm';
14-
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
15-
import { ICommandService } from 'vs/platform/commands/common/commands';
1614
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, IExtHostContext } from '../node/extHost.protocol';
1715
import { Command } from 'vs/editor/common/modes';
1816
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
@@ -120,9 +118,7 @@ class MainThreadSCMProvider implements ISCMProvider {
120118
private _contextValue: string,
121119
private _label: string,
122120
private _rootUri: URI | undefined,
123-
@ISCMService scmService: ISCMService,
124-
// @ts-ignore unused injected service
125-
@ICommandService private commandService: ICommandService
121+
@ISCMService scmService: ISCMService
126122
) { }
127123

128124
$updateSourceControl(features: SCMProviderFeatures): void {
@@ -257,10 +253,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
257253

258254
constructor(
259255
extHostContext: IExtHostContext,
260-
// @ts-ignore unused injected service
261-
@IInstantiationService private instantiationService: IInstantiationService,
262-
@ISCMService private scmService: ISCMService,
263-
@ICommandService private commandService: ICommandService
256+
@ISCMService private scmService: ISCMService
264257
) {
265258
this._proxy = extHostContext.get(ExtHostContext.ExtHostSCM);
266259
}
@@ -278,7 +271,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
278271
}
279272

280273
$registerSourceControl(handle: number, id: string, label: string, rootUri: string | undefined): void {
281-
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri && URI.parse(rootUri), this.scmService, this.commandService);
274+
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri && URI.parse(rootUri), this.scmService);
282275
const repository = this.scmService.registerSCMProvider(provider);
283276
this._repositories[handle] = repository;
284277

src/vs/workbench/browser/parts/views/treeView.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export class TreeView extends ViewsViewletPanel {
4141
private dataProviderElementChangeListener: IDisposable;
4242

4343
constructor(
44-
// @ts-ignore unused property
45-
private options: IViewletViewOptions,
44+
options: IViewletViewOptions,
4645
@IMessageService private messageService: IMessageService,
4746
@IKeybindingService keybindingService: IKeybindingService,
4847
@IContextMenuService contextMenuService: IContextMenuService,

src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts

+1-24
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ import * as ext from 'vs/workbench/common/contributions';
1616
import { CodeEditor } from 'vs/editor/browser/codeEditor';
1717
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1818
import { IMessageService, Severity } from 'vs/platform/message/common/message';
19-
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
2019
import { ITextModelService } from 'vs/editor/common/services/resolverService';
2120
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
22-
import { IModelService } from 'vs/editor/common/services/modelService';
2321
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
2422
import URI from 'vs/base/common/uri';
2523
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
@@ -194,8 +192,7 @@ class DirtyDiffWidget extends PeekViewWidget {
194192
private model: DirtyDiffModel,
195193
@IThemeService private themeService: IThemeService,
196194
@IInstantiationService private instantiationService: IInstantiationService,
197-
// @ts-ignore unused injected service
198-
@IMenuService private menuService: IMenuService,
195+
@IMenuService menuService: IMenuService,
199196
@IKeybindingService private keybindingService: IKeybindingService,
200197
@IMessageService private messageService: IMessageService,
201198
@IContextKeyService contextKeyService: IContextKeyService
@@ -468,8 +465,6 @@ export class DirtyDiffController implements IEditorContribution {
468465

469466
private model: DirtyDiffModel | null = null;
470467
private widget: DirtyDiffWidget | null = null;
471-
// @ts-ignore unused property
472-
private currentLineNumber: number = -1;
473468
private currentIndex: number = -1;
474469
private readonly isDirtyDiffVisible: IContextKey<boolean>;
475470
private session: IDisposable = EmptyDisposable;
@@ -480,8 +475,6 @@ export class DirtyDiffController implements IEditorContribution {
480475
constructor(
481476
private editor: ICodeEditor,
482477
@IContextKeyService contextKeyService: IContextKeyService,
483-
// @ts-ignore unused injected service
484-
@IThemeService private themeService: IThemeService,
485478
@IInstantiationService private instantiationService: IInstantiationService
486479
) {
487480
this.enabled = !contextKeyService.getContextKeyValue('isInDiffEditor');
@@ -513,9 +506,6 @@ export class DirtyDiffController implements IEditorContribution {
513506
this.currentIndex = rot(this.currentIndex + 1, this.model.changes.length);
514507
}
515508

516-
const change = this.model.changes[this.currentIndex];
517-
this.currentLineNumber = change.modifiedStartLineNumber;
518-
519509
this.widget.showChange(this.currentIndex);
520510
}
521511

@@ -530,9 +520,6 @@ export class DirtyDiffController implements IEditorContribution {
530520
this.currentIndex = rot(this.currentIndex - 1, this.model.changes.length);
531521
}
532522

533-
const change = this.model.changes[this.currentIndex];
534-
this.currentLineNumber = change.modifiedStartLineNumber;
535-
536523
this.widget.showChange(this.currentIndex);
537524
}
538525

@@ -875,13 +862,7 @@ export class DirtyDiffModel {
875862
constructor(
876863
private _editorModel: IModel,
877864
@ISCMService private scmService: ISCMService,
878-
// @ts-ignore unused injected service
879-
@IModelService private modelService: IModelService,
880865
@IEditorWorkerService private editorWorkerService: IEditorWorkerService,
881-
// @ts-ignore unused injected service
882-
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
883-
// @ts-ignore unused injected service
884-
@IWorkspaceContextService private contextService: IWorkspaceContextService,
885866
@ITextModelService private textModelResolverService: ITextModelService
886867
) {
887868
this.diffDelayer = new ThrottledDelayer<IChange[]>(200);
@@ -1024,12 +1005,8 @@ export class DirtyDiffWorkbenchController implements ext.IWorkbenchContribution,
10241005
private disposables: IDisposable[] = [];
10251006

10261007
constructor(
1027-
// @ts-ignore unused injected service
1028-
@IMessageService private messageService: IMessageService,
10291008
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
10301009
@IEditorGroupService editorGroupService: IEditorGroupService,
1031-
// @ts-ignore unused injected service
1032-
@IWorkspaceContextService private contextService: IWorkspaceContextService,
10331010
@IInstantiationService private instantiationService: IInstantiationService
10341011
) {
10351012
this.disposables.push(editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));

src/vs/workbench/parts/scm/electron-browser/scmMenus.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export class SCMMenus implements IDisposable {
2828
private disposables: IDisposable[] = [];
2929

3030
constructor(
31-
// @ts-ignore unused property
32-
private provider: ISCMProvider | undefined,
31+
provider: ISCMProvider | undefined,
3332
@IContextKeyService contextKeyService: IContextKeyService,
3433
@IMenuService private menuService: IMenuService
3534
) {

src/vs/workbench/parts/update/electron-browser/update.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ export abstract class AbstractShowReleaseNotesAction extends Action {
128128
constructor(
129129
id: string,
130130
label: string,
131-
// @ts-ignore unused property
132-
private returnValue: boolean,
133131
private version: string,
134132
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
135133
@IInstantiationService private instantiationService: IInstantiationService
@@ -157,12 +155,11 @@ export abstract class AbstractShowReleaseNotesAction extends Action {
157155
export class ShowReleaseNotesAction extends AbstractShowReleaseNotesAction {
158156

159157
constructor(
160-
returnValue: boolean,
161158
version: string,
162159
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
163160
@IInstantiationService instantiationService: IInstantiationService
164161
) {
165-
super('update.showReleaseNotes', nls.localize('releaseNotes', "Release Notes"), returnValue, version, editorService, instantiationService);
162+
super('update.showReleaseNotes', nls.localize('releaseNotes', "Release Notes"), version, editorService, instantiationService);
166163
}
167164
}
168165

@@ -177,14 +174,13 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio
177174
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
178175
@IInstantiationService instantiationService: IInstantiationService
179176
) {
180-
super(id, label, true, pkg.version, editorService, instantiationService);
177+
super(id, label, pkg.version, editorService, instantiationService);
181178
}
182179
}
183180

184181
export class DownloadAction extends Action {
185182

186-
// @ts-ignore unused property
187-
constructor(private url: string, @IUpdateService private updateService: IUpdateService) {
183+
constructor( @IUpdateService private updateService: IUpdateService) {
188184
super('update.download', nls.localize('downloadNow', "Download Now"), null, true);
189185
}
190186

@@ -303,8 +299,7 @@ class CommandAction extends Action {
303299
constructor(
304300
commandId: string,
305301
label: string,
306-
// @ts-ignore unused injected service
307-
@ICommandService private commandService: ICommandService
302+
@ICommandService commandService: ICommandService
308303
) {
309304
super(`command-action:${commandId}`, label, undefined, true, () => commandService.executeCommand(commandId));
310305
}
@@ -397,10 +392,10 @@ export class UpdateContribution implements IGlobalActivity {
397392
}
398393

399394
private showUpdateNotification(version: string): void {
400-
const releaseNotesAction = this.instantiationService.createInstance(ShowReleaseNotesAction, false, version);
395+
const releaseNotesAction = this.instantiationService.createInstance(ShowReleaseNotesAction, version);
401396

402397
if (isLinux) {
403-
const downloadAction = this.instantiationService.createInstance(DownloadAction, version);
398+
const downloadAction = this.instantiationService.createInstance(DownloadAction);
404399

405400
this.messageService.show(severity.Info, {
406401
message: nls.localize('thereIsUpdateAvailable', "There is an available update."),

0 commit comments

Comments
 (0)