Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
723c9734
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,发现更多精彩内容 >>
提交
723c9734
编写于
10月 29, 2017
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move workspace rec related logic to its own view
上级
ecc40ba7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
30 deletion
+31
-30
src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts
...ench/parts/extensions/electron-browser/extensionsViews.ts
+31
-29
src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css
...s/extensions/electron-browser/media/extensionsViewlet.css
+0
-1
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts
浏览文件 @
723c9734
...
...
@@ -20,7 +20,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
append
,
$
,
toggleClass
,
addClass
}
from
'
vs/base/browser/dom
'
;
import
{
append
,
$
,
toggleClass
}
from
'
vs/base/browser/dom
'
;
import
{
PagedList
}
from
'
vs/base/browser/ui/list/listPaging
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
Delegate
,
Renderer
}
from
'
vs/workbench/parts/extensions/browser/extensionsList
'
;
...
...
@@ -47,15 +47,15 @@ export class ExtensionsListView extends ViewsViewletPanel {
private
messageBox
:
HTMLElement
;
private
extensionsList
:
HTMLElement
;
private
badge
:
CountBadge
;
pr
ivate
listActionBa
r
:
HTMLElement
;
pr
otected
badgeContaine
r
:
HTMLElement
;
private
list
:
PagedList
<
IExtension
>
;
constructor
(
private
options
:
IViewletViewOptions
,
@
IMessageService
pr
ivate
messageService
:
IMessageService
,
@
IMessageService
pr
otected
messageService
:
IMessageService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
,
@
IInstantiationService
pr
ivate
instantiationService
:
IInstantiationService
,
@
IInstantiationService
pr
otected
instantiationService
:
IInstantiationService
,
@
IListService
private
listService
:
IListService
,
@
IThemeService
private
themeService
:
IThemeService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
...
...
@@ -76,23 +76,8 @@ export class ExtensionsListView extends ViewsViewletPanel {
const
titleDiv
=
append
(
container
,
$
(
'
div.title
'
));
append
(
titleDiv
,
$
(
'
span
'
)).
textContent
=
this
.
options
.
name
;
this
.
listActionBar
=
append
(
container
,
$
(
'
.list-actionbar-container
'
));
const
actionbar
=
new
ActionBar
(
this
.
listActionBar
,
{
animated
:
false
});
actionbar
.
addListener
(
EventType
.
RUN
,
({
error
})
=>
error
&&
this
.
messageService
.
show
(
Severity
.
Error
,
error
));
const
installAllAction
=
this
.
instantiationService
.
createInstance
(
InstallWorkspaceRecommendedExtensionsAction
,
InstallWorkspaceRecommendedExtensionsAction
.
ID
,
InstallWorkspaceRecommendedExtensionsAction
.
LABEL
);
const
configureWorkspaceFolderAction
=
this
.
instantiationService
.
createInstance
(
ConfigureWorkspaceFolderRecommendedExtensionsAction
,
ConfigureWorkspaceFolderRecommendedExtensionsAction
.
ID
,
ConfigureWorkspaceFolderRecommendedExtensionsAction
.
LABEL
);
installAllAction
.
class
=
'
octicon octicon-cloud-download
'
;
configureWorkspaceFolderAction
.
class
=
'
octicon octicon-pencil
'
;
actionbar
.
push
([
installAllAction
],
{
icon
:
true
,
label
:
false
});
actionbar
.
push
([
configureWorkspaceFolderAction
],
{
icon
:
true
,
label
:
false
});
this
.
disposables
.
push
(
actionbar
);
this
.
badge
=
new
CountBadge
(
append
(
container
,
$
(
'
.count-badge-wrapper
'
)));
this
.
badgeContainer
=
append
(
container
,
$
(
'
.count-badge-wrapper
'
));
this
.
badge
=
new
CountBadge
(
this
.
badgeContainer
);
this
.
disposables
.
push
(
attachBadgeStyler
(
this
.
badge
,
this
.
themeService
));
}
...
...
@@ -130,15 +115,8 @@ export class ExtensionsListView extends ViewsViewletPanel {
}
async
show
(
query
:
string
):
TPromise
<
IPagedModel
<
IExtension
>>
{
addClass
(
this
.
listActionBar
,
'
hidden
'
);
const
model
=
await
this
.
query
(
query
);
this
.
setModel
(
model
);
if
(
ExtensionsListView
.
isWorkspaceRecommendedExtensionsQuery
(
query
))
{
this
.
setExpanded
(
model
.
length
>
0
);
toggleClass
(
this
.
listActionBar
,
'
hidden
'
,
model
.
length
===
0
);
}
return
model
;
}
...
...
@@ -576,8 +554,32 @@ export class RecommendedExtensionsView extends ExtensionsListView {
export
class
WorkspaceRecommendedExtensionsView
extends
ExtensionsListView
{
renderHeader
(
container
:
HTMLElement
):
void
{
super
.
renderHeader
(
container
);
const
listActionBar
=
$
(
'
.list-actionbar-container
'
);
container
.
insertBefore
(
listActionBar
,
this
.
badgeContainer
);
const
actionbar
=
new
ActionBar
(
listActionBar
,
{
animated
:
false
});
actionbar
.
addListener
(
EventType
.
RUN
,
({
error
})
=>
error
&&
this
.
messageService
.
show
(
Severity
.
Error
,
error
));
const
installAllAction
=
this
.
instantiationService
.
createInstance
(
InstallWorkspaceRecommendedExtensionsAction
,
InstallWorkspaceRecommendedExtensionsAction
.
ID
,
InstallWorkspaceRecommendedExtensionsAction
.
LABEL
);
const
configureWorkspaceFolderAction
=
this
.
instantiationService
.
createInstance
(
ConfigureWorkspaceFolderRecommendedExtensionsAction
,
ConfigureWorkspaceFolderRecommendedExtensionsAction
.
ID
,
ConfigureWorkspaceFolderRecommendedExtensionsAction
.
LABEL
);
installAllAction
.
class
=
'
octicon octicon-cloud-download
'
;
configureWorkspaceFolderAction
.
class
=
'
octicon octicon-pencil
'
;
actionbar
.
push
([
installAllAction
],
{
icon
:
true
,
label
:
false
});
actionbar
.
push
([
configureWorkspaceFolderAction
],
{
icon
:
true
,
label
:
false
});
this
.
disposables
.
push
(
actionbar
);
}
async
show
(
query
:
string
):
TPromise
<
IPagedModel
<
IExtension
>>
{
return
super
.
show
(
'
@recommended:workspace
'
);
let
model
=
await
super
.
show
(
'
@recommended:workspace
'
);
this
.
setExpanded
(
model
.
length
>
0
);
return
model
;
}
showRecommendedLabel
()
{
...
...
src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css
浏览文件 @
723c9734
...
...
@@ -37,7 +37,6 @@
margin-right
:
10px
;
}
.extensions-viewlet
>
.extensions
.list-actionbar-container.hidden
,
.extensions-viewlet
>
.extensions
.list-actionbar-container
.monaco-action-bar
.action-item.disabled
{
display
:
none
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录