提交 6dc7e364 编写于 作者: J Johannes Rieken

debt - remove some ts-ignored things

上级 d2cc9662
......@@ -62,8 +62,7 @@ export class InstantiationService implements IInstantiationService {
}
}
// @ts-ignore unused generic parameter
createInstance<T>(param: any, ...rest: any[]): any {
createInstance(param: any, ...rest: any[]): any {
if (param instanceof SyncDescriptor) {
// sync
......
......@@ -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;
......
......@@ -69,8 +69,7 @@ export class HeapService implements IHeapService {
trackRecursive<T>(p: TPromise<T>): TPromise<T>;
trackRecursive<T>(obj: T): T;
// @ts-ignore unused generic parameter
trackRecursive<T>(obj: any): any {
trackRecursive(obj: any): any {
if (TPromise.is(obj)) {
return obj.then(result => this.trackRecursive(result));
} else {
......
......@@ -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
) {
......
......@@ -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);
......
......@@ -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<string, number>,
private _provider: vscode.DocumentColorProvider
) { }
......@@ -758,7 +754,6 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
private _heapService: ExtHostHeapService;
private _diagnostics: ExtHostDiagnostics;
private _adapter = new Map<number, Adapter>();
private _colorFormatCache = new Map<string, number>();
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);
}
......
......@@ -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<T>(item: any): item is vscode.MessageItem {
function isMessageItem(item: any): item is vscode.MessageItem {
return item && item.title;
}
......
......@@ -20,11 +20,6 @@ import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
import * as vscode from 'vscode';
// @ts-ignore unused type
interface StringMap<V> {
[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
}
......@@ -133,9 +133,8 @@ export class Snippet {
}
}
// @ts-ignore unused type
namespace OpenSnippetsAction {
{
const id = 'workbench.action.openSnippets';
CommandsRegistry.registerCommand(id, accessor => {
......
......@@ -14,7 +14,7 @@ suite('ExtHostMessageService', function () {
test('propagte handle on select', function () {
let service = new MainThreadMessageService(null, null, <any>{
let service = new MainThreadMessageService(null, <any>{
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, <any>{
let service = new MainThreadMessageService(null, <any>{
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, <any>{
let service = new MainThreadMessageService(null, <any>{
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, <any>{
const service = new MainThreadMessageService(null, <any>{
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, <any>{
const service = new MainThreadMessageService(null, <any>{
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, <any>{
const service = new MainThreadMessageService(null, <any>{
show(sev: number, m: { message; actions: Action[] }) {
throw new Error('not implemented');
}
......
......@@ -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<ExtHostDocumentsAndEditorsShape>() {
$acceptDocumentsAndEditorsDelta(delta) { deltas.push(delta); }
}),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册