Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a245ff92
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,发现更多精彩内容 >>
提交
a245ff92
编写于
12月 08, 2015
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "add a badge to extensions activity action"
This reverts commit
4cf316aa
.
上级
691c3d38
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
68 addition
and
42 deletion
+68
-42
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+11
-12
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
...ch/parts/extensions/electron-browser/extensionsActions.ts
+0
-30
src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts
...ch/parts/extensions/electron-browser/extensionsWidgets.ts
+57
-0
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
a245ff92
...
...
@@ -8,14 +8,14 @@ import toolbar = require('vs/base/browser/ui/toolbar/toolbar');
import
actionbar
=
require
(
'
vs/base/browser/ui/actionbar/actionbar
'
);
import
platform
=
require
(
'
vs/platform/platform
'
);
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IPluginService
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
actionbarregistry
=
require
(
'
vs/workbench/browser/actionBarRegistry
'
);
import
{
ExtensionsStatusbarItem
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWidgets
'
;
import
{
IGalleryService
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
GlobalExtensionsAction
,
GlobalExtensionsActionItem
}
from
'
./extensionsActions
'
;
import
{
GlobalExtensionsAction
}
from
'
./extensionsActions
'
;
import
{
GalleryService
}
from
'
vs/workbench/parts/extensions/node/vsoGalleryService
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ExtensionsWorkbenchExtension
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
// Register Gallery Service
registerSingleton
(
IGalleryService
,
GalleryService
);
...
...
@@ -28,13 +28,12 @@ registerSingleton(IGalleryService, GalleryService);
class
GlobalExtensionsActionContributor
extends
actionbarregistry
.
ActionBarContributor
{
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IPluginService
private
pluginService
:
IPluginService
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
super
();
}
public
hasActions
(
context
:
any
):
boolean
{
public
hasActions
(
context
:
any
):
boolean
{
return
context
===
toolbar
.
CONTEXT
;
}
...
...
@@ -44,13 +43,13 @@ class GlobalExtensionsActionContributor extends actionbarregistry.ActionBarContr
];
}
public
getActionItem
(
context
:
any
,
action
:
actions
.
Action
):
actionbar
.
BaseActionItem
{
if
(
action
.
id
===
GlobalExtensionsAction
.
ID
)
{
return
new
GlobalExtensionsActionItem
(
this
.
pluginService
,
action
);
}
//
public getActionItem(context: any, action: actions.Action): actionbar.BaseActionItem {
//
if (action.id === GlobalExtensionsAction.ID) {
// return this.instantiationService.createInstance(GlobalExtensionsActionItem
, action);
//
}
return
null
;
}
//
return null;
//
}
}
// Register Global Extensions Action
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
浏览文件 @
a245ff92
...
...
@@ -4,11 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import
nls
=
require
(
'
vs/nls
'
);
import
Severity
from
'
vs/base/common/severity
'
;
import
{
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IPluginService
,
IPluginStatus
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
NumberBadge
}
from
'
vs/workbench/services/activity/common/activityService
'
;
import
{
ActivityActionItem
}
from
'
vs/workbench/browser/parts/activityBar/activityAction
'
;
import
{
IExtensionsService
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/browser/quickOpenService
'
;
...
...
@@ -103,30 +100,3 @@ export class GlobalExtensionsAction extends Action {
return
true
;
}
}
export
class
GlobalExtensionsActionItem
extends
ActivityActionItem
{
private
status
:
{
[
id
:
string
]:
IPluginStatus
};
private
severity
:
Severity
;
private
messageCount
:
number
;
constructor
(
private
pluginService
:
IPluginService
,
action
:
Action
)
{
super
(
action
);
this
.
severity
=
Severity
.
Ignore
;
this
.
messageCount
=
0
;
this
.
pluginService
.
onReady
().
then
(()
=>
{
this
.
status
=
this
.
pluginService
.
getPluginsStatus
();
Object
.
keys
(
this
.
status
).
forEach
(
key
=>
{
this
.
severity
=
this
.
status
[
key
].
messages
.
reduce
((
maxSeverity
,
message
)
=>
Math
.
max
(
maxSeverity
,
message
.
type
),
this
.
severity
);
this
.
messageCount
+=
this
.
status
[
key
].
messages
.
length
;
});
if
(
this
.
severity
>
Severity
.
Info
)
{
this
.
setBadge
(
new
NumberBadge
(
this
.
messageCount
,
()
=>
nls
.
localize
(
'
extensionsMessages
'
,
"
There are extensions messages
"
)));
}
});
}
}
src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts
0 → 100644
浏览文件 @
a245ff92
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
nls
=
require
(
'
vs/nls
'
);
import
Severity
from
'
vs/base/common/severity
'
;
import
dom
=
require
(
'
vs/base/browser/dom
'
);
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
);
import
statusbar
=
require
(
'
vs/workbench/browser/parts/statusbar/statusbar
'
);
import
{
IPluginService
,
IPluginStatus
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
var
$
=
dom
.
emmet
;
export
class
ExtensionsStatusbarItem
implements
statusbar
.
IStatusbarItem
{
private
toDispose
:
lifecycle
.
IDisposable
[];
private
severity
:
Severity
;
private
domNode
:
HTMLElement
;
private
status
:
{
[
id
:
string
]:
IPluginStatus
};
constructor
(
@
IPluginService
private
pluginService
:
IPluginService
,
@
IMessageService
private
messageService
:
IMessageService
)
{
this
.
toDispose
=
[];
this
.
severity
=
Severity
.
Ignore
;
this
.
pluginService
.
onReady
().
then
(()
=>
{
this
.
status
=
this
.
pluginService
.
getPluginsStatus
();
Object
.
keys
(
this
.
status
).
forEach
(
key
=>
{
this
.
severity
=
this
.
status
[
key
].
messages
.
reduce
((
maxSeverity
,
message
)
=>
Math
.
max
(
maxSeverity
,
message
.
type
),
this
.
severity
);
});
this
.
domNode
.
hidden
=
this
.
severity
===
Severity
.
Ignore
;
});
}
public
render
(
container
:
HTMLElement
):
lifecycle
.
IDisposable
{
this
.
domNode
=
dom
.
append
(
container
,
$
(
'
.extensions-statusbar octicon octicon-package
'
));
this
.
domNode
.
title
=
nls
.
localize
(
'
extensionsStatus
'
,
"
Extensions Status
"
),
this
.
domNode
.
hidden
=
true
;
this
.
toDispose
.
push
(
dom
.
addDisposableListener
(
this
.
domNode
,
'
click
'
,
()
=>
{
Object
.
keys
(
this
.
status
).
forEach
(
key
=>
{
this
.
status
[
key
].
messages
.
forEach
(
m
=>
{
if
(
m
.
type
===
this
.
severity
)
{
this
.
messageService
.
show
(
m
.
type
,
m
.
message
);
}
});
});
}));
return
{
dispose
:
()
=>
lifecycle
.
disposeAll
(
this
.
toDispose
)
};
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录