Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
068cbf4c
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
068cbf4c
编写于
4月 05, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #23590
上级
cbff2958
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
13 deletion
+16
-13
src/vs/workbench/parts/extensions/browser/extensionEditor.ts
src/vs/workbench/parts/extensions/browser/extensionEditor.ts
+16
-13
未找到文件。
src/vs/workbench/parts/extensions/browser/extensionEditor.ts
浏览文件 @
068cbf4c
...
...
@@ -11,6 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
marked
}
from
'
vs/base/common/marked/marked
'
;
import
{
always
}
from
'
vs/base/common/async
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
import
Event
,
{
Emitter
,
once
,
fromEventEmitter
,
chain
}
from
'
vs/base/common/event
'
;
import
Cache
from
'
vs/base/common/cache
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
...
...
@@ -25,6 +26,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IExtensionGalleryService
,
IExtensionManifest
,
IKeyBinding
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ExtensionsInput
}
from
'
vs/workbench/parts/extensions/common/extensionsInput
'
;
import
{
IExtensionsWorkbenchService
,
IExtensionsViewlet
,
VIEWLET_ID
,
IExtension
,
IExtensionDependencies
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
Renderer
,
DataSource
,
Controller
}
from
'
vs/workbench/parts/extensions/browser/dependenciesViewer
'
;
...
...
@@ -43,9 +45,9 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import
{
Tree
}
from
'
vs/base/parts/tree/browser/treeImpl
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
import
{
IPartService
,
Parts
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IThemeService
}
from
"
vs/platform/theme/common/themeService
"
;
import
{
KeybindingLabel
}
from
'
vs/base/browser/ui/keybindingLabel/keybindingLabel
'
;
function
renderBody
(
body
:
string
):
string
{
const
nonce
=
new
Date
().
getTime
()
+
''
+
new
Date
().
getMilliseconds
();
...
...
@@ -551,20 +553,20 @@ export class ExtensionEditor extends BaseEditor {
const
rawKeybindings
=
contributes
&&
contributes
.
keybindings
||
[];
rawKeybindings
.
forEach
(
rawKeybinding
=>
{
const
key
Label
=
this
.
keybindingToLabel
(
rawKeybinding
);
const
key
binding
=
this
.
resolveKeybinding
(
rawKeybinding
);
if
(
!
key
Label
)
{
if
(
!
key
binding
)
{
return
;
}
let
command
=
byId
[
rawKeybinding
.
command
];
if
(
!
command
)
{
command
=
{
id
:
rawKeybinding
.
command
,
title
:
''
,
keybindings
:
[
key
Label
],
menus
:
[]
};
command
=
{
id
:
rawKeybinding
.
command
,
title
:
''
,
keybindings
:
[
key
binding
],
menus
:
[]
};
byId
[
command
.
id
]
=
command
;
commands
.
push
(
command
);
}
else
{
command
.
keybindings
.
push
(
key
Label
);
command
.
keybindings
.
push
(
key
binding
);
}
});
...
...
@@ -572,6 +574,12 @@ export class ExtensionEditor extends BaseEditor {
return
false
;
}
const
renderKeybinding
=
(
keybinding
:
ResolvedKeybinding
):
HTMLElement
=>
{
const
element
=
$
(
''
);
new
KeybindingLabel
(
element
,
OS
).
set
(
keybinding
,
null
);
return
element
;
};
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
$
(
'
summary
'
,
null
,
localize
(
'
commands
'
,
"
Commands ({0})
"
,
commands
.
length
)),
$
(
'
table
'
,
null
,
...
...
@@ -584,7 +592,7 @@ export class ExtensionEditor extends BaseEditor {
...
commands
.
map
(
c
=>
$
(
'
tr
'
,
null
,
$
(
'
td
'
,
null
,
$
(
'
code
'
,
null
,
c
.
id
)),
$
(
'
td
'
,
null
,
c
.
title
),
$
(
'
td
'
,
null
,
...
join
(
c
.
keybindings
.
map
(
keybinding
=>
$
(
'
code
'
,
null
,
keybinding
)),
'
'
)),
$
(
'
td
'
,
null
,
...
c
.
keybindings
.
map
(
keybinding
=>
renderKeybinding
(
keybinding
)
)),
$
(
'
td
'
,
null
,
...
c
.
menus
.
map
(
context
=>
$
(
'
code
'
,
null
,
context
)))
))
)
...
...
@@ -663,7 +671,7 @@ export class ExtensionEditor extends BaseEditor {
return
true
;
}
private
keybindingToLabel
(
rawKeyBinding
:
IKeyBinding
):
str
ing
{
private
resolveKeybinding
(
rawKeyBinding
:
IKeyBinding
):
ResolvedKeybind
ing
{
let
key
:
string
;
switch
(
process
.
platform
)
{
...
...
@@ -673,12 +681,7 @@ export class ExtensionEditor extends BaseEditor {
}
const
keyBinding
=
KeybindingIO
.
readKeybinding
(
key
||
rawKeyBinding
.
key
,
OS
);
const
resolvedKeybindings
=
this
.
keybindingService
.
resolveKeybinding
(
keyBinding
);
if
(
resolvedKeybindings
.
length
===
0
)
{
return
null
;
}
const
result
=
resolvedKeybindings
[
0
].
getLabel
();
return
result
===
'
unknown
'
?
null
:
result
;
return
this
.
keybindingService
.
resolveKeybinding
(
keyBinding
)[
0
];
}
private
loadContents
(
loadingTask
:
()
=>
TPromise
<
any
>
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录