Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f58289fd
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,发现更多精彩内容 >>
提交
f58289fd
编写于
6月 30, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #8284
上级
6054036f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
3 deletion
+47
-3
src/vs/code/electron-main/menus.ts
src/vs/code/electron-main/menus.ts
+3
-1
src/vs/workbench/parts/search/browser/search.contribution.ts
src/vs/workbench/parts/search/browser/search.contribution.ts
+9
-1
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+18
-0
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+11
-1
src/vs/workbench/parts/search/browser/searchWidget.ts
src/vs/workbench/parts/search/browser/searchWidget.ts
+6
-0
未找到文件。
src/vs/code/electron-main/menus.ts
浏览文件 @
f58289fd
...
...
@@ -501,6 +501,7 @@ export class VSCodeMenu {
let
find
=
this
.
createMenuItem
(
nls
.
localize
({
key
:
'
miFind
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Find
"
),
'
actions.find
'
);
let
replace
=
this
.
createMenuItem
(
nls
.
localize
({
key
:
'
miReplace
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Replace
"
),
'
editor.action.startFindReplaceAction
'
);
let
findInFiles
=
this
.
createMenuItem
(
nls
.
localize
({
key
:
'
miFindInFiles
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Find &&in Files
"
),
'
workbench.view.search
'
);
let
replaceInFiles
=
this
.
createMenuItem
(
nls
.
localize
({
key
:
'
miReplaceInFiles
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Replace &&in Files
"
),
'
workbench.action.replaceInFiles
'
);
[
undo
,
...
...
@@ -514,7 +515,8 @@ export class VSCodeMenu {
find
,
replace
,
__separator__
(),
findInFiles
findInFiles
,
replaceInFiles
].
forEach
(
item
=>
winLinuxEditMenu
.
append
(
item
));
}
...
...
src/vs/workbench/parts/search/browser/search.contribution.ts
浏览文件 @
f58289fd
...
...
@@ -25,7 +25,7 @@ import {KbExpr, IKeybindings} from 'vs/platform/keybinding/common/keybindingServ
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/common/viewletService
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
OpenSearchViewletAction
}
from
'
vs/workbench/parts/search/browser/searchActions
'
;
import
{
OpenSearchViewletAction
,
ReplaceInFilesAction
}
from
'
vs/workbench/parts/search/browser/searchActions
'
;
import
{
VIEWLET_ID
}
from
'
vs/workbench/parts/search/common/constants
'
;
import
{
registerContributions
}
from
'
vs/workbench/parts/search/browser/replaceContributions
'
;
...
...
@@ -120,6 +120,14 @@ const openSearchViewletKb: IKeybindings = {
nls
.
localize
(
'
view
'
,
"
View
"
)
);
(
<
IWorkbenchActionRegistry
>
Registry
.
as
(
ActionExtensions
.
WorkbenchActions
)).
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ReplaceInFilesAction
,
ReplaceInFilesAction
.
ID
,
ReplaceInFilesAction
.
LABEL
,
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_H
}),
'
Edit: Replace in Files
'
,
nls
.
localize
(
'
edit
'
,
"
Edit
"
)
);
// Contribute to Explorer Viewer
const
actionBarRegistry
=
<
IActionBarRegistry
>
Registry
.
as
(
ActionBarExtensions
.
Actionbar
);
actionBarRegistry
.
registerActionBarContributor
(
Scope
.
VIEWER
,
ExplorerViewerActionContributor
);
...
...
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
f58289fd
...
...
@@ -32,6 +32,24 @@ export class OpenSearchViewletAction extends ToggleViewletAction {
}
export
class
ReplaceInFilesAction
extends
Action
{
public
static
ID
=
'
workbench.action.replaceInFiles
'
;
public
static
LABEL
=
nls
.
localize
(
'
replaceInFiles
'
,
"
Replace in Files
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IViewletService
private
viewletService
:
IViewletService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
return
this
.
viewletService
.
openViewlet
(
Constants
.
VIEWLET_ID
,
true
).
then
((
viewlet
)
=>
{
(
<
SearchViewlet
>
viewlet
).
showReplace
();
});
}
}
export
class
FindInFolderAction
extends
Action
{
private
resource
:
URI
;
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
f58289fd
...
...
@@ -38,7 +38,7 @@ import {VIEWLET_ID} from 'vs/workbench/parts/search/common/constants';
import
{
MessageType
,
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
ISearchProgressItem
,
IFileMatch
,
ISearchComplete
,
ISearchQuery
,
IQueryOptions
,
ISearchConfiguration
}
from
'
vs/platform/search/common/search
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
...
...
@@ -306,6 +306,10 @@ export class SearchViewlet extends Viewlet {
this
.
searchWidget
.
onReplaceAll
(()
=>
this
.
replaceAll
());
}
public
showReplace
():
void
{
this
.
searchWidget
.
showReplace
();
}
private
refreshInputs
():
void
{
if
(
this
.
viewModel
)
{
this
.
viewModel
.
matches
().
forEach
((
fileMatch
)
=>
{
...
...
@@ -462,6 +466,11 @@ export class SearchViewlet extends Viewlet {
this
.
searchWidget
.
searchInput
.
setValue
(
selectedText
);
}
this
.
searchWidget
.
focus
();
if
(
this
.
storageService
.
getBoolean
(
'
show.replace.firstTime
'
,
StorageScope
.
GLOBAL
,
true
))
{
this
.
searchWidget
.
showReplace
();
this
.
storageService
.
store
(
'
show.replace.firstTime
'
,
false
,
StorageScope
.
GLOBAL
);
}
}
public
moveFocusFromResults
():
void
{
...
...
@@ -911,6 +920,7 @@ export class SearchViewlet extends Viewlet {
}
},
200
);
this
.
searchWidget
.
setReplaceAllActionState
(
false
);
this
.
replaceService
.
disposeAllInputs
();
this
.
currentRequest
=
this
.
searchService
.
search
(
query
);
this
.
currentRequest
.
then
(
onComplete
,
onError
,
onProgress
);
...
...
src/vs/workbench/parts/search/browser/searchWidget.ts
浏览文件 @
f58289fd
...
...
@@ -115,6 +115,12 @@ export class SearchWidget extends Widget {
}
}
public
showReplace
():
void
{
if
(
!
this
.
isReplaceShown
())
{
this
.
onToggleReplaceButton
();;
}
}
private
render
(
container
:
Builder
,
options
:
ISearchWidgetOptions
):
void
{
this
.
domNode
=
container
.
div
({
'
class
'
:
'
search-widget
'
}).
style
({
position
:
'
relative
'
}).
getHTMLElement
();
this
.
renderToggleReplaceButton
(
this
.
domNode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录