Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e9262fb5
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,发现更多精彩内容 >>
提交
e9262fb5
编写于
4月 03, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#8594 - Fix Copy Path on folder nodes
上级
c8a6ce93
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
10 deletion
+13
-10
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+5
-5
src/vs/workbench/parts/search/browser/searchView.ts
src/vs/workbench/parts/search/browser/searchView.ts
+4
-2
src/vs/workbench/parts/search/common/constants.ts
src/vs/workbench/parts/search/common/constants.ts
+2
-1
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
...ench/parts/search/electron-browser/search.contribution.ts
+2
-2
未找到文件。
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
e9262fb5
...
...
@@ -26,6 +26,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
import
{
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
getPathLabel
}
from
'
vs/base/common/labels
'
;
import
URI
from
'
vs/base/common/uri
'
;
export
function
isSearchViewFocused
(
viewletService
:
IViewletService
,
panelService
:
IPanelService
):
boolean
{
let
searchView
=
getSearchView
(
viewletService
,
panelService
);
...
...
@@ -635,15 +636,14 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
}
}
function
fileMatchUriToString
(
fileMatch
:
FileMatch
):
string
{
const
resource
=
fileMatch
.
resource
();
function
uriToClipboardString
(
resource
:
URI
):
string
{
return
resource
.
scheme
===
Schemas
.
file
?
getPathLabel
(
resource
)
:
resource
.
toString
();
}
export
const
copyPathCommand
:
ICommandHandler
=
(
accessor
,
fileMatch
:
FileMatch
)
=>
{
export
const
copyPathCommand
:
ICommandHandler
=
(
accessor
,
fileMatch
:
FileMatch
|
FolderMatch
)
=>
{
const
clipboardService
=
accessor
.
get
(
IClipboardService
);
const
text
=
fileMatchUriToString
(
fileMatch
);
const
text
=
uriToClipboardString
(
fileMatch
.
resource
()
);
clipboardService
.
writeText
(
text
);
};
...
...
@@ -659,7 +659,7 @@ function fileMatchToString(fileMatch: FileMatch, maxMatches: number): { text: st
.
map
(
matchText
=>
'
'
+
matchText
);
return
{
text
:
`
${
fileMatchUriToString
(
fileMatch
)}${
lineDelimiter
}${
matchTextRows
.
join
(
lineDelimiter
)}
`
,
text
:
`
${
uriToClipboardString
(
fileMatch
.
resource
()
)}${
lineDelimiter
}${
matchTextRows
.
join
(
lineDelimiter
)}
`
,
count
:
matchTextRows
.
length
};
}
...
...
src/vs/workbench/parts/search/browser/searchView.ts
浏览文件 @
e9262fb5
...
...
@@ -82,6 +82,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
private
inputPatternIncludesFocused
:
IContextKey
<
boolean
>
;
private
firstMatchFocused
:
IContextKey
<
boolean
>
;
private
fileMatchOrMatchFocused
:
IContextKey
<
boolean
>
;
private
fileMatchOrFolderMatchFocus
:
IContextKey
<
boolean
>
;
private
fileMatchFocused
:
IContextKey
<
boolean
>
;
private
folderMatchFocused
:
IContextKey
<
boolean
>
;
private
matchFocused
:
IContextKey
<
boolean
>
;
...
...
@@ -137,6 +138,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
inputPatternIncludesFocused
=
Constants
.
PatternIncludesFocusedKey
.
bindTo
(
this
.
contextKeyService
);
this
.
firstMatchFocused
=
Constants
.
FirstMatchFocusKey
.
bindTo
(
contextKeyService
);
this
.
fileMatchOrMatchFocused
=
Constants
.
FileMatchOrMatchFocusKey
.
bindTo
(
contextKeyService
);
this
.
fileMatchOrFolderMatchFocus
=
Constants
.
FileMatchOrFolderMatchFocusKey
.
bindTo
(
contextKeyService
);
this
.
fileMatchFocused
=
Constants
.
FileFocusKey
.
bindTo
(
contextKeyService
);
this
.
folderMatchFocused
=
Constants
.
FolderFocusKey
.
bindTo
(
contextKeyService
);
this
.
matchFocused
=
Constants
.
MatchFocusKey
.
bindTo
(
this
.
contextKeyService
);
...
...
@@ -535,6 +537,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
fileMatchFocused
.
set
(
focus
instanceof
FileMatch
);
this
.
folderMatchFocused
.
set
(
focus
instanceof
FolderMatch
);
this
.
matchFocused
.
set
(
focus
instanceof
Match
);
this
.
fileMatchOrFolderMatchFocus
.
set
(
focus
instanceof
FileMatch
||
focus
instanceof
FolderMatch
);
}
}));
...
...
@@ -545,9 +548,8 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
fileMatchFocused
.
reset
();
this
.
folderMatchFocused
.
reset
();
this
.
matchFocused
.
reset
();
this
.
fileMatchOrFolderMatchFocus
.
reset
();
}));
});
}
...
...
src/vs/workbench/parts/search/common/constants.ts
浏览文件 @
e9262fb5
...
...
@@ -34,7 +34,8 @@ export const ReplaceActiveKey = new RawContextKey<boolean>('replaceActive', fals
export
const
HasSearchResults
=
new
RawContextKey
<
boolean
>
(
'
hasSearchResult
'
,
false
);
export
const
FirstMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
firstMatchFocus
'
,
false
);
export
const
FileMatchOrMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
fileMatchOrMatchFocus
'
,
false
);
export
const
FileMatchOrMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
fileMatchOrMatchFocus
'
,
false
);
// This is actually, Match or File or Folder
export
const
FileMatchOrFolderMatchFocusKey
=
new
RawContextKey
<
boolean
>
(
'
fileMatchOrFolderMatchFocus
'
,
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
);
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
浏览文件 @
e9262fb5
...
...
@@ -256,7 +256,7 @@ MenuRegistry.appendMenuItem(MenuId.SearchContext, {
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
Constants
.
CopyPathCommandId
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
Constants
.
FileFocusKey
,
when
:
Constants
.
File
MatchOrFolderMatch
FocusKey
,
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
KEY_C
,
win
:
{
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_C
...
...
@@ -269,7 +269,7 @@ MenuRegistry.appendMenuItem(MenuId.SearchContext, {
id
:
Constants
.
CopyPathCommandId
,
title
:
nls
.
localize
(
'
copyPathLabel
'
,
"
Copy Path
"
)
},
when
:
Constants
.
FileFocusKey
,
when
:
Constants
.
File
MatchOrFolderMatch
FocusKey
,
group
:
'
search_2
'
,
order
:
4
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录