Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
aa4efa36
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,体验更适合开发者的 AI 搜索 >>
提交
aa4efa36
编写于
10月 21, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ExtensionEditor: Show navbar sections always. Show some text instead of empty content
上级
9b01ce13
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
47 addition
and
31 deletion
+47
-31
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
...ench/parts/extensions/electron-browser/extensionEditor.ts
+43
-31
src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css
...rts/extensions/electron-browser/media/extensionEditor.css
+4
-0
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
浏览文件 @
aa4efa36
...
...
@@ -281,13 +281,8 @@ export class ExtensionEditor extends BaseEditor {
this
.
navbar
.
onChange
(
this
.
onNavbarChange
.
bind
(
this
,
extension
),
this
,
this
.
transientDisposables
);
this
.
navbar
.
push
(
NavbarSection
.
Readme
,
localize
(
'
details
'
,
"
Details
"
));
this
.
navbar
.
push
(
NavbarSection
.
Contributions
,
localize
(
'
contributions
'
,
"
Contributions
"
));
if
(
extension
.
hasChangelog
)
{
this
.
navbar
.
push
(
NavbarSection
.
Changelog
,
localize
(
'
changelog
'
,
"
Changelog
"
));
}
if
(
extension
.
dependencies
.
length
>
0
)
{
this
.
navbar
.
push
(
NavbarSection
.
Dependencies
,
localize
(
'
dependencies
'
,
"
Dependencies
"
));
}
this
.
content
.
innerHTML
=
''
;
...
...
@@ -301,7 +296,7 @@ export class ExtensionEditor extends BaseEditor {
case
NavbarSection
.
Readme
:
return
this
.
openReadme
();
case
NavbarSection
.
Contributions
:
return
this
.
openContributions
();
case
NavbarSection
.
Changelog
:
return
this
.
openChangelog
();
case
NavbarSection
.
Dependencies
:
return
this
.
openDependencies
();
case
NavbarSection
.
Dependencies
:
return
this
.
openDependencies
(
extension
);
}
}
...
...
@@ -323,7 +318,7 @@ export class ExtensionEditor extends BaseEditor {
this
.
contentDisposables
.
push
(
webview
);
})
.
then
(
null
,
()
=>
{
const
p
=
append
(
this
.
content
,
$
(
'
p
'
));
const
p
=
append
(
this
.
content
,
$
(
'
p
.nocontent
'
));
p
.
textContent
=
noContentCopy
;
}));
}
...
...
@@ -333,7 +328,7 @@ export class ExtensionEditor extends BaseEditor {
}
private
openChangelog
()
{
return
this
.
openMarkdown
(
this
.
extensionChangelog
.
get
(),
localize
(
'
noChangelog
'
,
"
No C
HANGELOG
available.
"
));
return
this
.
openMarkdown
(
this
.
extensionChangelog
.
get
(),
localize
(
'
noChangelog
'
,
"
No C
hangelog
available.
"
));
}
private
openContributions
()
{
...
...
@@ -341,25 +336,36 @@ export class ExtensionEditor extends BaseEditor {
.
then
(
manifest
=>
{
const
content
=
$
(
'
div
'
,
{
class
:
'
subcontent
'
});
const
scrollableContent
=
new
DomScrollableElement
(
content
,
{
canUseTranslate3d
:
false
});
append
(
this
.
content
,
scrollableContent
.
getDomNode
());
this
.
contentDisposables
.
push
(
scrollableContent
);
const
layout
=
()
=>
scrollableContent
.
scanDomNode
();
const
removeLayoutParticipant
=
arrays
.
insert
(
this
.
layoutParticipants
,
{
layout
});
this
.
contentDisposables
.
push
(
toDisposable
(
removeLayoutParticipant
));
ExtensionEditor
.
renderSettings
(
content
,
manifest
,
layout
);
this
.
renderCommands
(
content
,
manifest
,
layout
);
ExtensionEditor
.
renderLanguages
(
content
,
manifest
,
layout
);
ExtensionEditor
.
renderThemes
(
content
,
manifest
,
layout
);
ExtensionEditor
.
renderJSONValidation
(
content
,
manifest
,
layout
);
ExtensionEditor
.
renderDebuggers
(
content
,
manifest
,
layout
);
let
isEmpty
=
true
;
isEmpty
=
isEmpty
&&
!
ExtensionEditor
.
renderSettings
(
content
,
manifest
,
layout
);
isEmpty
=
isEmpty
&&
!
this
.
renderCommands
(
content
,
manifest
,
layout
);
isEmpty
=
isEmpty
&&
!
ExtensionEditor
.
renderLanguages
(
content
,
manifest
,
layout
);
isEmpty
=
isEmpty
&&
!
ExtensionEditor
.
renderThemes
(
content
,
manifest
,
layout
);
isEmpty
=
isEmpty
&&
!
ExtensionEditor
.
renderJSONValidation
(
content
,
manifest
,
layout
);
isEmpty
=
isEmpty
&&
!
ExtensionEditor
.
renderDebuggers
(
content
,
manifest
,
layout
);
scrollableContent
.
scanDomNode
();
if
(
isEmpty
)
{
append
(
this
.
content
,
$
(
'
p.nocontent
'
)).
textContent
=
localize
(
'
noContributions
'
,
"
No Contributions
"
);
return
;
}
else
{
append
(
this
.
content
,
scrollableContent
.
getDomNode
());
this
.
contentDisposables
.
push
(
scrollableContent
);
}
}));
}
private
openDependencies
()
{
private
openDependencies
(
extension
:
IExtension
)
{
if
(
extension
.
dependencies
.
length
===
0
)
{
append
(
this
.
content
,
$
(
'
p.nocontent
'
)).
textContent
=
localize
(
'
noDependencies
'
,
"
No Dependencies
"
);
return
;
}
addClass
(
this
.
content
,
'
loading
'
);
this
.
extensionDependencies
.
get
().
then
(
extensionDependencies
=>
{
removeClass
(
this
.
content
,
'
loading
'
);
...
...
@@ -397,14 +403,14 @@ export class ExtensionEditor extends BaseEditor {
return
tree
;
}
private
static
renderSettings
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
static
renderSettings
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
configuration
=
contributes
&&
contributes
.
configuration
;
const
properties
=
configuration
&&
configuration
.
properties
;
const
contrib
=
properties
?
Object
.
keys
(
properties
)
:
[];
if
(
!
contrib
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -424,14 +430,15 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
static
renderDebuggers
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
static
renderDebuggers
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
contrib
=
contributes
&&
contributes
.
debuggers
||
[];
if
(
!
contrib
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -443,14 +450,15 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
static
renderThemes
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
static
renderThemes
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
contrib
=
contributes
&&
contributes
.
themes
||
[];
if
(
!
contrib
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -459,14 +467,15 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
static
renderJSONValidation
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
static
renderJSONValidation
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
contrib
=
contributes
&&
contributes
.
jsonValidation
||
[];
if
(
!
contrib
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -475,9 +484,10 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
renderCommands
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
renderCommands
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
rawCommands
=
contributes
&&
contributes
.
commands
||
[];
const
commands
=
rawCommands
.
map
(
c
=>
({
...
...
@@ -521,7 +531,7 @@ export class ExtensionEditor extends BaseEditor {
});
if
(
!
commands
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -543,9 +553,10 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
static
renderLanguages
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
void
{
private
static
renderLanguages
(
container
:
HTMLElement
,
manifest
:
IExtensionManifest
,
onDetailsToggle
:
Function
):
boolean
{
const
contributes
=
manifest
.
contributes
;
const
rawLanguages
=
contributes
&&
contributes
.
languages
||
[];
const
languages
=
rawLanguages
.
map
(
l
=>
({
...
...
@@ -587,7 +598,7 @@ export class ExtensionEditor extends BaseEditor {
});
if
(
!
languages
.
length
)
{
return
;
return
false
;
}
const
details
=
$
(
'
details
'
,
{
open
:
true
,
ontoggle
:
onDetailsToggle
},
...
...
@@ -611,6 +622,7 @@ export class ExtensionEditor extends BaseEditor {
);
append
(
container
,
details
);
return
true
;
}
private
keybindingToLabel
(
rawKeyBinding
:
IKeyBinding
):
string
{
...
...
src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css
浏览文件 @
aa4efa36
...
...
@@ -156,6 +156,10 @@
height
:
100%
;
}
.extension-editor
>
.body
>
.content
>
.nocontent
{
margin-left
:
20px
;
}
.extension-editor
>
.body
>
.content
>
.monaco-scrollable-element
>
.subcontent
{
height
:
100%
;
padding
:
20px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录