提交 56087d67 编写于 作者: B Benjamin Pasero

debt - strict function

上级 32b28614
...@@ -53,7 +53,7 @@ export const QuickOpenItemAccessor = new QuickOpenItemAccessorClass(); ...@@ -53,7 +53,7 @@ export const QuickOpenItemAccessor = new QuickOpenItemAccessorClass();
export class QuickOpenEntry { export class QuickOpenEntry {
private id: string; private id: string;
private labelHighlights: IHighlight[]; private labelHighlights?: IHighlight[];
private descriptionHighlights?: IHighlight[]; private descriptionHighlights?: IHighlight[];
private detailHighlights?: IHighlight[]; private detailHighlights?: IHighlight[];
private hidden: boolean | undefined; private hidden: boolean | undefined;
...@@ -160,7 +160,7 @@ export class QuickOpenEntry { ...@@ -160,7 +160,7 @@ export class QuickOpenEntry {
/** /**
* Allows to set highlight ranges that should show up for the entry label and optionally description if set. * Allows to set highlight ranges that should show up for the entry label and optionally description if set.
*/ */
setHighlights(labelHighlights: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void { setHighlights(labelHighlights?: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void {
this.labelHighlights = labelHighlights; this.labelHighlights = labelHighlights;
this.descriptionHighlights = descriptionHighlights; this.descriptionHighlights = descriptionHighlights;
this.detailHighlights = detailHighlights; this.detailHighlights = detailHighlights;
...@@ -169,7 +169,7 @@ export class QuickOpenEntry { ...@@ -169,7 +169,7 @@ export class QuickOpenEntry {
/** /**
* Allows to return highlight ranges that should show up for the entry label and description. * Allows to return highlight ranges that should show up for the entry label and description.
*/ */
getHighlights(): [IHighlight[] /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] { getHighlights(): [IHighlight[] | undefined /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] {
return [this.labelHighlights, this.descriptionHighlights, this.detailHighlights]; return [this.labelHighlights, this.descriptionHighlights, this.detailHighlights];
} }
...@@ -260,7 +260,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { ...@@ -260,7 +260,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
return this.entry; return this.entry;
} }
getHighlights(): [IHighlight[], IHighlight[] | undefined, IHighlight[] | undefined] { getHighlights(): [IHighlight[] | undefined, IHighlight[] | undefined, IHighlight[] | undefined] {
return this.entry ? this.entry.getHighlights() : super.getHighlights(); return this.entry ? this.entry.getHighlights() : super.getHighlights();
} }
...@@ -268,7 +268,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { ...@@ -268,7 +268,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
return this.entry ? this.entry.isHidden() : super.isHidden(); return this.entry ? this.entry.isHidden() : super.isHidden();
} }
setHighlights(labelHighlights: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void { setHighlights(labelHighlights?: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void {
this.entry ? this.entry.setHighlights(labelHighlights, descriptionHighlights, detailHighlights) : super.setHighlights(labelHighlights, descriptionHighlights, detailHighlights); this.entry ? this.entry.setHighlights(labelHighlights, descriptionHighlights, detailHighlights) : super.setHighlights(labelHighlights, descriptionHighlights, detailHighlights);
} }
......
...@@ -163,15 +163,19 @@ export class GlobalActivityActionViewItem extends ActivityActionViewItem { ...@@ -163,15 +163,19 @@ export class GlobalActivityActionViewItem extends ActivityActionViewItem {
export class PlaceHolderViewletActivityAction extends ViewletActivityAction { export class PlaceHolderViewletActivityAction extends ViewletActivityAction {
constructor( constructor(
id: string, name: string, iconUrl: URI, id: string,
name: string,
iconUrl: URI | undefined,
@IViewletService viewletService: IViewletService, @IViewletService viewletService: IViewletService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService @ITelemetryService telemetryService: ITelemetryService
) { ) {
super({ id, name: id, cssClass: `extensionViewlet-placeholder-${id.replace(/\./g, '-')}` }, viewletService, layoutService, telemetryService); super({ id, name: id, cssClass: `extensionViewlet-placeholder-${id.replace(/\./g, '-')}` }, viewletService, layoutService, telemetryService);
const iconClass = `.monaco-workbench .activitybar .monaco-action-bar .action-label.${this.class}`; // Generate Placeholder CSS to show the icon in the activity bar if (iconUrl) {
DOM.createCSSRule(iconClass, `-webkit-mask: ${DOM.asCSSUrl(iconUrl)} no-repeat 50% 50%; -webkit-mask-size: 24px;`); const iconClass = `.monaco-workbench .activitybar .monaco-action-bar .action-label.${this.class}`; // Generate Placeholder CSS to show the icon in the activity bar
DOM.createCSSRule(iconClass, `-webkit-mask: ${DOM.asCSSUrl(iconUrl)} no-repeat 50% 50%; -webkit-mask-size: 24px;`);
}
} }
setActivity(activity: IActivity): void { setActivity(activity: IActivity): void {
......
...@@ -110,7 +110,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { ...@@ -110,7 +110,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
openComposite: (compositeId: string) => this.viewletService.openViewlet(compositeId, true), openComposite: (compositeId: string) => this.viewletService.openViewlet(compositeId, true),
getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction, getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction,
getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction, getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction,
getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(ToggleViewletAction, this.viewletService.getViewlet(compositeId)), getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(ToggleViewletAction, assertIsDefined(this.viewletService.getViewlet(compositeId))),
getContextMenuActions: () => [this.instantiationService.createInstance(ToggleActivityBarVisibilityAction, ToggleActivityBarVisibilityAction.ID, nls.localize('hideActivitBar', "Hide Activity Bar"))], getContextMenuActions: () => [this.instantiationService.createInstance(ToggleActivityBarVisibilityAction, ToggleActivityBarVisibilityAction.ID, nls.localize('hideActivitBar', "Hide Activity Bar"))],
getDefaultCompositeId: () => this.viewletService.getDefaultViewletId(), getDefaultCompositeId: () => this.viewletService.getDefaultViewletId(),
hidePart: () => this.layoutService.setSideBarHidden(true), hidePart: () => this.layoutService.setSideBarHidden(true),
......
...@@ -439,7 +439,7 @@ export class CompositeActionViewItem extends ActivityActionViewItem { ...@@ -439,7 +439,7 @@ export class CompositeActionViewItem extends ActivityActionViewItem {
constructor( constructor(
private compositeActivityAction: ActivityAction, private compositeActivityAction: ActivityAction,
private toggleCompositePinnedAction: Action, private toggleCompositePinnedAction: Action,
private contextMenuActionsProvider: () => Action[], private contextMenuActionsProvider: () => ReadonlyArray<Action>,
colors: (theme: ITheme) => ICompositeBarColors, colors: (theme: ITheme) => ICompositeBarColors,
icon: boolean, icon: boolean,
private compositeBar: ICompositeBar, private compositeBar: ICompositeBar,
......
...@@ -123,7 +123,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService { ...@@ -123,7 +123,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
openComposite: (compositeId: string) => Promise.resolve(this.openPanel(compositeId, true)), openComposite: (compositeId: string) => Promise.resolve(this.openPanel(compositeId, true)),
getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction, getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction,
getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction, getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction,
getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(PanelActivityAction, this.getPanel(compositeId)), getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(PanelActivityAction, assertIsDefined(this.getPanel(compositeId))),
getContextMenuActions: () => [ getContextMenuActions: () => [
this.instantiationService.createInstance(TogglePanelPositionAction, TogglePanelPositionAction.ID, TogglePanelPositionAction.LABEL), this.instantiationService.createInstance(TogglePanelPositionAction, TogglePanelPositionAction.ID, TogglePanelPositionAction.LABEL),
this.instantiationService.createInstance(TogglePanelAction, TogglePanelAction.ID, localize('hidePanel', "Hide Panel")) this.instantiationService.createInstance(TogglePanelAction, TogglePanelAction.ID, localize('hidePanel', "Hide Panel"))
...@@ -330,7 +330,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService { ...@@ -330,7 +330,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
let compositeActions = this.compositeActions.get(compositeId); let compositeActions = this.compositeActions.get(compositeId);
if (!compositeActions) { if (!compositeActions) {
compositeActions = { compositeActions = {
activityAction: this.instantiationService.createInstance(PanelActivityAction, this.getPanel(compositeId)), activityAction: this.instantiationService.createInstance(PanelActivityAction, assertIsDefined(this.getPanel(compositeId))),
pinnedAction: new ToggleCompositePinnedAction(this.getPanel(compositeId), this.compositeBar) pinnedAction: new ToggleCompositePinnedAction(this.getPanel(compositeId), this.compositeBar)
}; };
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls'; import { localize } from 'vs/nls';
import * as arrays from 'vs/base/common/arrays'; import { distinct } from 'vs/base/common/arrays';
import * as types from 'vs/base/common/types'; import { withNullAsUndefined, isFunction } from 'vs/base/common/types';
import { Language } from 'vs/base/common/platform'; import { Language } from 'vs/base/common/platform';
import { Action, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; import { Action, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';
import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen';
...@@ -137,7 +137,7 @@ class CommandsHistory extends Disposable { ...@@ -137,7 +137,7 @@ class CommandsHistory extends Disposable {
export class ShowAllCommandsAction extends Action { export class ShowAllCommandsAction extends Action {
static readonly ID = 'workbench.action.showCommands'; static readonly ID = 'workbench.action.showCommands';
static readonly LABEL = nls.localize('showTriggerActions', "Show All Commands"); static readonly LABEL = localize('showTriggerActions', "Show All Commands");
constructor( constructor(
id: string, id: string,
...@@ -167,7 +167,7 @@ export class ShowAllCommandsAction extends Action { ...@@ -167,7 +167,7 @@ export class ShowAllCommandsAction extends Action {
export class ClearCommandHistoryAction extends Action { export class ClearCommandHistoryAction extends Action {
static readonly ID = 'workbench.action.clearCommandHistory'; static readonly ID = 'workbench.action.clearCommandHistory';
static readonly LABEL = nls.localize('clearCommandHistory', "Clear Command History"); static readonly LABEL = localize('clearCommandHistory', "Clear Command History");
constructor( constructor(
id: string, id: string,
...@@ -196,7 +196,7 @@ class CommandPaletteEditorAction extends EditorAction { ...@@ -196,7 +196,7 @@ class CommandPaletteEditorAction extends EditorAction {
constructor() { constructor() {
super({ super({
id: ShowAllCommandsAction.ID, id: ShowAllCommandsAction.ID,
label: nls.localize('showCommands.label', "Command Palette..."), label: localize('showCommands.label', "Command Palette..."),
alias: 'Command Palette', alias: 'Command Palette',
precondition: undefined, precondition: undefined,
menuOpts: { menuOpts: {
...@@ -224,10 +224,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -224,10 +224,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
constructor( constructor(
private commandId: string, private commandId: string,
private keybinding: ResolvedKeybinding, private keybinding: ResolvedKeybinding | undefined,
private label: string, private label: string,
alias: string, alias: string | undefined,
highlights: { label: IHighlight[], alias?: IHighlight[] }, highlights: { label: IHighlight[] | null, alias: IHighlight[] | null },
private onBeforeRun: (commandId: string) => void, private onBeforeRun: (commandId: string) => void,
@INotificationService private readonly notificationService: INotificationService, @INotificationService private readonly notificationService: INotificationService,
@ITelemetryService protected telemetryService: ITelemetryService @ITelemetryService protected telemetryService: ITelemetryService
...@@ -240,10 +240,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -240,10 +240,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
if (this.label !== alias) { if (this.label !== alias) {
this.alias = alias; this.alias = alias;
} else { } else {
highlights.alias = undefined; highlights.alias = null;
} }
this.setHighlights(highlights.label, undefined, highlights.alias); this.setHighlights(withNullAsUndefined(highlights.label), undefined, withNullAsUndefined(highlights.alias));
} }
getCommandId(): string { getCommandId(): string {
...@@ -266,7 +266,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -266,7 +266,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
this.description = description; this.description = description;
} }
getKeybinding(): ResolvedKeybinding { getKeybinding(): ResolvedKeybinding | undefined {
return this.keybinding; return this.keybinding;
} }
...@@ -276,10 +276,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -276,10 +276,10 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
getAriaLabel(): string { getAriaLabel(): string {
if (this.keybindingAriaLabel) { if (this.keybindingAriaLabel) {
return nls.localize('entryAriaLabelWithKey', "{0}, {1}, commands", this.getLabel(), this.keybindingAriaLabel); return localize('entryAriaLabelWithKey', "{0}, {1}, commands", this.getLabel(), this.keybindingAriaLabel);
} }
return nls.localize('entryAriaLabel', "{0}, commands", this.getLabel()); return localize('entryAriaLabel', "{0}, commands", this.getLabel());
} }
run(mode: Mode, context: IEntryRunContext): boolean { run(mode: Mode, context: IEntryRunContext): boolean {
...@@ -319,7 +319,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -319,7 +319,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
this.onError(error); this.onError(error);
} }
} else { } else {
this.notificationService.info(nls.localize('actionNotEnabled', "Command '{0}' is not enabled in the current context.", this.getLabel())); this.notificationService.info(localize('actionNotEnabled', "Command '{0}' is not enabled in the current context.", this.getLabel()));
} }
}, 50); }, 50);
} }
...@@ -329,7 +329,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { ...@@ -329,7 +329,7 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup {
return; return;
} }
this.notificationService.error(error || nls.localize('canNotRun', "Command '{0}' resulted in an error.", this.label)); this.notificationService.error(error || localize('canNotRun', "Command '{0}' resulted in an error.", this.label));
} }
} }
...@@ -337,10 +337,10 @@ class EditorActionCommandEntry extends BaseCommandEntry { ...@@ -337,10 +337,10 @@ class EditorActionCommandEntry extends BaseCommandEntry {
constructor( constructor(
commandId: string, commandId: string,
keybinding: ResolvedKeybinding, keybinding: ResolvedKeybinding | undefined,
label: string, label: string,
meta: string, meta: string | undefined,
highlights: { label: IHighlight[], alias: IHighlight[] }, highlights: { label: IHighlight[] | null, alias: IHighlight[] | null },
private action: IEditorAction, private action: IEditorAction,
onBeforeRun: (commandId: string) => void, onBeforeRun: (commandId: string) => void,
@INotificationService notificationService: INotificationService, @INotificationService notificationService: INotificationService,
...@@ -358,10 +358,10 @@ class ActionCommandEntry extends BaseCommandEntry { ...@@ -358,10 +358,10 @@ class ActionCommandEntry extends BaseCommandEntry {
constructor( constructor(
commandId: string, commandId: string,
keybinding: ResolvedKeybinding, keybinding: ResolvedKeybinding | undefined,
label: string, label: string,
alias: string, alias: string | undefined,
highlights: { label: IHighlight[], alias: IHighlight[] }, highlights: { label: IHighlight[] | null, alias: IHighlight[] | null },
private action: Action, private action: Action,
onBeforeRun: (commandId: string) => void, onBeforeRun: (commandId: string) => void,
@INotificationService notificationService: INotificationService, @INotificationService notificationService: INotificationService,
...@@ -439,7 +439,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -439,7 +439,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
// Editor Actions // Editor Actions
const activeTextEditorWidget = this.editorService.activeTextEditorWidget; const activeTextEditorWidget = this.editorService.activeTextEditorWidget;
let editorActions: IEditorAction[] = []; let editorActions: IEditorAction[] = [];
if (activeTextEditorWidget && types.isFunction(activeTextEditorWidget.getSupportedActions)) { if (activeTextEditorWidget && isFunction(activeTextEditorWidget.getSupportedActions)) {
editorActions = activeTextEditorWidget.getSupportedActions(); editorActions = activeTextEditorWidget.getSupportedActions();
} }
...@@ -456,7 +456,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -456,7 +456,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
let entries = [...editorEntries, ...commandEntries]; let entries = [...editorEntries, ...commandEntries];
// Remove duplicates // Remove duplicates
entries = arrays.distinct(entries, entry => `${entry.getLabel()}${entry.getGroupLabel()}${entry.getCommandId()}`); entries = distinct(entries, entry => `${entry.getLabel()}${entry.getGroupLabel()}${entry.getCommandId()}`);
// Handle label clashes // Handle label clashes
const commandLabels = new Set<string>(); const commandLabels = new Set<string>();
...@@ -494,12 +494,12 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -494,12 +494,12 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
// only if we have recently used commands in the result set // only if we have recently used commands in the result set
const firstEntry = entries[0]; const firstEntry = entries[0];
if (firstEntry && this.commandsHistory.peek(firstEntry.getCommandId())) { if (firstEntry && this.commandsHistory.peek(firstEntry.getCommandId())) {
firstEntry.setGroupLabel(nls.localize('recentlyUsed', "recently used")); firstEntry.setGroupLabel(localize('recentlyUsed', "recently used"));
for (let i = 1; i < entries.length; i++) { for (let i = 1; i < entries.length; i++) {
const entry = entries[i]; const entry = entries[i];
if (!this.commandsHistory.peek(entry.getCommandId())) { if (!this.commandsHistory.peek(entry.getCommandId())) {
entry.setShowBorder(true); entry.setShowBorder(true);
entry.setGroupLabel(nls.localize('morecCommands', "other commands")); entry.setGroupLabel(localize('morecCommands', "other commands"));
break; break;
} }
} }
...@@ -520,7 +520,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -520,7 +520,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
if (label) { if (label) {
// Alias for non default languages // Alias for non default languages
const alias = !Language.isDefaultVariant() ? action.alias : null; const alias = !Language.isDefaultVariant() ? action.alias : undefined;
const labelHighlights = wordFilter(searchValue, label); const labelHighlights = wordFilter(searchValue, label);
const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; const aliasHighlights = alias ? wordFilter(searchValue, alias) : null;
...@@ -547,15 +547,15 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -547,15 +547,15 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
let category, label = title; let category, label = title;
if (action.item.category) { if (action.item.category) {
category = typeof action.item.category === 'string' ? action.item.category : action.item.category.value; category = typeof action.item.category === 'string' ? action.item.category : action.item.category.value;
label = nls.localize('cat.title', "{0}: {1}", category, title); label = localize('cat.title', "{0}: {1}", category, title);
} }
if (label) { if (label) {
const labelHighlights = wordFilter(searchValue, label); const labelHighlights = wordFilter(searchValue, label);
// Add an 'alias' in original language when running in different locale // Add an 'alias' in original language when running in different locale
const aliasTitle = (!Language.isDefaultVariant() && typeof action.item.title !== 'string') ? action.item.title.original : null; const aliasTitle = (!Language.isDefaultVariant() && typeof action.item.title !== 'string') ? action.item.title.original : undefined;
const aliasCategory = (!Language.isDefaultVariant() && category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : null; const aliasCategory = (!Language.isDefaultVariant() && category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
let alias; let alias;
if (aliasTitle && category) { if (aliasTitle && category) {
alias = aliasCategory ? `${aliasCategory}: ${aliasTitle}` : `${category}: ${aliasTitle}`; alias = aliasCategory ? `${aliasCategory}: ${aliasTitle}` : `${category}: ${aliasTitle}`;
...@@ -590,7 +590,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable { ...@@ -590,7 +590,7 @@ export class CommandsHandler extends QuickOpenHandler implements IDisposable {
} }
getEmptyLabel(searchString: string): string { getEmptyLabel(searchString: string): string {
return nls.localize('noCommandsMatching', "No commands matching"); return localize('noCommandsMatching', "No commands matching");
} }
onClose(canceled: boolean): void { onClose(canceled: boolean): void {
......
...@@ -195,7 +195,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { ...@@ -195,7 +195,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup {
return this.deprecated ? { extraClasses: ['deprecated'] } : undefined; return this.deprecated ? { extraClasses: ['deprecated'] } : undefined;
} }
getHighlights(): [IHighlight[], IHighlight[] | undefined, IHighlight[] | undefined] { getHighlights(): [IHighlight[] | undefined, IHighlight[] | undefined, IHighlight[] | undefined] {
return [ return [
this.deprecated ? [] : filters.createMatches(this.score), this.deprecated ? [] : filters.createMatches(this.score),
undefined, undefined,
......
...@@ -10,7 +10,6 @@ import { basename } from 'vs/base/common/resources'; ...@@ -10,7 +10,6 @@ import { basename } from 'vs/base/common/resources';
import { IDisposable, dispose, Disposable, DisposableStore, combinedDisposable } from 'vs/base/common/lifecycle'; import { IDisposable, dispose, Disposable, DisposableStore, combinedDisposable } from 'vs/base/common/lifecycle';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { append, $, toggleClass } from 'vs/base/browser/dom'; import { append, $, toggleClass } from 'vs/base/browser/dom';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListEvent } from 'vs/base/browser/ui/list/list'; import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListEvent } from 'vs/base/browser/ui/list/list';
import { ISCMService, ISCMRepository } from 'vs/workbench/contrib/scm/common/scm'; import { ISCMService, ISCMRepository } from 'vs/workbench/contrib/scm/common/scm';
import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
...@@ -173,7 +172,7 @@ export class MainPanel extends ViewletPanel { ...@@ -173,7 +172,7 @@ export class MainPanel extends ViewletPanel {
static readonly ID = 'scm.mainPanel'; static readonly ID = 'scm.mainPanel';
static readonly TITLE = localize('scm providers', "Source Control Providers"); static readonly TITLE = localize('scm providers', "Source Control Providers");
private list!: List<ISCMRepository>; private list!: WorkbenchList<ISCMRepository>;
constructor( constructor(
protected viewModel: IViewModel, protected viewModel: IViewModel,
......
...@@ -47,7 +47,7 @@ class SymbolEntry extends EditorQuickOpenEntry { ...@@ -47,7 +47,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
this.score = score; this.score = score;
} }
getHighlights(): [IHighlight[] /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] { getHighlights(): [IHighlight[] | undefined /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] {
return [this.isDeprecated() ? [] : filters.createMatches(this.score), undefined, undefined]; return [this.isDeprecated() ? [] : filters.createMatches(this.score), undefined, undefined];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册