Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b3e6d5bb
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,发现更多精彩内容 >>
提交
b3e6d5bb
编写于
11月 11, 2017
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add 'folderMatchFocus' context key and keybinding for "replace all in folder" action - #31260
上级
6ceefbe5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
20 addition
and
3 deletion
+20
-3
src/vs/workbench/parts/search/browser/search.contribution.ts
src/vs/workbench/parts/search/browser/search.contribution.ts
+12
-0
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+1
-2
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+5
-1
src/vs/workbench/parts/search/common/constants.ts
src/vs/workbench/parts/search/common/constants.ts
+2
-0
未找到文件。
src/vs/workbench/parts/search/browser/search.contribution.ts
浏览文件 @
b3e6d5bb
...
...
@@ -141,6 +141,18 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
Constants
.
ReplaceAllInFolderActionId
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
ContextKeyExpr
.
and
(
Constants
.
SearchViewletVisibleKey
,
Constants
.
ReplaceActiveKey
,
Constants
.
FolderFocusKey
),
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
Enter
,
handler
:
(
accessor
,
args
:
any
)
=>
{
const
searchViewlet
:
SearchViewlet
=
<
SearchViewlet
>
accessor
.
get
(
IViewletService
).
getActiveViewlet
();
const
tree
:
ITree
=
searchViewlet
.
getControl
();
accessor
.
get
(
IInstantiationService
).
createInstance
(
searchActions
.
ReplaceAllInFolderAction
,
tree
,
tree
.
getFocus
()).
run
();
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
Constants
.
CloseReplaceWidgetActionId
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
...
...
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
b3e6d5bb
...
...
@@ -10,7 +10,6 @@ import resources = require('vs/base/common/resources');
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
ToggleViewletAction
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
INavigator
}
from
'
vs/base/common/iterator
'
;
...
...
@@ -586,7 +585,7 @@ export class ReplaceAllInFolderAction extends AbstractSearchAndReplaceAction {
@
IKeybindingService
keyBindingService
:
IKeybindingService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
)
{
super
(
Constants
.
ReplaceAllInF
ile
ActionId
,
nls
.
localize
(
'
file.replaceAll.label
'
,
"
Replace All
"
),
'
action-replace-all
'
);
super
(
Constants
.
ReplaceAllInF
older
ActionId
,
nls
.
localize
(
'
file.replaceAll.label
'
,
"
Replace All
"
),
'
action-replace-all
'
);
}
public
async
run
():
TPromise
<
any
>
{
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
b3e6d5bb
...
...
@@ -28,7 +28,7 @@ import { IPreferencesService } from 'vs/workbench/parts/preferences/common/prefe
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
FileChangeType
,
FileChangesEvent
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
Viewlet
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
Match
,
FileMatch
,
SearchModel
,
FileMatchOrMatch
,
IChangeEvent
,
ISearchWorkbenchService
}
from
'
vs/workbench/parts/search/common/searchModel
'
;
import
{
Match
,
FileMatch
,
SearchModel
,
FileMatchOrMatch
,
IChangeEvent
,
ISearchWorkbenchService
,
FolderMatch
}
from
'
vs/workbench/parts/search/common/searchModel
'
;
import
{
QueryBuilder
}
from
'
vs/workbench/parts/search/common/queryBuilder
'
;
import
{
MessageType
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
ISearchProgressItem
,
ISearchComplete
,
ISearchQuery
,
IQueryOptions
,
ISearchConfiguration
}
from
'
vs/platform/search/common/search
'
;
...
...
@@ -80,6 +80,7 @@ export class SearchViewlet extends Viewlet {
private
firstMatchFocused
:
IContextKey
<
boolean
>
;
private
fileMatchOrMatchFocused
:
IContextKey
<
boolean
>
;
private
fileMatchFocused
:
IContextKey
<
boolean
>
;
private
folderMatchFocused
:
IContextKey
<
boolean
>
;
private
matchFocused
:
IContextKey
<
boolean
>
;
private
actionRegistry
:
{
[
key
:
string
]:
Action
;
};
...
...
@@ -132,6 +133,7 @@ export class SearchViewlet extends Viewlet {
this
.
firstMatchFocused
=
Constants
.
FirstMatchFocusKey
.
bindTo
(
contextKeyService
);
this
.
fileMatchOrMatchFocused
=
Constants
.
FileMatchOrMatchFocusKey
.
bindTo
(
contextKeyService
);
this
.
fileMatchFocused
=
Constants
.
FileFocusKey
.
bindTo
(
contextKeyService
);
this
.
folderMatchFocused
=
Constants
.
FolderFocusKey
.
bindTo
(
contextKeyService
);
this
.
matchFocused
=
Constants
.
MatchFocusKey
.
bindTo
(
this
.
contextKeyService
);
this
.
queryBuilder
=
this
.
instantiationService
.
createInstance
(
QueryBuilder
);
...
...
@@ -527,6 +529,7 @@ export class SearchViewlet extends Viewlet {
this
.
firstMatchFocused
.
set
(
this
.
tree
.
getNavigator
().
first
()
===
focus
);
this
.
fileMatchOrMatchFocused
.
set
(
true
);
this
.
fileMatchFocused
.
set
(
focus
instanceof
FileMatch
);
this
.
folderMatchFocused
.
set
(
focus
instanceof
FolderMatch
);
this
.
matchFocused
.
set
(
focus
instanceof
Match
);
}));
...
...
@@ -534,6 +537,7 @@ export class SearchViewlet extends Viewlet {
this
.
firstMatchFocused
.
reset
();
this
.
fileMatchOrMatchFocused
.
reset
();
this
.
fileMatchFocused
.
reset
();
this
.
folderMatchFocused
.
reset
();
this
.
matchFocused
.
reset
();
}));
...
...
src/vs/workbench/parts/search/common/constants.ts
浏览文件 @
b3e6d5bb
...
...
@@ -16,6 +16,7 @@ export const CancelActionId = 'search.action.cancel';
export
const
RemoveActionId
=
'
search.action.remove
'
;
export
const
ReplaceActionId
=
'
search.action.replace
'
;
export
const
ReplaceAllInFileActionId
=
'
search.action.replaceAllInFile
'
;
export
const
ReplaceAllInFolderActionId
=
'
search.action.replaceAllInFolder
'
;
export
const
CloseReplaceWidgetActionId
=
'
closeReplaceInFilesWidget
'
;
export
const
ToggleCaseSensitiveCommandId
=
'
toggleSearchCaseSensitive
'
;
export
const
ToggleWholeWordCommandId
=
'
toggleSearchWholeWord
'
;
...
...
@@ -32,4 +33,5 @@ export const ReplaceActiveKey = new RawContextKey<boolean>('replaceActive', fals
export
const
FirstMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
firstMatchFocus
'
,
false
);
export
const
FileMatchOrMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
fileMatchOrMatchFocus
'
,
false
);
export
const
FileFocusKey
=
new
RawContextKey
<
boolean
>
(
'
fileMatchFocus
'
,
false
);
export
const
FolderFocusKey
=
new
RawContextKey
<
boolean
>
(
'
folderMatchFocus
'
,
false
);
export
const
MatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
matchFocus
'
,
false
);
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录