提交 10e17cef 编写于 作者: J Johannes Rieken

remove unused service, #28726

上级 c00bdb74
......@@ -9,7 +9,6 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import URI from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
import { IEditorService } from 'vs/platform/editor/common/editor';
import { optional } from 'vs/platform/instantiation/common/instantiation';
import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands';
import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
......@@ -18,12 +17,13 @@ import { Range } from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction, CommonEditorRegistry, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { Location, ReferenceProviderRegistry } from 'vs/editor/common/modes';
import { IPeekViewService, PeekContext, getOuterEditor } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import { PeekContext, getOuterEditor } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import { ReferencesController, RequestOptions, ctxReferenceSearchVisible } from './referencesController';
import { ReferencesModel } from './referencesModel';
import { asWinJsPromise } from 'vs/base/common/async';
import { onUnexpectedExternalError } from 'vs/base/common/errors';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';
const defaultReferenceSearchOptions: RequestOptions = {
getMetaTitle(model) {
......@@ -38,10 +38,9 @@ export class ReferenceController implements editorCommon.IEditorContribution {
constructor(
editor: editorCommon.ICommonCodeEditor,
@IContextKeyService contextKeyService: IContextKeyService,
@optional(IPeekViewService) peekViewService: IPeekViewService
@IContextKeyService contextKeyService: IContextKeyService
) {
if (peekViewService) {
if (editor instanceof EmbeddedCodeEditorWidget) {
PeekContext.inPeekEditor.bindTo(contextKeyService);
}
}
......
......@@ -21,7 +21,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { IPeekViewService } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import { ReferencesModel, OneReference } from './referencesModel';
import { ReferenceWidget, LayoutData } from './referencesWidget';
import { Range } from 'vs/editor/common/core/range';
......@@ -67,7 +66,6 @@ export class ReferencesController implements editorCommon.IEditorContribution {
@IStorageService private _storageService: IStorageService,
@IThemeService private _themeService: IThemeService,
@IConfigurationService private _configurationService: IConfigurationService,
@optional(IPeekViewService) private _peekViewService: IPeekViewService,
@optional(IEnvironmentService) private _environmentService: IEnvironmentService
) {
this._editor = editor;
......
......@@ -26,14 +26,13 @@ import * as tree from 'vs/base/parts/tree/browser/tree';
import { DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { Range, IRange } from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { Model } from 'vs/editor/common/model/model';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';
import { PeekViewWidget, IPeekViewService } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import { PeekViewWidget } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import { FileReferences, OneReference, ReferencesModel } from './referencesModel';
import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService';
import { registerColor, activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
......@@ -584,8 +583,6 @@ export class ReferenceWidget extends PeekViewWidget {
this._applyTheme(_themeService.getTheme());
this._callOnDispose.push(_themeService.onThemeChange(this._applyTheme.bind(this)));
this._instantiationService = this._instantiationService.createChild(new ServiceCollection([IPeekViewService, this]));
this.create();
}
......
......@@ -14,7 +14,7 @@ import { $ } from 'vs/base/browser/builder';
import Event, { Emitter } from 'vs/base/common/event';
import * as dom from 'vs/base/browser/dom';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { ServicesAccessor, createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
......@@ -23,20 +23,11 @@ import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeE
import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { Color } from 'vs/base/common/color';
export var IPeekViewService = createDecorator<IPeekViewService>('peekViewService');
export namespace PeekContext {
export const inPeekEditor = new RawContextKey<boolean>('inReferenceSearchEditor', true);
export const notInPeekEditor: ContextKeyExpr = inPeekEditor.toNegated();
}
export const NOT_INNER_EDITOR_CONTEXT_KEY = new RawContextKey<boolean>('inReferenceSearchEditor', true);
export interface IPeekViewService {
_serviceBrand: any;
isActive: boolean;
}
export function getOuterEditor(accessor: ServicesAccessor): ICommonCodeEditor {
let editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
if (editor instanceof EmbeddedCodeEditorWidget) {
......@@ -60,12 +51,11 @@ const defaultOptions: IPeekViewOptions = {
secondaryHeadingColor: Color.fromHex('#6c6c6cb3')
};
export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewService {
export abstract class PeekViewWidget extends ZoneWidget {
public _serviceBrand: any;
private _onDidClose = new Emitter<PeekViewWidget>();
private _isActive = false;
protected _headElement: HTMLDivElement;
protected _primaryHeading: HTMLElement;
......@@ -80,7 +70,6 @@ export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewServ
}
public dispose(): void {
this._isActive = false;
super.dispose();
this._onDidClose.fire(this);
}
......@@ -89,15 +78,6 @@ export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewServ
return this._onDidClose.event;
}
public get isActive(): boolean {
return this._isActive;
}
public show(where: any, heightInLines: number): void {
this._isActive = true;
super.show(where, heightInLines);
}
public style(styles: IPeekViewStyles): void {
let options = <IPeekViewOptions>this.options;
if (styles.headerBackgroundColor) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册