Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5ca26593
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5ca26593
编写于
2月 02, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
context key ids
上级
702d5357
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
19 deletion
+25
-19
src/vs/workbench/parts/files/browser/fileActions.contribution.ts
...workbench/parts/files/browser/fileActions.contribution.ts
+9
-13
src/vs/workbench/parts/files/common/files.ts
src/vs/workbench/parts/files/common/files.ts
+16
-6
未找到文件。
src/vs/workbench/parts/files/browser/fileActions.contribution.ts
浏览文件 @
5ca26593
...
...
@@ -27,7 +27,7 @@ import { revealInOSFocussedExplorerItem, openFocussedOpenedEditorsViewItemComman
import
{
CommandsRegistry
,
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
explorerItemToFileResource
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
explorerItemToFileResource
,
ExplorerFocusCondition
,
OpenedEditorsFocusCondition
,
FilesExplorerFocusCondition
}
from
'
vs/workbench/parts/files/common/files
'
;
class
FilesViewerActionContributor
extends
ActionBarContributor
{
...
...
@@ -239,14 +239,10 @@ CommandsRegistry.registerCommand('_files.openFolderPicker', openFolderPickerComm
CommandsRegistry
.
registerCommand
(
'
_files.windowOpen
'
,
openWindowCommand
);
CommandsRegistry
.
registerCommand
(
'
workbench.action.files.openFileInNewWindow
'
,
openFileInNewWindowCommand
);
const
filesExplorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
explorerViewletVisible
'
),
ContextKeyExpr
.
has
(
'
filesExplorerFocus
'
));
const
openedEditorsFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
explorerViewletVisible
'
),
ContextKeyExpr
.
has
(
'
openEditorsFocus
'
));
const
explorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
'
explorerViewletVisible
'
),
ContextKeyExpr
.
has
(
'
explorerFocus
'
));
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.openEditors.open
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
o
penedEditorsFocusCondition
,
when
:
O
penedEditorsFocusCondition
,
primary
:
KeyCode
.
Enter
,
handler
:
openFocussedOpenedEditorsViewItemCommand
});
...
...
@@ -254,7 +250,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.filesExplorer.open
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
f
ilesExplorerFocusCondition
,
when
:
F
ilesExplorerFocusCondition
,
primary
:
KeyCode
.
Enter
,
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
DownArrow
...
...
@@ -265,7 +261,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.explorer.openToSide
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
e
xplorerFocusCondition
,
when
:
E
xplorerFocusCondition
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Enter
,
mac
:
{
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
Enter
...
...
@@ -276,7 +272,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.filesExplorer.rename
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
f
ilesExplorerFocusCondition
,
when
:
F
ilesExplorerFocusCondition
,
primary
:
KeyCode
.
F2
,
mac
:
{
primary
:
KeyCode
.
Enter
...
...
@@ -287,7 +283,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.filesExplorer.moveFileToTrash
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
f
ilesExplorerFocusCondition
,
when
:
F
ilesExplorerFocusCondition
,
primary
:
KeyCode
.
Delete
,
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Backspace
...
...
@@ -298,7 +294,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.filesExplorer.deleteFile
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
f
ilesExplorerFocusCondition
,
when
:
F
ilesExplorerFocusCondition
,
primary
:
KeyMod
.
Shift
|
KeyCode
.
Delete
,
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
Backspace
...
...
@@ -309,7 +305,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.explorer.copyPath
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
e
xplorerFocusCondition
,
when
:
E
xplorerFocusCondition
,
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
KEY_C
,
win
:
{
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_C
...
...
@@ -320,7 +316,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
workbench.files.action.explorer.revealInOS
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
e
xplorerFocusCondition
,
when
:
E
xplorerFocusCondition
,
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
KEY_R
,
win
:
{
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_R
...
...
src/vs/workbench/parts/files/common/files.ts
浏览文件 @
5ca26593
...
...
@@ -9,7 +9,7 @@ import { IEditorOptions } from 'vs/editor/common/editorCommon';
import
{
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
{
IFilesConfiguration
}
from
'
vs/platform/files/common/files
'
;
import
{
FileStat
,
OpenEditor
}
from
'
vs/workbench/parts/files/common/explorerViewModel
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ContextKeyExpr
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
/**
* Explorer viewlet id.
...
...
@@ -19,11 +19,21 @@ export const VIEWLET_ID = 'workbench.view.explorer';
/**
* Context Keys to use with keybindings for the Explorer and Open Editors view
*/
export
const
ExplorerViewletVisibleContext
=
new
RawContextKey
<
boolean
>
(
'
explorerViewletVisible
'
,
true
);
export
const
ExplorerFolderContext
=
new
RawContextKey
<
boolean
>
(
'
explorerResourceIsFolder
'
,
false
);
export
const
FilesExplorerFocussedContext
=
new
RawContextKey
<
boolean
>
(
'
filesExplorerFocus
'
,
false
);
export
const
OpenEditorsFocussedContext
=
new
RawContextKey
<
boolean
>
(
'
openEditorsFocus
'
,
false
);
export
const
ExplorerFocussedContext
=
new
RawContextKey
<
boolean
>
(
'
explorerFocus
'
,
false
);
const
explorerViewletVisibleId
=
'
explorerViewletVisible
'
;
const
filesExplorerFocusId
=
'
filesExplorerFocus
'
;
const
openEditorsFocusId
=
'
openEditorsFocus
'
;
const
explorerViewletFocusId
=
'
explorerViewletFocus
'
;
const
explorerResourceIsFolderId
=
'
explorerResourceIsFolder
'
;
export
const
ExplorerViewletVisibleContext
=
new
RawContextKey
<
boolean
>
(
explorerViewletVisibleId
,
true
);
export
const
ExplorerFolderContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsFolderId
,
false
);
export
const
FilesExplorerFocussedContext
=
new
RawContextKey
<
boolean
>
(
filesExplorerFocusId
,
false
);
export
const
OpenEditorsFocussedContext
=
new
RawContextKey
<
boolean
>
(
openEditorsFocusId
,
false
);
export
const
ExplorerFocussedContext
=
new
RawContextKey
<
boolean
>
(
explorerViewletFocusId
,
false
);
export
const
FilesExplorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
explorerViewletVisibleId
),
ContextKeyExpr
.
has
(
filesExplorerFocusId
));
export
const
OpenedEditorsFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
explorerViewletVisibleId
),
ContextKeyExpr
.
has
(
openEditorsFocusId
));
export
const
ExplorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
explorerViewletVisibleId
),
ContextKeyExpr
.
has
(
explorerViewletFocusId
));
/**
* File editor input id.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录