Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a5be21f7
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 搜索 >>
提交
a5be21f7
编写于
11月 28, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Render activation times
上级
f8ca8085
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
13 deletion
+60
-13
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+16
-1
src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css
...nsions/electron-browser/media/runtimeExtensionsEditor.css
+17
-1
src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts
...ts/extensions/electron-browser/runtimeExtensionsEditor.ts
+17
-3
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+10
-8
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
a5be21f7
...
...
@@ -34,13 +34,14 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
import
jsonContributionRegistry
=
require
(
'
vs/platform/jsonschemas/common/jsonContributionRegistry
'
);
import
{
ExtensionsConfigurationSchema
,
ExtensionsConfigurationSchemaId
}
from
'
vs/workbench/parts/extensions/common/extensionsFileTemplate
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KeymapExtensions
,
BetterMergeDisabled
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsUtils
'
;
import
{
adoptToGalleryExtensionId
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
GalleryExtensionsHandler
,
ExtensionsHandler
}
from
'
vs/workbench/parts/extensions/browser/extensionsQuickOpen
'
;
import
{
EditorDescriptor
,
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/browser/editor
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
RuntimeExtensionsEditor
,
RuntimeExtensionsInput
,
ShowRuntimeExtensionsAction
}
from
'
vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor
'
;
import
{
EditorInput
,
IEditorInputFactory
,
IEditorInputFactoryRegistry
,
Extensions
as
EditorInputExtensions
}
from
'
vs/workbench/common/editor
'
;
// Singletons
registerSingleton
(
IExtensionGalleryService
,
ExtensionGalleryService
);
...
...
@@ -89,6 +90,8 @@ const editorDescriptor = new EditorDescriptor(
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
)
.
registerEditor
(
editorDescriptor
,
[
new
SyncDescriptor
(
ExtensionsInput
)]);
// Running Extensions Editor
const
runtimeExtensionsEditorDescriptor
=
new
EditorDescriptor
(
RuntimeExtensionsEditor
,
RuntimeExtensionsEditor
.
ID
,
...
...
@@ -98,6 +101,18 @@ const runtimeExtensionsEditorDescriptor = new EditorDescriptor(
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
)
.
registerEditor
(
runtimeExtensionsEditorDescriptor
,
[
new
SyncDescriptor
(
RuntimeExtensionsInput
)]);
class
RuntimeExtensionsInputFactory
implements
IEditorInputFactory
{
serialize
(
editorInput
:
EditorInput
):
string
{
return
''
;
}
deserialize
(
instantiationService
:
IInstantiationService
,
serializedEditorInput
:
string
):
EditorInput
{
return
new
RuntimeExtensionsInput
();
}
}
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorInputExtensions
.
EditorInputFactories
).
registerEditorInputFactory
(
RuntimeExtensionsInput
.
ID
,
RuntimeExtensionsInputFactory
);
// Viewlet
const
viewletDescriptor
=
new
ViewletDescriptor
(
ExtensionsViewlet
,
...
...
src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css
浏览文件 @
a5be21f7
...
...
@@ -3,9 +3,25 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.runtime-extensions-editor
.extension
{
display
:
flex
;
padding-left
:
20px
;
}
.runtime-extensions-editor
.extension
.desc
{
flex
:
1
;
}
.runtime-extensions-editor
.extension
.desc
.name
{
font-weight
:
bold
;
}
.runtime-extensions-editor
.extension
.desc
.time-label
{
padding-left
:
4px
;
}
.runtime-extensions-editor
.icon
{
width
:
42px
;
height
:
42px
;
padding
:
10px
14px
10px
0
;
float
:
left
;
}
src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts
浏览文件 @
a5be21f7
...
...
@@ -62,7 +62,10 @@ export class RuntimeExtensionsEditor extends BaseEditor {
this
.
_updateExtensions
();
this
.
_extensionService
.
getExtensions
().
then
((
extensions
)
=>
{
this
.
_extensionsDescriptions
=
extensions
;
// We only deal with extensions with source code!
this
.
_extensionsDescriptions
=
extensions
.
filter
((
extension
)
=>
{
return
!!
extension
.
main
;
});
this
.
_updateExtensions
();
});
this
.
_register
(
this
.
_extensionService
.
onDidChangeExtensionsStatus
(()
=>
this
.
_updateExtensions
()));
...
...
@@ -97,7 +100,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
};
}
return
result
;
return
result
.
filter
((
element
)
=>
element
.
status
.
activationTimes
)
;
}
protected
createEditor
(
parent
:
Builder
):
void
{
...
...
@@ -121,6 +124,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
element
:
HTMLElement
;
icon
:
HTMLImageElement
;
name
:
HTMLElement
;
time
:
HTMLElement
;
disposables
:
IDisposable
[];
elementDisposables
:
IDisposable
[];
}
...
...
@@ -130,7 +134,12 @@ export class RuntimeExtensionsEditor extends BaseEditor {
renderTemplate
:
(
root
:
HTMLElement
):
IRuntimeExtensionTemplateData
=>
{
const
element
=
append
(
root
,
$
(
'
.extension
'
));
const
icon
=
append
(
element
,
$
<
HTMLImageElement
>
(
'
img.icon
'
));
const
name
=
append
(
element
,
$
(
'
span.name
'
));
const
desc
=
append
(
element
,
$
(
'
div.desc
'
));
const
name
=
append
(
desc
,
$
(
'
div.name
'
));
const
timeContainer
=
append
(
desc
,
$
(
'
div.time
'
));
append
(
timeContainer
,
$
(
'
span.octicon.octicon-clock
'
));
const
time
=
append
(
timeContainer
,
$
(
'
span.time-label
'
));
const
actionbar
=
new
ActionBar
(
element
,
{
animated
:
false
,
actionItemProvider
:
(
action
:
Action
)
=>
{
...
...
@@ -150,6 +159,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
element
,
icon
,
name
,
time
,
disposables
,
elementDisposables
:
[]
};
...
...
@@ -167,6 +177,10 @@ export class RuntimeExtensionsEditor extends BaseEditor {
data
.
icon
.
src
=
element
.
marketplaceInfo
.
iconUrl
;
data
.
name
.
textContent
=
element
.
marketplaceInfo
.
displayName
;
const
activationTimes
=
element
.
status
.
activationTimes
;
let
syncTime
=
activationTimes
.
codeLoadingTime
+
activationTimes
.
activateCallTime
;
data
.
time
.
textContent
=
`
${
syncTime
}
ms`
;
},
disposeTemplate
:
(
data
:
IRuntimeExtensionTemplateData
):
void
=>
{
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
a5be21f7
...
...
@@ -304,14 +304,16 @@ export class ExtensionService extends Disposable implements IExtensionService {
public
getExtensionsStatus
():
{
[
id
:
string
]:
IExtensionsStatus
;
}
{
let
result
:
{
[
id
:
string
]:
IExtensionsStatus
;
}
=
Object
.
create
(
null
);
const
extensions
=
this
.
_registry
.
getAllExtensionDescriptions
();
for
(
let
i
=
0
,
len
=
extensions
.
length
;
i
<
len
;
i
++
)
{
const
extension
=
extensions
[
i
];
const
id
=
extension
.
id
;
result
[
id
]
=
{
messages
:
this
.
_extensionsMessages
[
id
],
activationTimes
:
this
.
_extensionHostProcessActivationTimes
[
id
]
};
if
(
this
.
_registry
)
{
const
extensions
=
this
.
_registry
.
getAllExtensionDescriptions
();
for
(
let
i
=
0
,
len
=
extensions
.
length
;
i
<
len
;
i
++
)
{
const
extension
=
extensions
[
i
];
const
id
=
extension
.
id
;
result
[
id
]
=
{
messages
:
this
.
_extensionsMessages
[
id
],
activationTimes
:
this
.
_extensionHostProcessActivationTimes
[
id
]
};
}
}
return
result
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录