提交 92839a05 编写于 作者: B Benjamin Pasero

some cleanup

上级 d97efc5f
......@@ -19,7 +19,6 @@ import {EditorInput, getUntitledOrFileResource} from 'vs/workbench/common/editor
import {IEditorRegistry, Extensions} from 'vs/workbench/browser/parts/editor/baseEditor';
import {EditorQuickOpenEntry} from 'vs/workbench/browser/quickopen';
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {IQuickOpenService} from 'vs/workbench/services/quickopen/browser/quickOpenService';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
......@@ -118,8 +117,7 @@ export class EditorHistoryModel extends QuickOpenModel {
constructor(
private editorService: IWorkbenchEditorService,
private instantiationService: IInstantiationService,
private contextService: IWorkspaceContextService,
private quickOpenService: IQuickOpenService
private contextService: IWorkspaceContextService
) {
super();
}
......
......@@ -40,7 +40,6 @@ import {IMessageService, Severity} from 'vs/platform/message/common/message';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
import {IKeybindingService, IKeybindingContextKey} from 'vs/platform/keybinding/common/keybindingService';
import {IConfigurationService, IConfigurationServiceEvent, ConfigurationServiceEventTypes} from 'vs/platform/configuration/common/configuration';
const ID = 'workbench.component.quickopen';
const EDITOR_HISTORY_STORAGE_KEY = 'quickopen.editorhistory';
......@@ -87,7 +86,6 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
private messageService: IMessageService,
private telemetryService: ITelemetryService,
private contextService: IWorkspaceContextService,
private configurationService: IConfigurationService,
keybindingService: IKeybindingService
) {
super(ID);
......@@ -126,7 +124,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
this.toUnbind.push(this.eventService.addListener(EventType.EDITOR_SET_INPUT_ERROR, (e: EditorEvent) => this.onEditorInputSetError(e)));
// Editor History Model
this.editorHistoryModel = new EditorHistoryModel(this.editorService, this.instantiationService, this.contextService, this);
this.editorHistoryModel = new EditorHistoryModel(this.editorService, this.instantiationService, this.contextService);
this.memento = this.getMemento(this.storageService, Scope.WORKSPACE);
if (this.memento[EDITOR_HISTORY_STORAGE_KEY]) {
this.editorHistoryModel.loadFrom(this.memento[EDITOR_HISTORY_STORAGE_KEY]);
......
......@@ -29,7 +29,6 @@ import {HistoryService} from 'vs/workbench/services/history/browser/history';
import {ActivitybarPart} from 'vs/workbench/browser/parts/activitybar/activitybarPart';
import {EditorPart} from 'vs/workbench/browser/parts/editor/editorPart';
import {SidebarPart} from 'vs/workbench/browser/parts/sidebar/sidebarPart';
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
import {StatusbarPart} from 'vs/workbench/browser/parts/statusbar/statusbarPart';
import {WorkbenchLayout, LayoutOptions} from 'vs/workbench/browser/layout';
import {IActionBarRegistry, Extensions as ActionBarExtensions} from 'vs/workbench/browser/actionBarRegistry';
......@@ -271,7 +270,6 @@ export class Workbench implements IPartService {
this.keybindingService = this.instantiationService.getInstance(IKeybindingService);
this.contextService = this.instantiationService.getInstance(IWorkbenchWorkspaceContextService);
this.telemetryService = this.instantiationService.getInstance(ITelemetryService);
let configurationService = this.instantiationService.getInstance(IConfigurationService);
let messageService = this.instantiationService.getInstance(IMessageService);
if (this.keybindingService instanceof AbstractKeybindingService) {
(<AbstractKeybindingService><any>this.keybindingService).setMessageService(messageService);
......@@ -341,7 +339,6 @@ export class Workbench implements IPartService {
messageService,
this.telemetryService,
this.contextService,
configurationService,
this.keybindingService
);
this.toDispose.push(this.quickOpen);
......
......@@ -190,8 +190,7 @@ export class CommandsHandler extends QuickOpenHandler {
@IInstantiationService private instantiationService: IInstantiationService,
@IMessageService private messageService: IMessageService,
@IKeybindingService private keybindingService: IKeybindingService,
@IActionsService private actionsService: IActionsService,
@IQuickOpenService private quickOpenService: IQuickOpenService
@IActionsService private actionsService: IActionsService
) {
super();
}
......
......@@ -386,8 +386,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
constructor(
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IQuickOpenService private quickOpenService: IQuickOpenService
@IWorkspaceContextService private contextService: IWorkspaceContextService
) {
super();
......
......@@ -23,7 +23,6 @@ import {OpenSymbolHandler as _OpenSymbolHandler} from 'vs/workbench/parts/search
import {IMessageService, Severity} from 'vs/platform/message/common/message';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
import {IQuickOpenService} from 'vs/workbench/services/quickopen/browser/quickOpenService';
import {ISearchConfiguration} from 'vs/platform/search/common/search';
import {IConfigurationService, IConfigurationServiceEvent, ConfigurationServiceEventTypes} from 'vs/platform/configuration/common/configuration';
......@@ -52,7 +51,6 @@ export class OpenAnythingHandler extends QuickOpenHandler {
@IMessageService private messageService: IMessageService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IInstantiationService instantiationService: IInstantiationService,
@IQuickOpenService private quickOpenService: IQuickOpenService,
@IConfigurationService private configurationService: IConfigurationService
) {
super();
......
......@@ -25,7 +25,6 @@ import {IInstantiationService} from 'vs/platform/instantiation/common/instantiat
import {IMessageService} from 'vs/platform/message/common/message';
import {IQueryOptions, ISearchService, ISearchComplete, ISearchProgressItem} from 'vs/platform/search/common/search';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IQuickOpenService} from 'vs/workbench/services/quickopen/browser/quickOpenService';
export class FileEntry extends EditorQuickOpenEntry {
private name: string;
......@@ -99,8 +98,7 @@ export class OpenFileHandler extends QuickOpenHandler {
@IConfigurationService private configurationService: IConfigurationService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@ITextFileService private textFileService: ITextFileService,
@ISearchService private searchService: ISearchService,
@IQuickOpenService private quickOpenService: IQuickOpenService
@ISearchService private searchService: ISearchService
) {
super();
......
......@@ -40,7 +40,7 @@ suite('Workbench QuickOpen', () => {
let contextService = new TestContextService();
let inst = create({});
let model = new EditorHistoryModel(editorService, null, contextService, new TestQuickOpenService());
let model = new EditorHistoryModel(editorService, null, contextService);
let input1 = inst.createInstance(StringEditorInput, "name1", 'description', "value1", "text/plain", false);
let entry1 = new EditorHistoryEntry(editorService, contextService, input1, null, null, model);
......@@ -78,7 +78,7 @@ suite('Workbench QuickOpen', () => {
let contextService = new TestContextService();
let inst = create({});
let model = new EditorHistoryModel(editorService, null, contextService, new TestQuickOpenService());
let model = new EditorHistoryModel(editorService, null, contextService);
let input1 = inst.createInstance(StringEditorInput, "name1", 'description', "value1", "text/plain", false);
......@@ -96,11 +96,10 @@ suite('Workbench QuickOpen', () => {
let editorService = new TestEditorService();
let contextService = new TestContextService();
let quickOpenService = new TestQuickOpenService();
let inst = create({ editorService: editorService });
let model = new EditorHistoryModel(editorService, inst, contextService, quickOpenService);
let model = new EditorHistoryModel(editorService, inst, contextService);
let input1 = inst.createInstance(StringEditorInput, "name1", 'description', "value1", "text/plain", false);
let input2 = inst.createInstance(StringEditorInput, "name2", 'description', "value2", "text/plain", false);
......@@ -135,14 +134,14 @@ suite('Workbench QuickOpen', () => {
model.saveTo(memento);
assert(!isEmptyObject(memento));
model = new EditorHistoryModel(editorService, inst, contextService, quickOpenService);
model = new EditorHistoryModel(editorService, inst, contextService);
model.loadFrom(memento);
assert.equal(2, model.getEntries().length);
assert(model.getEntries()[0].matches(saveInput2));
assert(model.getEntries()[1].matches(saveInput1));
model = new EditorHistoryModel(editorService, inst, contextService, quickOpenService);
model = new EditorHistoryModel(editorService, inst, contextService);
let cinput1 = <EditorInput>inst.createInstance(fileInputCtor, toResource("Hello World"), "text/plain", void 0);
let cinput2 = <EditorInput>inst.createInstance(fileInputCtor, toResource("Yes World"), "text/plain", void 0);
......@@ -158,7 +157,7 @@ suite('Workbench QuickOpen', () => {
assert.equal(1, model.getResults("*")[0].getHighlights()[0].length);
model = new EditorHistoryModel(editorService, inst, contextService, quickOpenService);
model = new EditorHistoryModel(editorService, inst, contextService);
let cinput4 = <EditorInput>inst.createInstance(fileInputCtor, toResource("foo.ts"), "text/plain", void 0);
let cinput5 = <EditorInput>inst.createInstance(fileInputCtor, toResource("bar.js"), "text/plain", void 0);
......@@ -217,7 +216,6 @@ suite('Workbench QuickOpen', () => {
null,
null,
contextService,
new TestConfigurationService(),
new TestKeybindingService()
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册