Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bdbf134d
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bdbf134d
编写于
6月 07, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #12645
上级
eb45d355
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
115 addition
and
97 deletion
+115
-97
src/vs/base/browser/ui/findinput/findInput.ts
src/vs/base/browser/ui/findinput/findInput.ts
+10
-0
src/vs/platform/widget/browser/widget.contribution.ts
src/vs/platform/widget/browser/widget.contribution.ts
+3
-3
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+0
-36
src/vs/workbench/parts/search/browser/searchView.ts
src/vs/workbench/parts/search/browser/searchView.ts
+19
-3
src/vs/workbench/parts/search/browser/searchWidget.ts
src/vs/workbench/parts/search/browser/searchWidget.ts
+82
-34
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
...ench/parts/search/electron-browser/search.contribution.ts
+1
-21
未找到文件。
src/vs/base/browser/ui/findinput/findInput.ts
浏览文件 @
bdbf134d
...
...
@@ -83,6 +83,9 @@ export class FindInput extends Widget {
private
_onCaseSensitiveKeyDown
=
this
.
_register
(
new
Emitter
<
IKeyboardEvent
>
());
public
readonly
onCaseSensitiveKeyDown
:
Event
<
IKeyboardEvent
>
=
this
.
_onCaseSensitiveKeyDown
.
event
;
private
_onRegexKeyDown
=
this
.
_register
(
new
Emitter
<
IKeyboardEvent
>
());
public
readonly
onRegexKeyDown
:
Event
<
IKeyboardEvent
>
=
this
.
_onRegexKeyDown
.
event
;
constructor
(
parent
:
HTMLElement
,
contextViewProvider
:
IContextViewProvider
,
options
?:
IFindInputOptions
)
{
super
();
this
.
contextViewProvider
=
contextViewProvider
;
...
...
@@ -248,6 +251,10 @@ export class FindInput extends Widget {
this
.
caseSensitive
.
focus
();
}
public
focusOnRegex
():
void
{
this
.
regex
.
focus
();
}
private
_lastHighlightFindOptions
:
number
=
0
;
public
highlightFindOptions
():
void
{
dom
.
removeClass
(
this
.
domNode
,
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
...
...
@@ -294,6 +301,9 @@ export class FindInput extends Widget {
this
.
setInputWidth
();
this
.
validate
();
},
onKeyDown
:
(
e
)
=>
{
this
.
_onRegexKeyDown
.
fire
(
e
);
},
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
}));
this
.
wholeWords
=
this
.
_register
(
new
WholeWordsCheckbox
({
...
...
src/vs/platform/widget/browser/widget.contribution.ts
浏览文件 @
bdbf134d
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
ContextKeyDefinedExpr
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
HistoryInputBoxContext
}
from
'
vs/platform/widget/browser/input
'
;
import
{
HistoryInputBox
}
from
'
vs/base/browser/ui/inputbox/inputbox
'
;
...
...
@@ -14,7 +14,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
id
:
'
input.action.historyPrevious
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
new
ContextKeyDefinedExpr
(
HistoryInputBoxContext
),
primary
:
Key
Mod
.
Alt
|
Key
Code
.
UpArrow
,
primary
:
KeyCode
.
UpArrow
,
handler
:
(
accessor
,
arg2
)
=>
{
const
historyInputBox
:
HistoryInputBox
=
accessor
.
get
(
IContextKeyService
).
getContext
(
document
.
activeElement
).
getValue
(
HistoryInputBoxContext
);
historyInputBox
.
showPreviousValue
();
...
...
@@ -25,7 +25,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
id
:
'
input.action.historyNext
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
new
ContextKeyDefinedExpr
(
HistoryInputBoxContext
),
primary
:
Key
Mod
.
Alt
|
Key
Code
.
DownArrow
,
primary
:
KeyCode
.
DownArrow
,
handler
:
(
accessor
,
arg2
)
=>
{
const
historyInputBox
:
HistoryInputBox
=
accessor
.
get
(
IContextKeyService
).
getContext
(
document
.
activeElement
).
getValue
(
HistoryInputBoxContext
);
historyInputBox
.
showNextValue
();
...
...
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
bdbf134d
...
...
@@ -251,42 +251,6 @@ export class ShowPreviousReplaceTermAction extends Action {
}
}
export
class
FocusNextInputAction
extends
Action
{
public
static
readonly
ID
=
'
search.focus.nextInputBox
'
;
constructor
(
id
:
string
,
label
:
string
,
@
IViewletService
private
viewletService
:
IViewletService
,
@
IPanelService
private
panelService
:
IPanelService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
searchView
.
focusNextInputBox
();
return
TPromise
.
as
(
null
);
}
}
export
class
FocusPreviousInputAction
extends
Action
{
public
static
readonly
ID
=
'
search.focus.previousInputBox
'
;
constructor
(
id
:
string
,
label
:
string
,
@
IViewletService
private
viewletService
:
IViewletService
,
@
IPanelService
private
panelService
:
IPanelService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
searchView
.
focusPreviousInputBox
();
return
TPromise
.
as
(
null
);
}
}
export
const
FocusActiveEditorCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
const
editorService
=
accessor
.
get
(
IEditorService
);
const
activeControl
=
editorService
.
activeControl
;
...
...
src/vs/workbench/parts/search/browser/searchView.ts
浏览文件 @
bdbf134d
...
...
@@ -15,7 +15,7 @@ import { IAction } from 'vs/base/common/actions';
import
{
Delayer
}
from
'
vs/base/common/async
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
debounceEvent
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
*
as
env
from
'
vs/base/common/platform
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
...
...
@@ -98,6 +98,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
private
searchWidget
:
SearchWidget
;
private
size
:
dom
.
Dimension
;
private
queryDetails
:
HTMLElement
;
private
toggleQueryDetailsButton
:
HTMLElement
;
private
inputPatternExcludes
:
ExcludePatternInputWidget
;
private
inputPatternIncludes
:
PatternInputWidget
;
private
results
:
Builder
;
...
...
@@ -222,7 +223,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
}
this
.
queryDetails
=
this
.
searchWidgetsContainer
.
div
({
'
class
'
:
[
'
query-details
'
]
},
(
builder
)
=>
{
builder
.
div
({
'
class
'
:
'
more
'
,
'
tabindex
'
:
0
,
'
role
'
:
'
button
'
,
'
title
'
:
nls
.
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
})
this
.
toggleQueryDetailsButton
=
builder
.
div
({
'
class
'
:
'
more
'
,
'
tabindex
'
:
0
,
'
role
'
:
'
button
'
,
'
title
'
:
nls
.
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
})
.
on
(
dom
.
EventType
.
CLICK
,
(
e
)
=>
{
dom
.
EventHelper
.
stop
(
e
);
this
.
toggleQueryDetails
();
...
...
@@ -233,7 +234,18 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
dom
.
EventHelper
.
stop
(
e
);
this
.
toggleQueryDetails
(
false
);
}
});
}).
on
(
dom
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
{
let
event
=
new
StandardKeyboardEvent
(
e
);
if
(
event
.
equals
(
KeyMod
.
Shift
|
KeyCode
.
Tab
))
{
if
(
this
.
searchWidget
.
isReplaceActive
())
{
this
.
searchWidget
.
focusReplaceAllAction
();
}
else
{
this
.
searchWidget
.
focusRegexAction
();
}
dom
.
EventHelper
.
stop
(
e
);
}
}).
getHTMLElement
();
//folder includes list
builder
.
div
({
'
class
'
:
'
file-types includes
'
},
(
builder
)
=>
{
...
...
@@ -360,6 +372,10 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
delayedRefresh
.
trigger
(()
=>
this
.
tree
.
refresh
());
}));
this
.
toUnbind
.
push
(
this
.
searchWidget
.
onBlur
(()
=>
{
this
.
toggleQueryDetailsButton
.
focus
();
}));
this
.
toUnbind
.
push
(
this
.
searchWidget
.
onReplaceAll
(()
=>
this
.
replaceAll
()));
this
.
trackInputBox
(
this
.
searchWidget
.
searchInputFocusTracker
);
this
.
trackInputBox
(
this
.
searchWidget
.
replaceInputFocusTracker
);
...
...
src/vs/workbench/parts/search/browser/searchWidget.ts
浏览文件 @
bdbf134d
...
...
@@ -116,20 +116,23 @@ export class SearchWidget extends Widget {
private
_onReplaceAll
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onReplaceAll
:
Event
<
void
>
=
this
.
_onReplaceAll
.
event
;
private
_onBlur
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onBlur
:
Event
<
void
>
=
this
.
_onBlur
.
event
;
constructor
(
container
:
Builder
,
options
:
ISearchWidgetOptions
,
@
IContextViewService
private
contextViewService
:
IContextViewService
,
@
IThemeService
private
themeService
:
IThemeService
,
@
IContextKeyService
private
keyBinding
Service
:
IContextKeyService
,
@
IKeybindingService
private
keyBindingService
2
:
IKeybindingService
,
@
IContextKeyService
private
contextKey
Service
:
IContextKeyService
,
@
IKeybindingService
private
keyBindingService
:
IKeybindingService
,
@
IClipboardService
private
clipboardServce
:
IClipboardService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
super
();
this
.
replaceActive
=
Constants
.
ReplaceActiveKey
.
bindTo
(
this
.
keyBinding
Service
);
this
.
searchInputBoxFocused
=
Constants
.
SearchInputBoxFocusedKey
.
bindTo
(
this
.
keyBinding
Service
);
this
.
replaceInputBoxFocused
=
Constants
.
ReplaceInputBoxFocusedKey
.
bindTo
(
this
.
keyBinding
Service
);
this
.
replaceActive
=
Constants
.
ReplaceActiveKey
.
bindTo
(
this
.
contextKey
Service
);
this
.
searchInputBoxFocused
=
Constants
.
SearchInputBoxFocusedKey
.
bindTo
(
this
.
contextKey
Service
);
this
.
replaceInputBoxFocused
=
Constants
.
ReplaceInputBoxFocusedKey
.
bindTo
(
this
.
contextKey
Service
);
this
.
render
(
container
,
options
);
}
...
...
@@ -164,6 +167,10 @@ export class SearchWidget extends Widget {
return
!
dom
.
hasClass
(
this
.
replaceContainer
,
'
disabled
'
);
}
isReplaceActive
():
boolean
{
return
this
.
replaceActive
.
get
();
}
public
getReplaceValue
():
string
{
return
this
.
replaceInput
.
value
;
}
...
...
@@ -210,6 +217,14 @@ export class SearchWidget extends Widget {
return
this
.
replaceInput
.
hasFocus
();
}
public
focusReplaceAllAction
():
void
{
this
.
replaceActionBar
.
focus
(
true
);
}
public
focusRegexAction
():
void
{
this
.
searchInput
.
focusOnRegex
();
}
private
render
(
container
:
Builder
,
options
:
ISearchWidgetOptions
):
void
{
this
.
domNode
=
container
.
div
({
'
class
'
:
'
search-widget
'
}).
style
({
position
:
'
relative
'
}).
getHTMLElement
();
this
.
renderToggleReplaceButton
(
this
.
domNode
);
...
...
@@ -237,16 +252,16 @@ export class SearchWidget extends Widget {
label
:
nls
.
localize
(
'
label.Search
'
,
'
Search: Type Search Term and press Enter to search or Escape to cancel
'
),
validation
:
(
value
:
string
)
=>
this
.
validateSearchInput
(
value
),
placeholder
:
nls
.
localize
(
'
search.placeHolder
'
,
"
Search
"
),
appendCaseSensitiveLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
2
.
lookupKeybinding
(
Constants
.
ToggleCaseSensitiveCommandId
),
this
.
keyBindingService2
),
appendWholeWordsLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
2
.
lookupKeybinding
(
Constants
.
ToggleWholeWordCommandId
),
this
.
keyBindingService2
),
appendRegexLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
2
.
lookupKeybinding
(
Constants
.
ToggleRegexCommandId
),
this
.
keyBindingService2
),
appendCaseSensitiveLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
.
lookupKeybinding
(
Constants
.
ToggleCaseSensitiveCommandId
),
this
.
keyBindingService
),
appendWholeWordsLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
.
lookupKeybinding
(
Constants
.
ToggleWholeWordCommandId
),
this
.
keyBindingService
),
appendRegexLabel
:
appendKeyBindingLabel
(
''
,
this
.
keyBindingService
.
lookupKeybinding
(
Constants
.
ToggleRegexCommandId
),
this
.
keyBindingService
),
history
:
options
.
searchHistory
};
let
searchInputContainer
=
dom
.
append
(
parent
,
dom
.
$
(
'
.search-container.input-box
'
));
this
.
searchInput
=
this
.
_register
(
new
ContextScopedFindInput
(
searchInputContainer
,
this
.
contextViewService
,
inputOptions
,
this
.
keyBinding
Service
));
this
.
searchInput
=
this
.
_register
(
new
ContextScopedFindInput
(
searchInputContainer
,
this
.
contextViewService
,
inputOptions
,
this
.
contextKey
Service
));
this
.
_register
(
attachFindInputBoxStyler
(
this
.
searchInput
,
this
.
themeService
));
this
.
searchInput
.
onKey
Up
((
keyboardEvent
:
IKeyboardEvent
)
=>
this
.
onSearchInputKeyUp
(
keyboardEvent
));
this
.
searchInput
.
onKey
Down
((
keyboardEvent
:
IKeyboardEvent
)
=>
this
.
onSearchInputKeyDown
(
keyboardEvent
));
this
.
searchInput
.
setValue
(
options
.
value
||
''
);
this
.
searchInput
.
setRegex
(
!!
options
.
isRegex
);
this
.
searchInput
.
setCaseSensitive
(
!!
options
.
isCaseSensitive
);
...
...
@@ -254,6 +269,8 @@ export class SearchWidget extends Widget {
this
.
_register
(
this
.
onSearchSubmit
(()
=>
{
this
.
searchInput
.
inputBox
.
addToHistory
(
this
.
searchInput
.
getValue
());
}));
this
.
searchInput
.
onCaseSensitiveKeyDown
((
keyboardEvent
:
IKeyboardEvent
)
=>
this
.
onCaseSensitiveKeyDown
(
keyboardEvent
));
this
.
searchInput
.
onRegexKeyDown
((
keyboardEvent
:
IKeyboardEvent
)
=>
this
.
onRegexKeyDown
(
keyboardEvent
));
this
.
_register
(
this
.
onReplaceValueChanged
(()
=>
{
this
.
replaceInput
.
addToHistory
(
this
.
replaceInput
.
value
);
...
...
@@ -287,9 +304,9 @@ export class SearchWidget extends Widget {
ariaLabel
:
nls
.
localize
(
'
label.Replace
'
,
'
Replace: Type replace term and press Enter to preview or Escape to cancel
'
),
placeholder
:
nls
.
localize
(
'
search.replace.placeHolder
'
,
"
Replace
"
),
history
:
options
.
replaceHistory
||
[]
},
this
.
keyBinding
Service
));
},
this
.
contextKey
Service
));
this
.
_register
(
attachInputBoxStyler
(
this
.
replaceInput
,
this
.
themeService
));
this
.
onkey
up
(
this
.
replaceInput
.
inputElement
,
(
keyboardEvent
)
=>
this
.
onReplaceInputKeyUp
(
keyboardEvent
));
this
.
onkey
down
(
this
.
replaceInput
.
inputElement
,
(
keyboardEvent
)
=>
this
.
onReplaceInputKeyDown
(
keyboardEvent
));
this
.
replaceInput
.
onDidChange
(()
=>
this
.
_onReplaceValueChanged
.
fire
());
this
.
searchInput
.
inputBox
.
onDidChange
(()
=>
this
.
onSearchInputChanged
());
...
...
@@ -320,15 +337,11 @@ export class SearchWidget extends Widget {
public
setReplaceAllActionState
(
enabled
:
boolean
):
void
{
if
(
this
.
replaceAllAction
.
enabled
!==
enabled
)
{
this
.
replaceAllAction
.
enabled
=
enabled
;
this
.
replaceAllAction
.
label
=
enabled
?
SearchWidget
.
REPLACE_ALL_ENABLED_LABEL
(
this
.
keyBindingService
2
)
:
SearchWidget
.
REPLACE_ALL_DISABLED_LABEL
;
this
.
replaceAllAction
.
label
=
enabled
?
SearchWidget
.
REPLACE_ALL_ENABLED_LABEL
(
this
.
keyBindingService
)
:
SearchWidget
.
REPLACE_ALL_DISABLED_LABEL
;
this
.
updateReplaceActiveState
();
}
}
private
isReplaceActive
():
boolean
{
return
this
.
replaceActive
.
get
();
}
private
updateReplaceActiveState
():
void
{
let
currentState
=
this
.
isReplaceActive
();
let
newState
=
this
.
isReplaceShown
()
&&
this
.
replaceAllAction
.
enabled
;
...
...
@@ -366,26 +379,61 @@ export class SearchWidget extends Widget {
this
.
setReplaceAllActionState
(
false
);
}
private
onSearchInputKeyUp
(
keyboardEvent
:
IKeyboardEvent
)
{
switch
(
keyboardEvent
.
keyCode
)
{
case
KeyCode
.
Enter
:
this
.
submitSearch
();
return
;
case
KeyCode
.
Escape
:
this
.
_onSearchCancel
.
fire
();
return
;
default
:
return
;
private
onSearchInputKeyDown
(
keyboardEvent
:
IKeyboardEvent
)
{
if
(
keyboardEvent
.
equals
(
KeyCode
.
Enter
))
{
this
.
submitSearch
();
keyboardEvent
.
preventDefault
();
}
else
if
(
keyboardEvent
.
equals
(
KeyCode
.
Escape
))
{
this
.
_onSearchCancel
.
fire
();
keyboardEvent
.
preventDefault
();
}
else
if
(
keyboardEvent
.
equals
(
KeyCode
.
Tab
))
{
if
(
this
.
isReplaceShown
())
{
this
.
replaceInput
.
focus
();
}
else
{
this
.
searchInput
.
focusOnCaseSensitive
();
}
keyboardEvent
.
preventDefault
();
}
}
private
onCaseSensitiveKeyDown
(
keyboardEvent
:
IKeyboardEvent
)
{
if
(
keyboardEvent
.
equals
(
KeyMod
.
Shift
|
KeyCode
.
Tab
))
{
if
(
this
.
isReplaceShown
())
{
this
.
replaceInput
.
focus
();
keyboardEvent
.
preventDefault
();
}
}
}
private
onRegexKeyDown
(
keyboardEvent
:
IKeyboardEvent
)
{
if
(
keyboardEvent
.
equals
(
KeyCode
.
Tab
))
{
if
(
this
.
isReplaceActive
())
{
this
.
focusReplaceAllAction
();
}
else
{
this
.
_onBlur
.
fire
();
}
keyboardEvent
.
preventDefault
();
}
}
private
onReplaceInputKeyUp
(
keyboardEvent
:
IKeyboardEvent
)
{
switch
(
keyboardEvent
.
keyCode
)
{
case
KeyCode
.
Enter
:
this
.
submitSearch
();
return
;
default
:
return
;
private
onReplaceInputKeyDown
(
keyboardEvent
:
IKeyboardEvent
)
{
if
(
keyboardEvent
.
equals
(
KeyCode
.
Enter
))
{
this
.
submitSearch
();
keyboardEvent
.
preventDefault
();
}
else
if
(
keyboardEvent
.
equals
(
KeyCode
.
Tab
))
{
this
.
searchInput
.
focusOnCaseSensitive
();
keyboardEvent
.
preventDefault
();
}
else
if
(
keyboardEvent
.
equals
(
KeyMod
.
Shift
|
KeyCode
.
Tab
))
{
this
.
searchInput
.
focus
();
keyboardEvent
.
preventDefault
();
}
}
...
...
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
浏览文件 @
bdbf134d
...
...
@@ -52,7 +52,7 @@ import { getMultiSelectedResources } from 'vs/workbench/parts/files/browser/file
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
PanelRegistry
,
Extensions
as
PanelExtensions
,
PanelDescriptor
}
from
'
vs/workbench/browser/panel
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
openSearchView
,
getSearchView
,
ReplaceAllInFolderAction
,
ReplaceAllAction
,
CloseReplaceAction
,
FocusNext
InputAction
,
FocusPreviousInputAction
,
FocusNext
SearchResultAction
,
FocusPreviousSearchResultAction
,
ReplaceInFilesAction
,
FindInFilesAction
,
FocusActiveEditorCommand
,
toggleCaseSensitiveCommand
,
ShowNextSearchTermAction
,
ShowPreviousSearchTermAction
,
toggleRegexCommand
,
ShowPreviousSearchIncludeAction
,
ShowNextSearchIncludeAction
,
CollapseDeepestExpandedLevelAction
,
toggleWholeWordCommand
,
RemoveAction
,
ReplaceAction
,
ClearSearchResultsAction
,
copyPathCommand
,
copyMatchCommand
,
copyAllCommand
,
ShowNextSearchExcludeAction
,
ShowPreviousSearchExcludeAction
,
clearHistoryCommand
,
ShowNextReplaceTermAction
,
ShowPreviousReplaceTermAction
}
from
'
vs/workbench/parts/search/browser/searchActions
'
;
import
{
openSearchView
,
getSearchView
,
ReplaceAllInFolderAction
,
ReplaceAllAction
,
CloseReplaceAction
,
FocusNextSearchResultAction
,
FocusPreviousSearchResultAction
,
ReplaceInFilesAction
,
FindInFilesAction
,
FocusActiveEditorCommand
,
toggleCaseSensitiveCommand
,
ShowNextSearchTermAction
,
ShowPreviousSearchTermAction
,
toggleRegexCommand
,
ShowPreviousSearchIncludeAction
,
ShowNextSearchIncludeAction
,
CollapseDeepestExpandedLevelAction
,
toggleWholeWordCommand
,
RemoveAction
,
ReplaceAction
,
ClearSearchResultsAction
,
copyPathCommand
,
copyMatchCommand
,
copyAllCommand
,
ShowNextSearchExcludeAction
,
ShowPreviousSearchExcludeAction
,
clearHistoryCommand
,
ShowNextReplaceTermAction
,
ShowPreviousReplaceTermAction
}
from
'
vs/workbench/parts/search/browser/searchActions
'
;
import
{
VIEW_ID
,
ISearchConfigurationProperties
}
from
'
vs/platform/search/common/search
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
...
...
@@ -179,26 +179,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
FocusNextInputAction
.
ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
ContextKeyExpr
.
and
(
Constants
.
SearchViewVisibleKey
,
Constants
.
InputBoxFocusedKey
),
primary
:
KeyCode
.
DownArrow
,
handler
:
(
accessor
,
args
:
any
)
=>
{
accessor
.
get
(
IInstantiationService
).
createInstance
(
FocusNextInputAction
,
FocusNextInputAction
.
ID
,
''
).
run
();
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
FocusPreviousInputAction
.
ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
ContextKeyExpr
.
and
(
Constants
.
SearchViewVisibleKey
,
Constants
.
InputBoxFocusedKey
,
Constants
.
SearchInputBoxFocusedKey
.
toNegated
()),
primary
:
KeyCode
.
UpArrow
,
handler
:
(
accessor
,
args
:
any
)
=>
{
accessor
.
get
(
IInstantiationService
).
createInstance
(
FocusPreviousInputAction
,
FocusPreviousInputAction
.
ID
,
''
).
run
();
}
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
SearchContext
,
{
command
:
{
id
:
Constants
.
ReplaceActionId
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录