Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
169983b2
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,发现更多精彩内容 >>
提交
169983b2
编写于
8月 23, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
extension editor: show settings contributions
上级
13de7b21
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
154 addition
and
13 deletion
+154
-13
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+69
-0
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
...ench/parts/extensions/electron-browser/extensionEditor.ts
+23
-11
src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css
...rts/extensions/electron-browser/media/extensionEditor.css
+62
-2
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
169983b2
...
...
@@ -12,6 +12,72 @@ import { IPager } from 'vs/base/common/paging';
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IRequestContext
}
from
'
vs/base/node/request
'
;
export
interface
ICommand
{
command
:
string
;
title
:
string
;
category
?:
string
;
}
export
interface
IConfigurationProperty
{
description
:
string
;
type
:
string
|
string
[];
}
export
interface
IConfiguration
{
properties
:
{
[
key
:
string
]:
IConfigurationProperty
;
};
}
export
interface
IDebugger
{
label
:
string
;
runtime
:
string
;
}
export
interface
IGrammar
{
language
:
string
;
}
export
interface
IJSONValidation
{
fileMatch
:
string
;
}
export
interface
IKeyBindings
{
command
:
string
;
key
:
string
;
when
?:
string
;
mac
?:
string
;
linux
?:
string
;
win
?:
string
;
}
export
interface
ILanguage
{
id
:
string
;
extensions
:
string
[];
aliases
:
string
[];
}
export
interface
IMenu
{
command
:
string
;
alt
?:
string
;
when
?:
string
;
group
?:
string
;
}
export
interface
ISnippet
{
language
:
string
;
}
export
interface
IExtensionContributions
{
commands
?:
ICommand
[];
configuration
?:
IConfiguration
;
debuggers
?:
IDebugger
[];
grammars
?:
IGrammar
[];
jsonValidation
?:
IJSONValidation
[];
keybindings
?:
IKeyBindings
[];
languages
?:
ILanguage
[];
menus
?:
{
[
context
:
string
]:
IMenu
[]
};
snippets
?:
ISnippet
[];
}
export
interface
IExtensionManifest
{
name
:
string
;
publisher
:
string
;
...
...
@@ -21,6 +87,9 @@ export interface IExtensionManifest {
description
?:
string
;
main
?:
string
;
icon
?:
string
;
categories
?:
string
[];
activationEvents
?:
string
[];
contributes
?:
IExtensionContributions
;
}
export
interface
IExtensionIdentity
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
浏览文件 @
169983b2
...
...
@@ -90,7 +90,7 @@ class NavBar {
const
NavbarSection
=
{
Readme
:
'
readme
'
,
Con
figuration
:
'
configuration
'
Con
tributions
:
'
contributions
'
};
export
class
ExtensionEditor
extends
BaseEditor
{
...
...
@@ -223,8 +223,8 @@ export class ExtensionEditor extends BaseEditor {
this
.
navbar
.
clear
();
this
.
navbar
.
onChange
(
this
.
onNavbarChange
.
bind
(
this
,
extension
),
this
,
this
.
transientDisposables
);
this
.
navbar
.
push
(
NavbarSection
.
Readme
,
localize
(
'
readme
'
,
"
Readme
"
));
this
.
navbar
.
push
(
NavbarSection
.
Con
figuration
,
localize
(
'
configuration
'
,
"
Config
"
));
this
.
navbar
.
push
(
NavbarSection
.
Readme
,
localize
(
'
details
'
,
"
Details
"
));
this
.
navbar
.
push
(
NavbarSection
.
Con
tributions
,
localize
(
'
contributions
'
,
"
Contributions
"
));
this
.
content
.
innerHTML
=
''
;
...
...
@@ -234,7 +234,7 @@ export class ExtensionEditor extends BaseEditor {
private
onNavbarChange
(
extension
:
IExtension
,
id
:
string
):
void
{
switch
(
id
)
{
case
NavbarSection
.
Readme
:
return
this
.
openReadme
(
extension
);
case
NavbarSection
.
Con
figuration
:
return
this
.
openConfiguration
(
extension
);
case
NavbarSection
.
Con
tributions
:
return
this
.
openContributions
(
extension
);
}
}
...
...
@@ -260,14 +260,26 @@ export class ExtensionEditor extends BaseEditor {
}));
}
private
openCon
figuration
(
extension
:
IExtension
)
{
return
this
.
loadContents
(()
=>
{
return
new
TPromise
(
c
=>
{
private
openCon
tributions
(
extension
:
IExtension
)
{
return
this
.
loadContents
(()
=>
extension
.
getManifest
()
.
then
(
manifest
=>
{
this
.
content
.
innerHTML
=
''
;
this
.
content
.
innerText
=
'
configuration
'
;
c
(
null
);
});
});
const
content
=
append
(
this
.
content
,
$
(
'
div
'
,
{
class
:
'
subcontent
'
}));
const
configuration
=
manifest
.
contributes
.
configuration
;
const
properties
=
configuration
&&
configuration
.
properties
;
const
settings
=
properties
?
Object
.
keys
(
properties
)
:
[];
if
(
settings
.
length
)
{
append
(
content
,
$
(
'
details
'
,
{
open
:
true
},
$
(
'
summary
'
,
null
,
localize
(
'
settings
'
,
"
Settings ({0})
"
,
settings
.
length
)),
$
(
'
table
'
,
{
class
:
'
settings
'
},
$
(
'
tr
'
,
null
,
$
(
'
th
'
,
null
,
localize
(
'
setting name
'
,
"
Name
"
)),
$
(
'
th
'
,
null
,
localize
(
'
description
'
,
"
Description
"
))),
...
settings
.
map
(
key
=>
$
(
'
tr
'
,
null
,
$
(
'
td
'
,
null
,
$
(
'
code
'
,
null
,
key
)),
$
(
'
td
'
,
null
,
properties
[
key
].
description
)))
)
));
}
}));
}
private
loadContents
(
loadingTask
:
()
=>
TPromise
<
any
>
):
void
{
...
...
src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css
浏览文件 @
169983b2
...
...
@@ -135,5 +135,65 @@
.extension-editor
>
.body
>
.content
{
height
:
calc
(
100%
-
36px
);
overflow
:
hidden
;
}
\ No newline at end of file
}
.extension-editor
>
.body
>
.content
>
.subcontent
{
height
:
100%
;
padding
:
20px
;
overflow-y
:
scroll
;
box-sizing
:
border-box
;
}
.extension-editor
>
.body
>
.content
table
{
border-spacing
:
0
;
border-collapse
:
separate
;
}
.extension-editor
>
.body
>
.content
details
>
summary
{
cursor
:
pointer
;
margin-bottom
:
10px
;
font-weight
:
bold
;
font-size
:
120%
;
}
.extension-editor
>
.body
>
.content
details
>
summary
:focus
{
outline
:
none
;
}
.extension-editor
>
.body
>
.content
details
>
summary
::-webkit-details-marker
{
color
:
rgba
(
128
,
128
,
128
,
0.5
);
}
.extension-editor
>
.body
>
.content
table
tr
:nth-child
(
odd
)
{
background-color
:
rgba
(
130
,
130
,
130
,
0.04
);
}
.extension-editor
>
.body
>
.content
table
tr
:not
(
:first-child
)
:hover
{
background-color
:
rgba
(
128
,
128
,
128
,
0.15
);
}
.extension-editor
>
.body
>
.content
table
th
{
border-bottom
:
1px
solid
rgba
(
144
,
144
,
144
,
0.5
);
}
.extension-editor
>
.body
>
.content
table
th
,
.extension-editor
>
.body
>
.content
table
td
{
padding
:
2px
16px
2px
4px
;
}
.extension-editor
>
.body
>
.content
table
th
:last-child
,
.extension-editor
>
.body
>
.content
table
td
:last-child
{
padding
:
2px
4px
;
}
.extension-editor
>
.body
>
.content
table
th
{
text-align
:
left
;
}
.extension-editor
table
.settings
code
{
font-family
:
Monaco
,
Menlo
,
Consolas
,
"Droid Sans Mono"
,
"Inconsolata"
,
"Courier New"
,
monospace
,
"Droid Sans Fallback"
;
font-size
:
80%
;
background-color
:
rgba
(
128
,
128
,
128
,
0.17
);
border-radius
:
4px
;
padding
:
1px
4px
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录