Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a8756e8d
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,发现更多精彩内容 >>
提交
a8756e8d
编写于
8月 24, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
introduce fileDialog context
上级
5ac625f8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
67 addition
and
56 deletion
+67
-56
src/vs/platform/workbench/common/contextkeys.ts
src/vs/platform/workbench/common/contextkeys.ts
+6
-1
src/vs/workbench/electron-browser/main.contribution.ts
src/vs/workbench/electron-browser/main.contribution.ts
+53
-49
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+4
-4
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
.../parts/files/electron-browser/fileActions.contribution.ts
+4
-2
未找到文件。
src/vs/platform/workbench/common/contextkeys.ts
浏览文件 @
a8756e8d
...
...
@@ -6,6 +6,11 @@
'
use strict
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
isMacintosh
,
isLinux
,
isWindows
}
from
'
vs/base/common/platform
'
;
export
const
InputFocusedContextKey
=
'
inputFocus
'
;
export
const
InputFocusedContext
=
new
RawContextKey
<
boolean
>
(
InputFocusedContextKey
,
false
);
\ No newline at end of file
export
const
InputFocusedContext
=
new
RawContextKey
<
boolean
>
(
InputFocusedContextKey
,
false
);
export
const
FileDialogContext
=
new
RawContextKey
<
string
>
(
'
fileDialog
'
,
'
local
'
);
export
const
IsMacContext
=
new
RawContextKey
<
boolean
>
(
'
isMac
'
,
isMacintosh
);
export
const
IsLinuxContext
=
new
RawContextKey
<
boolean
>
(
'
isLinux
'
,
isLinux
);
export
const
IsWindowsContext
=
new
RawContextKey
<
boolean
>
(
'
isWindows
'
,
isWindows
);
src/vs/workbench/electron-browser/main.contribution.ts
浏览文件 @
a8756e8d
...
...
@@ -22,6 +22,8 @@ import { inQuickOpenContext, getQuickNavigateHandler } from 'vs/workbench/browse
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ADD_ROOT_FOLDER_COMMAND_ID
}
from
'
vs/workbench/browser/actions/workspaceCommands
'
;
import
{
FileDialogContext
,
IsMacContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
// Contribute Commands
registerCommands
();
...
...
@@ -161,34 +163,35 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
order
:
2
});
if
(
!
isMacintosh
)
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFileAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpenFile
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Open File...
"
)
}
,
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFileAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpenFile
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Open File...
"
)
},
order
:
1
,
when
:
ContextKeyExpr
.
and
(
IsMacContext
.
toNegated
(),
FileDialogContext
.
isEqualTo
(
'
local
'
))
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFolderAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpenFolder
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Open &&Folder...
"
)
},
order
:
2
});
}
else
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFileFolderAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpen
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Open...
"
)
},
order
:
1
});
}
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFolderAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpenFolder
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Open &&Folder...
"
)
},
order
:
2
,
when
:
ContextKeyExpr
.
and
(
IsMacContext
.
toNegated
(),
FileDialogContext
.
isEqualTo
(
'
local
'
))
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
command
:
{
id
:
OpenFileFolderAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpen
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Open...
"
)
},
order
:
1
,
when
:
ContextKeyExpr
.
and
(
IsMacContext
,
FileDialogContext
.
isEqualTo
(
'
local
'
))
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
2_open
'
,
...
...
@@ -196,7 +199,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
id
:
OpenWorkspaceAction
.
ID
,
title
:
nls
.
localize
({
key
:
'
miOpenWorkspace
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Open Wor&&kspace...
"
)
},
order
:
3
order
:
3
,
when
:
FileDialogContext
.
isEqualTo
(
'
local
'
)
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
...
...
@@ -220,10 +224,11 @@ MenuRegistry.appendMenuItem(MenuId.MenubarRecentMenu, {
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
3_workspace
'
,
command
:
{
id
:
A
ddRootFolderAction
.
ID
,
id
:
A
DD_ROOT_FOLDER_COMMAND_
ID
,
title
:
nls
.
localize
({
key
:
'
miAddFolderToWorkspace
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
A&&dd Folder to Workspace...
"
)
},
order
:
1
order
:
1
,
when
:
FileDialogContext
.
isEqualTo
(
'
local
'
)
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
...
...
@@ -232,17 +237,17 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
id
:
SaveWorkspaceAsAction
.
ID
,
title
:
nls
.
localize
(
'
miSaveWorkspaceAs
'
,
"
Save Workspace As...
"
)
},
order
:
2
order
:
2
,
when
:
FileDialogContext
.
isEqualTo
(
'
local
'
)
});
if
(
!
isMacintosh
)
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
title
:
nls
.
localize
({
key
:
'
miPreferences
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Preferences
"
),
submenu
:
MenuId
.
MenubarPreferencesMenu
,
group
:
'
5_autosave
'
,
order
:
2
});
}
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
title
:
nls
.
localize
({
key
:
'
miPreferences
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Preferences
"
),
submenu
:
MenuId
.
MenubarPreferencesMenu
,
group
:
'
5_autosave
'
,
order
:
2
,
when
:
IsMacContext
.
toNegated
()
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
group
:
'
6_close
'
,
...
...
@@ -455,16 +460,15 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
});
// About
if
(
!
isMacintosh
)
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarHelpMenu
,
{
group
:
'
z_about
'
,
command
:
{
id
:
'
workbench.action.showAboutDialog
'
,
title
:
nls
.
localize
({
key
:
'
miAbout
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&About
"
)
},
order
:
1
});
}
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarHelpMenu
,
{
group
:
'
z_about
'
,
command
:
{
id
:
'
workbench.action.showAboutDialog
'
,
title
:
nls
.
localize
({
key
:
'
miAbout
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&About
"
)
},
order
:
1
,
when
:
IsMacContext
.
toNegated
()
});
// Configuration: Workbench
const
configurationRegistry
=
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
);
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
a8756e8d
...
...
@@ -93,7 +93,7 @@ import { IDecorationsService } from 'vs/workbench/services/decorations/browser/d
import
{
ActivityService
}
from
'
vs/workbench/services/activity/browser/activityService
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IListService
,
ListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
InputFocusedContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
import
{
InputFocusedContext
,
IsMacContext
,
IsLinuxContext
,
IsWindowsContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
ViewsService
}
from
'
vs/workbench/browser/parts/views/views
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
...
...
@@ -613,9 +613,9 @@ export class Workbench extends Disposable implements IPartService {
private
handleContextKeys
():
void
{
this
.
inZenMode
=
InEditorZenModeContext
.
bindTo
(
this
.
contextKeyService
);
(
new
RawContextKey
<
boolean
>
(
'
isMac
'
,
isMacintosh
))
.
bindTo
(
this
.
contextKeyService
);
(
new
RawContextKey
<
boolean
>
(
'
isLinux
'
,
isLinux
))
.
bindTo
(
this
.
contextKeyService
);
(
new
RawContextKey
<
boolean
>
(
'
isWindows
'
,
isWindows
))
.
bindTo
(
this
.
contextKeyService
);
IsMacContext
.
bindTo
(
this
.
contextKeyService
);
IsLinuxContext
.
bindTo
(
this
.
contextKeyService
);
IsWindowsContext
.
bindTo
(
this
.
contextKeyService
);
const
sidebarVisibleContextRaw
=
new
RawContextKey
<
boolean
>
(
'
sidebarVisible
'
,
false
);
this
.
sideBarVisibleContext
=
sidebarVisibleContextRaw
.
bindTo
(
this
.
contextKeyService
);
...
...
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
浏览文件 @
a8756e8d
...
...
@@ -25,6 +25,7 @@ import { ResourceContextKey } from 'vs/workbench/common/resources';
import
{
WorkbenchListDoubleSelection
}
from
'
vs/platform/list/browser/listService
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
FileDialogContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
// Contribute Global Actions
const
category
=
nls
.
localize
(
'
filesCategory
'
,
"
File
"
);
...
...
@@ -425,7 +426,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
id
:
ADD_ROOT_FOLDER_COMMAND_ID
,
title
:
ADD_ROOT_FOLDER_LABEL
},
when
:
ExplorerRootContext
when
:
ContextKeyExpr
.
and
(
ExplorerRootContext
,
FileDialogContext
.
isEqualTo
(
'
local
'
))
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
ExplorerContext
,
{
...
...
@@ -505,7 +506,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
id
:
SAVE_FILE_AS_COMMAND_ID
,
title
:
nls
.
localize
({
key
:
'
miSaveAs
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Save &&As...
"
)
},
order
:
2
order
:
2
,
when
:
FileDialogContext
.
isEqualTo
(
'
local
'
)
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarFileMenu
,
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录