Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
53a2781d
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,发现更多精彩内容 >>
提交
53a2781d
编写于
1月 23, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add extensions control url
上级
f3ffbcf5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
3 deletion
+53
-3
package.json
package.json
+2
-2
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+7
-0
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
...tform/extensionManagement/node/extensionGalleryService.ts
+43
-1
src/vs/platform/node/product.ts
src/vs/platform/node/product.ts
+1
-0
未找到文件。
package.json
浏览文件 @
53a2781d
{
"name"
:
"code-oss-dev"
,
"version"
:
"1.20.0"
,
"distro"
:
"
2478cca5311e147817eef29cb81c0995a351784
2"
,
"distro"
:
"
e14a5a3afaae557ff651b344462ed39e776435a
2"
,
"author"
:
{
"name"
:
"Microsoft Corporation"
},
...
...
@@ -129,4 +129,4 @@
"windows-mutex"
:
"^0.2.0"
,
"windows-process-tree"
:
"0.1.6"
}
}
}
\ No newline at end of file
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
53a2781d
...
...
@@ -229,6 +229,12 @@ export enum StatisticType {
Uninstall
=
'
uninstall
'
}
export
interface
IReportedExtension
{
id
:
IExtensionIdentifier
;
malicious
:
boolean
;
slow
:
boolean
;
}
export
interface
IExtensionGalleryService
{
_serviceBrand
:
any
;
isEnabled
():
boolean
;
...
...
@@ -240,6 +246,7 @@ export interface IExtensionGalleryService {
getChangelog
(
extension
:
IGalleryExtension
):
TPromise
<
string
>
;
loadCompatibleVersion
(
extension
:
IGalleryExtension
):
TPromise
<
IGalleryExtension
>
;
loadAllDependencies
(
dependencies
:
IExtensionIdentifier
[]):
TPromise
<
IGalleryExtension
[]
>
;
getExtensionsReport
():
TPromise
<
IReportedExtension
[]
>
;
}
export
interface
InstallExtensionEvent
{
...
...
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
浏览文件 @
53a2781d
...
...
@@ -9,7 +9,7 @@ import * as path from 'path';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
distinct
}
from
'
vs/base/common/arrays
'
;
import
{
getErrorMessage
,
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
StatisticType
,
IGalleryExtension
,
IExtensionGalleryService
,
IGalleryExtensionAsset
,
IQueryOptions
,
SortBy
,
SortOrder
,
IExtensionManifest
,
IExtensionIdentifier
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
StatisticType
,
IGalleryExtension
,
IExtensionGalleryService
,
IGalleryExtensionAsset
,
IQueryOptions
,
SortBy
,
SortOrder
,
IExtensionManifest
,
IExtensionIdentifier
,
IReportedExtension
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
getGalleryExtensionId
,
getGalleryExtensionTelemetryData
,
adoptToGalleryExtensionId
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
assign
,
getOrDefault
}
from
'
vs/base/common/objects
'
;
import
{
IRequestService
}
from
'
vs/platform/request/node/request
'
;
...
...
@@ -23,6 +23,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
readFile
}
from
'
vs/base/node/pfs
'
;
import
{
writeFileAndFlushSync
}
from
'
vs/base/node/extfs
'
;
import
{
generateUuid
,
isUUID
}
from
'
vs/base/common/uuid
'
;
import
{
values
}
from
'
vs/base/common/map
'
;
interface
IRawGalleryExtensionFile
{
assetType
:
string
;
...
...
@@ -309,11 +310,17 @@ function toExtension(galleryExtension: IRawGalleryExtension, extensionsGalleryUr
};
}
interface
IRawExtensionsReport
{
malicious
:
string
[];
slow
:
string
[];
}
export
class
ExtensionGalleryService
implements
IExtensionGalleryService
{
_serviceBrand
:
any
;
private
extensionsGalleryUrl
:
string
;
private
extensionsControlUrl
:
string
;
private
readonly
commonHeadersPromise
:
TPromise
<
{
[
key
:
string
]:
string
;
}
>
;
...
...
@@ -324,6 +331,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
)
{
const
config
=
product
.
extensionsGallery
;
this
.
extensionsGalleryUrl
=
config
&&
config
.
serviceUrl
;
this
.
extensionsControlUrl
=
config
&&
config
.
controlUrl
;
this
.
commonHeadersPromise
=
resolveMarketplaceHeaders
(
this
.
environmentService
);
}
...
...
@@ -711,6 +719,40 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
}
return
false
;
}
getExtensionsReport
():
TPromise
<
IReportedExtension
[]
>
{
if
(
!
this
.
isEnabled
())
{
return
TPromise
.
wrapError
(
new
Error
(
'
No extension gallery service configured.
'
));
}
if
(
!
this
.
extensionsControlUrl
)
{
return
TPromise
.
as
([]);
}
return
this
.
requestService
.
request
({
type
:
'
GET
'
,
url
:
this
.
extensionsControlUrl
}).
then
(
context
=>
{
if
(
context
.
res
.
statusCode
!==
200
)
{
return
TPromise
.
wrapError
(
new
Error
(
'
Could not get extensions report.
'
));
}
return
asJson
<
IRawExtensionsReport
>
(
context
).
then
(
result
=>
{
const
map
=
new
Map
<
string
,
IReportedExtension
>
();
for
(
const
id
of
result
.
malicious
)
{
const
ext
=
map
.
get
(
id
)
||
{
id
:
{
id
},
malicious
:
true
,
slow
:
false
};
ext
.
malicious
=
true
;
map
.
set
(
id
,
ext
);
}
for
(
const
id
of
result
.
slow
)
{
const
ext
=
map
.
get
(
id
)
||
{
id
:
{
id
},
malicious
:
false
,
slow
:
true
};
ext
.
slow
=
true
;
map
.
set
(
id
,
ext
);
}
return
TPromise
.
as
(
values
(
map
));
});
});
}
}
export
function
resolveMarketplaceHeaders
(
environmentService
:
IEnvironmentService
):
TPromise
<
{
[
key
:
string
]:
string
;
}
>
{
...
...
src/vs/platform/node/product.ts
浏览文件 @
53a2781d
...
...
@@ -25,6 +25,7 @@ export interface IProductConfiguration {
extensionsGallery
:
{
serviceUrl
:
string
;
itemUrl
:
string
;
controlUrl
:
string
;
};
extensionTips
:
{
[
id
:
string
]:
string
;
};
extensionImportantTips
:
{
[
id
:
string
]:
{
name
:
string
;
pattern
:
string
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录