提交 c31d6ed4 编写于 作者: I isidor

search: some more renames

上级 5b72618e
...@@ -23,7 +23,7 @@ import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/commo ...@@ -23,7 +23,7 @@ import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/commo
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { VIEW_ID } from 'vs/platform/search/common/search'; import { VIEW_ID } from 'vs/platform/search/common/search';
export function isSearchViewletFocused(viewletService: IViewletService, panelService: IPanelService): boolean { export function isSearchViewFocused(viewletService: IViewletService, panelService: IPanelService): boolean {
let searchView = getSearchView(viewletService, panelService); let searchView = getSearchView(viewletService, panelService);
let activeElement = document.activeElement; let activeElement = document.activeElement;
return searchView && activeElement && DOM.isAncestor(activeElement, searchView.getContainer().getHTMLElement()); return searchView && activeElement && DOM.isAncestor(activeElement, searchView.getContainer().getHTMLElement());
...@@ -83,7 +83,7 @@ export class ShowNextSearchIncludeAction extends Action { ...@@ -83,7 +83,7 @@ export class ShowNextSearchIncludeAction extends Action {
public static readonly ID = 'search.history.showNextIncludePattern'; public static readonly ID = 'search.history.showNextIncludePattern';
public static readonly LABEL = nls.localize('nextSearchIncludePattern', "Show Next Search Include Pattern"); public static readonly LABEL = nls.localize('nextSearchIncludePattern', "Show Next Search Include Pattern");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.PatternIncludesFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.PatternIncludesFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
...@@ -105,7 +105,7 @@ export class ShowPreviousSearchIncludeAction extends Action { ...@@ -105,7 +105,7 @@ export class ShowPreviousSearchIncludeAction extends Action {
public static readonly ID = 'search.history.showPreviousIncludePattern'; public static readonly ID = 'search.history.showPreviousIncludePattern';
public static readonly LABEL = nls.localize('previousSearchIncludePattern', "Show Previous Search Include Pattern"); public static readonly LABEL = nls.localize('previousSearchIncludePattern', "Show Previous Search Include Pattern");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.PatternIncludesFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.PatternIncludesFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
...@@ -127,7 +127,7 @@ export class ShowNextSearchExcludeAction extends Action { ...@@ -127,7 +127,7 @@ export class ShowNextSearchExcludeAction extends Action {
public static readonly ID = 'search.history.showNextExcludePattern'; public static readonly ID = 'search.history.showNextExcludePattern';
public static readonly LABEL = nls.localize('nextSearchExcludePattern', "Show Next Search Exclude Pattern"); public static readonly LABEL = nls.localize('nextSearchExcludePattern', "Show Next Search Exclude Pattern");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.PatternExcludesFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.PatternExcludesFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
...@@ -149,7 +149,7 @@ export class ShowPreviousSearchExcludeAction extends Action { ...@@ -149,7 +149,7 @@ export class ShowPreviousSearchExcludeAction extends Action {
public static readonly ID = 'search.history.showPreviousExcludePattern'; public static readonly ID = 'search.history.showPreviousExcludePattern';
public static readonly LABEL = nls.localize('previousSearchExcludePattern', "Show Previous Search Exclude Pattern"); public static readonly LABEL = nls.localize('previousSearchExcludePattern', "Show Previous Search Exclude Pattern");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.PatternExcludesFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.PatternExcludesFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
...@@ -171,7 +171,7 @@ export class ShowNextSearchTermAction extends Action { ...@@ -171,7 +171,7 @@ export class ShowNextSearchTermAction extends Action {
public static readonly ID = 'search.history.showNext'; public static readonly ID = 'search.history.showNext';
public static readonly LABEL = nls.localize('nextSearchTerm', "Show Next Search Term"); public static readonly LABEL = nls.localize('nextSearchTerm', "Show Next Search Term");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
...@@ -193,7 +193,7 @@ export class ShowPreviousSearchTermAction extends Action { ...@@ -193,7 +193,7 @@ export class ShowPreviousSearchTermAction extends Action {
public static readonly ID = 'search.history.showPrevious'; public static readonly ID = 'search.history.showPrevious';
public static readonly LABEL = nls.localize('previousSearchTerm', "Show Previous Search Term"); public static readonly LABEL = nls.localize('previousSearchTerm', "Show Previous Search Term");
public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey); public static CONTEXT_KEY_EXPRESSION: ContextKeyExpr = ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey);
constructor(id: string, label: string, constructor(id: string, label: string,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'use strict'; 'use strict';
import 'vs/css!./media/searchviewlet'; import 'vs/css!./media/searchview';
import nls = require('vs/nls'); import nls = require('vs/nls');
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { Emitter, debounceEvent } from 'vs/base/common/event'; import { Emitter, debounceEvent } from 'vs/base/common/event';
...@@ -128,7 +128,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { ...@@ -128,7 +128,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
) { ) {
super(VIEW_ID, partService, telemetryService, themeService); super(VIEW_ID, partService, telemetryService, themeService);
this.viewletVisible = Constants.SearchViewletVisibleKey.bindTo(contextKeyService); this.viewletVisible = Constants.SearchViewVisibleKey.bindTo(contextKeyService);
this.inputBoxFocused = Constants.InputBoxFocusedKey.bindTo(this.contextKeyService); this.inputBoxFocused = Constants.InputBoxFocusedKey.bindTo(this.contextKeyService);
this.inputPatternIncludesFocused = Constants.PatternIncludesFocusedKey.bindTo(this.contextKeyService); this.inputPatternIncludesFocused = Constants.PatternIncludesFocusedKey.bindTo(this.contextKeyService);
this.inputPatternExclusionsFocused = Constants.PatternExcludesFocusedKey.bindTo(this.contextKeyService); this.inputPatternExclusionsFocused = Constants.PatternExcludesFocusedKey.bindTo(this.contextKeyService);
......
...@@ -22,7 +22,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; ...@@ -22,7 +22,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import Event, { Emitter } from 'vs/base/common/event'; import Event, { Emitter } from 'vs/base/common/event';
import { Builder } from 'vs/base/browser/builder'; import { Builder } from 'vs/base/browser/builder';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { isSearchViewletFocused, appendKeyBindingLabel } from 'vs/workbench/parts/search/browser/searchActions'; import { isSearchViewFocused, appendKeyBindingLabel } from 'vs/workbench/parts/search/browser/searchActions';
import { HistoryNavigator } from 'vs/base/common/history'; import { HistoryNavigator } from 'vs/base/common/history';
import * as Constants from 'vs/workbench/parts/search/common/constants'; import * as Constants from 'vs/workbench/parts/search/common/constants';
import { attachInputBoxStyler, attachFindInputBoxStyler, attachButtonStyler } from 'vs/platform/theme/common/styler'; import { attachInputBoxStyler, attachFindInputBoxStyler, attachButtonStyler } from 'vs/platform/theme/common/styler';
...@@ -403,10 +403,10 @@ export function registerContributions() { ...@@ -403,10 +403,10 @@ export function registerContributions() {
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: ReplaceAllAction.ID, id: ReplaceAllAction.ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.ReplaceActiveKey, CONTEXT_FIND_WIDGET_NOT_VISIBLE), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.ReplaceActiveKey, CONTEXT_FIND_WIDGET_NOT_VISIBLE),
primary: KeyMod.Alt | KeyMod.CtrlCmd | KeyCode.Enter, primary: KeyMod.Alt | KeyMod.CtrlCmd | KeyCode.Enter,
handler: accessor => { handler: accessor => {
if (isSearchViewletFocused(accessor.get(IViewletService), accessor.get(IPanelService))) { if (isSearchViewFocused(accessor.get(IViewletService), accessor.get(IPanelService))) {
ReplaceAllAction.INSTANCE.run(); ReplaceAllAction.INSTANCE.run();
} }
} }
......
...@@ -20,7 +20,7 @@ export const ToggleCaseSensitiveCommandId = 'toggleSearchCaseSensitive'; ...@@ -20,7 +20,7 @@ export const ToggleCaseSensitiveCommandId = 'toggleSearchCaseSensitive';
export const ToggleWholeWordCommandId = 'toggleSearchWholeWord'; export const ToggleWholeWordCommandId = 'toggleSearchWholeWord';
export const ToggleRegexCommandId = 'toggleSearchRegex'; export const ToggleRegexCommandId = 'toggleSearchRegex';
export const SearchViewletVisibleKey = new RawContextKey<boolean>('searchViewletVisible', true); export const SearchViewVisibleKey = new RawContextKey<boolean>('searchViewletVisible', true);
export const InputBoxFocusedKey = new RawContextKey<boolean>('inputBoxFocus', false); export const InputBoxFocusedKey = new RawContextKey<boolean>('inputBoxFocus', false);
export const SearchInputBoxFocusedKey = new RawContextKey<boolean>('searchInputBoxFocus', false); export const SearchInputBoxFocusedKey = new RawContextKey<boolean>('searchInputBoxFocus', false);
export const ReplaceInputBoxFocusedKey = new RawContextKey<boolean>('replaceInputBoxFocus', false); export const ReplaceInputBoxFocusedKey = new RawContextKey<boolean>('replaceInputBoxFocus', false);
......
...@@ -158,7 +158,7 @@ export class QueryBuilder { ...@@ -158,7 +158,7 @@ export class QueryBuilder {
} }
/** /**
* Takes the input from the excludePattern as seen in the searchViewlet. Runs the same algorithm as parseSearchPaths, * Takes the input from the excludePattern as seen in the searchView. Runs the same algorithm as parseSearchPaths,
* but the result is a single IExpression that encapsulates all the exclude patterns. * but the result is a single IExpression that encapsulates all the exclude patterns.
*/ */
public parseExcludePattern(pattern: string): glob.IExpression | undefined { public parseExcludePattern(pattern: string): glob.IExpression | undefined {
......
...@@ -66,7 +66,7 @@ searchWidgetContributions(); ...@@ -66,7 +66,7 @@ searchWidgetContributions();
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'workbench.action.search.toggleQueryDetails', id: 'workbench.action.search.toggleQueryDetails',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: Constants.SearchViewletVisibleKey, when: Constants.SearchViewVisibleKey,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_J, primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_J,
handler: accessor => { handler: accessor => {
openSearchView(accessor.get(IViewletService), accessor.get(IPanelService), true) openSearchView(accessor.get(IViewletService), accessor.get(IPanelService), true)
...@@ -77,7 +77,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -77,7 +77,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.FocusSearchFromResults, id: Constants.FocusSearchFromResults,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.FirstMatchFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.FirstMatchFocusKey),
primary: KeyCode.UpArrow, primary: KeyCode.UpArrow,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService)); const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService));
...@@ -88,7 +88,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -88,7 +88,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.OpenMatchToSide, id: Constants.OpenMatchToSide,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.FileMatchOrMatchFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.FileMatchOrMatchFocusKey),
primary: KeyMod.CtrlCmd | KeyCode.Enter, primary: KeyMod.CtrlCmd | KeyCode.Enter,
mac: { mac: {
primary: KeyMod.WinCtrl | KeyCode.Enter primary: KeyMod.WinCtrl | KeyCode.Enter
...@@ -103,7 +103,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -103,7 +103,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.CancelActionId, id: Constants.CancelActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, WorkbenchListFocusContextKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, WorkbenchListFocusContextKey),
primary: KeyCode.Escape, primary: KeyCode.Escape,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService)); const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService));
...@@ -114,7 +114,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -114,7 +114,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.RemoveActionId, id: Constants.RemoveActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.FileMatchOrMatchFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.FileMatchOrMatchFocusKey),
primary: KeyCode.Delete, primary: KeyCode.Delete,
mac: { mac: {
primary: KeyMod.CtrlCmd | KeyCode.Backspace, primary: KeyMod.CtrlCmd | KeyCode.Backspace,
...@@ -129,7 +129,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -129,7 +129,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.ReplaceActionId, id: Constants.ReplaceActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.ReplaceActiveKey, Constants.MatchFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.ReplaceActiveKey, Constants.MatchFocusKey),
primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.KEY_1, primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.KEY_1,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService)); const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService));
...@@ -141,7 +141,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -141,7 +141,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.ReplaceAllInFileActionId, id: Constants.ReplaceAllInFileActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.ReplaceActiveKey, Constants.FileFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.ReplaceActiveKey, Constants.FileFocusKey),
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter, primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService)); const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService));
...@@ -153,7 +153,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -153,7 +153,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.ReplaceAllInFolderActionId, id: Constants.ReplaceAllInFolderActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.ReplaceActiveKey, Constants.FolderFocusKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.ReplaceActiveKey, Constants.FolderFocusKey),
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter, primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService)); const searchView = getSearchView(accessor.get(IViewletService), accessor.get(IPanelService));
...@@ -165,7 +165,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -165,7 +165,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.CloseReplaceWidgetActionId, id: Constants.CloseReplaceWidgetActionId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.ReplaceInputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.ReplaceInputBoxFocusedKey),
primary: KeyCode.Escape, primary: KeyCode.Escape,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
accessor.get(IInstantiationService).createInstance(CloseReplaceAction, Constants.CloseReplaceWidgetActionId, '').run(); accessor.get(IInstantiationService).createInstance(CloseReplaceAction, Constants.CloseReplaceWidgetActionId, '').run();
...@@ -175,7 +175,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -175,7 +175,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: FocusNextInputAction.ID, id: FocusNextInputAction.ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.InputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.InputBoxFocusedKey),
primary: KeyCode.DownArrow, primary: KeyCode.DownArrow,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
accessor.get(IInstantiationService).createInstance(FocusNextInputAction, FocusNextInputAction.ID, '').run(); accessor.get(IInstantiationService).createInstance(FocusNextInputAction, FocusNextInputAction.ID, '').run();
...@@ -185,7 +185,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ ...@@ -185,7 +185,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: FocusPreviousInputAction.ID, id: FocusPreviousInputAction.ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.InputBoxFocusedKey, Constants.SearchInputBoxFocusedKey.toNegated()), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.InputBoxFocusedKey, Constants.SearchInputBoxFocusedKey.toNegated()),
primary: KeyCode.UpArrow, primary: KeyCode.UpArrow,
handler: (accessor, args: any) => { handler: (accessor, args: any) => {
accessor.get(IInstantiationService).createInstance(FocusPreviousInputAction, FocusPreviousInputAction.ID, '').run(); accessor.get(IInstantiationService).createInstance(FocusPreviousInputAction, FocusPreviousInputAction.ID, '').run();
...@@ -307,15 +307,15 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi ...@@ -307,15 +307,15 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions); const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
const category = nls.localize('search', "Search"); const category = nls.localize('search', "Search");
registry.registerWorkbenchAction(new SyncActionDescriptor(FindInFilesAction, VIEW_ID, nls.localize('showSearchViewlet', "Show Search"), { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F }, registry.registerWorkbenchAction(new SyncActionDescriptor(FindInFilesAction, VIEW_ID, nls.localize('showSearchViewl', "Show Search"), { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F },
Constants.SearchViewletVisibleKey.toNegated()), 'View: Show Search', nls.localize('view', "View")); Constants.SearchViewVisibleKey.toNegated()), 'View: Show Search', nls.localize('view', "View"));
registry.registerWorkbenchAction(new SyncActionDescriptor(FindInFilesAction, Constants.FindInFilesActionId, nls.localize('findInFiles', "Find in Files"), { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F }, registry.registerWorkbenchAction(new SyncActionDescriptor(FindInFilesAction, Constants.FindInFilesActionId, nls.localize('findInFiles', "Find in Files"), { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F },
Constants.SearchInputBoxFocusedKey.toNegated()), 'Find in Files', category); Constants.SearchInputBoxFocusedKey.toNegated()), 'Find in Files', category);
KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.FocusActiveEditorCommandId, id: Constants.FocusActiveEditorCommandId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey),
handler: FocusActiveEditorCommand, handler: FocusActiveEditorCommand,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F
}); });
...@@ -328,21 +328,21 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ReplaceInFilesAction, ...@@ -328,21 +328,21 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ReplaceInFilesAction,
KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({ KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({
id: Constants.ToggleCaseSensitiveCommandId, id: Constants.ToggleCaseSensitiveCommandId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey),
handler: toggleCaseSensitiveCommand handler: toggleCaseSensitiveCommand
}, ToggleCaseSensitiveKeybinding)); }, ToggleCaseSensitiveKeybinding));
KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({ KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({
id: Constants.ToggleWholeWordCommandId, id: Constants.ToggleWholeWordCommandId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey),
handler: toggleWholeWordCommand handler: toggleWholeWordCommand
}, ToggleWholeWordKeybinding)); }, ToggleWholeWordKeybinding));
KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({ KeybindingsRegistry.registerCommandAndKeybindingRule(objects.assign({
id: Constants.ToggleRegexCommandId, id: Constants.ToggleRegexCommandId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.SearchViewletVisibleKey, Constants.SearchInputBoxFocusedKey), when: ContextKeyExpr.and(Constants.SearchViewVisibleKey, Constants.SearchInputBoxFocusedKey),
handler: toggleRegexCommand handler: toggleRegexCommand
}, ToggleRegexKeybinding)); }, ToggleRegexKeybinding));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册