Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
dd7601fd
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd7601fd
编写于
6月 21, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
explorerResourceIsReadonly -> explorerResourceReadonly
also add negative context key for simplicity
上级
a543a0a1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
14 deletion
+15
-14
src/vs/workbench/parts/files/common/files.ts
src/vs/workbench/parts/files/common/files.ts
+3
-2
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
.../parts/files/electron-browser/fileActions.contribution.ts
+10
-10
src/vs/workbench/parts/files/electron-browser/views/explorerView.ts
...kbench/parts/files/electron-browser/views/explorerView.ts
+2
-2
未找到文件。
src/vs/workbench/parts/files/common/files.ts
浏览文件 @
dd7601fd
...
...
@@ -50,12 +50,13 @@ const openEditorsVisibleId = 'openEditorsVisible';
const
openEditorsFocusId
=
'
openEditorsFocus
'
;
const
explorerViewletFocusId
=
'
explorerViewletFocus
'
;
const
explorerResourceIsFolderId
=
'
explorerResourceIsFolder
'
;
const
explorerResource
IsReadonly
=
'
explorerResourceIs
Readonly
'
;
const
explorerResource
Readonly
=
'
explorerResource
Readonly
'
;
const
explorerResourceIsRootId
=
'
explorerResourceIsRoot
'
;
export
const
ExplorerViewletVisibleContext
=
new
RawContextKey
<
boolean
>
(
explorerViewletVisibleId
,
true
);
export
const
ExplorerFolderContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsFolderId
,
false
);
export
const
ExplorerResourceIsReadonlyContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsReadonly
,
false
);
export
const
ExplorerResourceReadonlyContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceReadonly
,
false
);
export
const
ExplorerResourceNotReadonlyContext
=
ExplorerResourceReadonlyContext
.
toNegated
();
export
const
ExplorerRootContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsRootId
,
false
);
export
const
FilesExplorerFocusedContext
=
new
RawContextKey
<
boolean
>
(
filesExplorerFocusId
,
true
);
export
const
OpenEditorsVisibleContext
=
new
RawContextKey
<
boolean
>
(
openEditorsVisibleId
,
false
);
...
...
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
浏览文件 @
dd7601fd
...
...
@@ -16,7 +16,7 @@ import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/c
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
isWindows
,
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
FilesExplorerFocusCondition
,
ExplorerRootContext
,
ExplorerFolderContext
,
ExplorerResource
Is
ReadonlyContext
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
FilesExplorerFocusCondition
,
ExplorerRootContext
,
ExplorerFolderContext
,
ExplorerResource
Not
ReadonlyContext
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
ADD_ROOT_FOLDER_COMMAND_ID
,
ADD_ROOT_FOLDER_LABEL
}
from
'
vs/workbench/browser/actions/workspaceCommands
'
;
import
{
CLOSE_SAVED_EDITORS_COMMAND_ID
,
CLOSE_EDITORS_IN_GROUP_COMMAND_ID
,
CLOSE_EDITOR_COMMAND_ID
,
CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID
}
from
'
vs/workbench/browser/parts/editor/editorCommands
'
;
import
{
OPEN_FOLDER_SETTINGS_COMMAND
,
OPEN_FOLDER_SETTINGS_LABEL
}
from
'
vs/workbench/parts/preferences/browser/preferencesActions
'
;
...
...
@@ -51,7 +51,7 @@ const RENAME_ID = 'renameFile';
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
RENAME_ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
IsReadonlyContext
.
toNegated
()
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
NotReadonlyContext
),
primary
:
KeyCode
.
F2
,
mac
:
{
primary
:
KeyCode
.
Enter
...
...
@@ -63,7 +63,7 @@ const MOVE_FILE_TO_TRASH_ID = 'moveFileToTrash';
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
MOVE_FILE_TO_TRASH_ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
IsReadonlyContext
.
toNegated
()
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
NotReadonlyContext
),
primary
:
KeyCode
.
Delete
,
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Backspace
...
...
@@ -75,7 +75,7 @@ const DELETE_FILE_ID = 'deleteFile';
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
DELETE_FILE_ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
IsReadonlyContext
.
toNegated
()
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerRootContext
.
toNegated
(),
ExplorerResource
NotReadonlyContext
),
primary
:
KeyMod
.
Shift
|
KeyCode
.
Delete
,
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
Backspace
...
...
@@ -97,7 +97,7 @@ const PASTE_FILE_ID = 'filesExplorer.paste';
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
PASTE_FILE_ID
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerResource
IsReadonlyContext
.
toNegated
()
),
when
:
ContextKeyExpr
.
and
(
FilesExplorerFocusCondition
,
ExplorerResource
NotReadonlyContext
),
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
handler
:
pasteFileHandler
});
...
...
@@ -330,7 +330,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
command
:
{
id
:
NEW_FILE_COMMAND_ID
,
title
:
NEW_FILE_LABEL
,
precondition
:
ExplorerResource
IsReadonlyContext
.
toNegated
()
precondition
:
ExplorerResource
NotReadonlyContext
},
when
:
ExplorerFolderContext
});
...
...
@@ -341,7 +341,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
command
:
{
id
:
NEW_FOLDER_COMMAND_ID
,
title
:
NEW_FOLDER_LABEL
,
precondition
:
ExplorerResource
IsReadonlyContext
.
toNegated
()
precondition
:
ExplorerResource
NotReadonlyContext
},
when
:
ExplorerFolderContext
});
...
...
@@ -445,7 +445,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
command
:
{
id
:
RENAME_ID
,
title
:
TRIGGER_RENAME_LABEL
,
precondition
:
ExplorerResource
IsReadonlyContext
.
toNegated
()
precondition
:
ExplorerResource
NotReadonlyContext
},
when
:
ExplorerRootContext
.
toNegated
()
});
...
...
@@ -456,12 +456,12 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
command
:
{
id
:
MOVE_FILE_TO_TRASH_ID
,
title
:
MOVE_FILE_TO_TRASH_LABEL
,
precondition
:
ExplorerResource
IsReadonlyContext
.
toNegated
()
precondition
:
ExplorerResource
NotReadonlyContext
},
alt
:
{
id
:
DELETE_FILE_ID
,
title
:
nls
.
localize
(
'
deleteFile
'
,
"
Delete Permanently
"
),
precondition
:
ExplorerResource
IsReadonlyContext
.
toNegated
()
precondition
:
ExplorerResource
NotReadonlyContext
},
when
:
ExplorerRootContext
.
toNegated
()
});
...
...
src/vs/workbench/parts/files/electron-browser/views/explorerView.ts
浏览文件 @
dd7601fd
...
...
@@ -14,7 +14,7 @@ import * as resources from 'vs/base/common/resources';
import
*
as
glob
from
'
vs/base/common/glob
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
{
IFilesConfiguration
,
ExplorerFolderContext
,
FilesExplorerFocusedContext
,
ExplorerFocusedContext
,
SortOrderConfiguration
,
SortOrder
,
IExplorerView
,
ExplorerRootContext
,
ExplorerResource
Is
ReadonlyContext
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
IFilesConfiguration
,
ExplorerFolderContext
,
FilesExplorerFocusedContext
,
ExplorerFocusedContext
,
SortOrderConfiguration
,
SortOrder
,
IExplorerView
,
ExplorerRootContext
,
ExplorerResourceReadonlyContext
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
FileOperation
,
FileOperationEvent
,
IResolveFileOptions
,
FileChangeType
,
FileChangesEvent
,
IFileService
,
FILES_EXCLUDE_CONFIG
}
from
'
vs/platform/files/common/files
'
;
import
{
RefreshViewExplorerAction
,
NewFolderAction
,
NewFileAction
}
from
'
vs/workbench/parts/files/electron-browser/fileActions
'
;
import
{
FileDragAndDrop
,
FileFilter
,
FileSorter
,
FileController
,
FileRenderer
,
FileDataSource
,
FileViewletState
,
FileAccessibilityProvider
}
from
'
vs/workbench/parts/files/electron-browser/views/explorerViewer
'
;
...
...
@@ -105,7 +105,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
this
.
resourceContext
=
instantiationService
.
createInstance
(
ResourceContextKey
);
this
.
folderContext
=
ExplorerFolderContext
.
bindTo
(
contextKeyService
);
this
.
readonlyContext
=
ExplorerResource
Is
ReadonlyContext
.
bindTo
(
contextKeyService
);
this
.
readonlyContext
=
ExplorerResourceReadonlyContext
.
bindTo
(
contextKeyService
);
this
.
rootContext
=
ExplorerRootContext
.
bindTo
(
contextKeyService
);
this
.
fileEventsFilter
=
instantiationService
.
createInstance
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录