Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f3c88424
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,发现更多精彩内容 >>
提交
f3c88424
编写于
7月 15, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
provide download location to download method
上级
a8842026
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
11 deletion
+13
-11
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+1
-1
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
...tform/extensionManagement/node/extensionGalleryService.ts
+5
-5
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+3
-2
src/vs/workbench/browser/web.simpleservices.ts
src/vs/workbench/browser/web.simpleservices.ts
+1
-1
src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts
...tensions/electron-browser/remoteExtensionManagementIpc.ts
+3
-2
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
f3c88424
...
...
@@ -151,7 +151,7 @@ export interface IExtensionGalleryService {
isEnabled
():
boolean
;
query
(
token
:
CancellationToken
):
Promise
<
IPager
<
IGalleryExtension
>>
;
query
(
options
:
IQueryOptions
,
token
:
CancellationToken
):
Promise
<
IPager
<
IGalleryExtension
>>
;
download
(
extension
:
IGalleryExtension
,
operation
:
InstallOperation
):
Promise
<
string
>
;
download
(
extension
:
IGalleryExtension
,
location
:
URI
,
operation
:
InstallOperation
):
Promise
<
URI
>
;
reportStatistic
(
publisher
:
string
,
name
:
string
,
version
:
string
,
type
:
StatisticType
):
Promise
<
void
>
;
getReadme
(
extension
:
IGalleryExtension
,
token
:
CancellationToken
):
Promise
<
string
>
;
getManifest
(
extension
:
IGalleryExtension
,
token
:
CancellationToken
):
Promise
<
IExtensionManifest
|
null
>
;
...
...
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
浏览文件 @
f3c88424
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
tmpdir
}
from
'
os
'
;
import
*
as
path
from
'
vs/base/common/path
'
;
import
{
getErrorMessage
,
isPromiseCanceledError
,
canceled
}
from
'
vs/base/common/errors
'
;
import
{
StatisticType
,
IGalleryExtension
,
IExtensionGalleryService
,
IGalleryExtensionAsset
,
IQueryOptions
,
SortBy
,
SortOrder
,
IExtensionIdentifier
,
IReportedExtension
,
InstallOperation
,
ITranslation
,
IGalleryExtensionVersion
,
IGalleryExtensionAssets
,
isIExtensionIdentifier
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
...
...
@@ -24,6 +23,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
joinPath
}
from
'
vs/base/common/resources
'
;
interface
IRawGalleryExtensionFile
{
assetType
:
string
;
...
...
@@ -535,9 +535,9 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
});
}
download
(
extension
:
IGalleryExtension
,
operation
:
InstallOperation
):
Promise
<
string
>
{
download
(
extension
:
IGalleryExtension
,
location
:
URI
,
operation
:
InstallOperation
):
Promise
<
URI
>
{
this
.
logService
.
trace
(
'
ExtensionGalleryService#download
'
,
extension
.
identifier
.
id
);
const
zip
Path
=
path
.
join
(
tmpdir
()
,
generateUuid
());
const
zip
=
joinPath
(
location
,
generateUuid
());
const
data
=
getGalleryExtensionTelemetryData
(
extension
);
const
startTime
=
new
Date
().
getTime
();
/* __GDPR__
...
...
@@ -557,9 +557,9 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
}
:
extension
.
assets
.
download
;
return
this
.
getAsset
(
downloadAsset
)
.
then
(
context
=>
this
.
fileService
.
writeFile
(
URI
.
file
(
zipPath
)
,
context
.
stream
))
.
then
(
context
=>
this
.
fileService
.
writeFile
(
zip
,
context
.
stream
))
.
then
(()
=>
log
(
new
Date
().
getTime
()
-
startTime
))
.
then
(()
=>
zip
Path
);
.
then
(()
=>
zip
);
}
getReadme
(
extension
:
IGalleryExtension
,
token
:
CancellationToken
):
Promise
<
string
>
{
...
...
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
f3c88424
...
...
@@ -391,9 +391,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
};
this
.
logService
.
trace
(
'
Started downloading extension:
'
,
extension
.
identifier
.
id
);
return
this
.
galleryService
.
download
(
extension
,
operation
)
return
this
.
galleryService
.
download
(
extension
,
URI
.
file
(
tmpdir
()),
operation
)
.
then
(
zipPath
=>
{
zip
=>
{
const
zipPath
=
zip
.
fsPath
;
this
.
logService
.
info
(
'
Downloaded extension:
'
,
extension
.
identifier
.
id
,
zipPath
);
return
getManifest
(
zipPath
)
.
then
(
...
...
src/vs/workbench/browser/web.simpleservices.ts
浏览文件 @
f3c88424
...
...
@@ -75,7 +75,7 @@ export class SimpleExtensionGalleryService implements IExtensionGalleryService {
return
Promise
.
resolve
(
undefined
);
}
download
(
extension
:
IGalleryExtension
,
operation
:
InstallOperation
):
Promise
<
string
>
{
download
(
extension
:
IGalleryExtension
,
location
:
URI
,
operation
:
InstallOperation
):
Promise
<
URI
>
{
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
}
...
...
src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts
浏览文件 @
f3c88424
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
tmpdir
}
from
'
os
'
;
import
{
IChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IExtensionManagementService
,
ILocalExtension
,
IGalleryExtension
,
IExtensionGalleryService
,
InstallOperation
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -79,8 +80,8 @@ export class RemoteExtensionManagementChannelClient extends ExtensionManagementC
}
private
async
downloadAndInstall
(
extension
:
IGalleryExtension
,
installed
:
ILocalExtension
[]):
Promise
<
ILocalExtension
>
{
const
location
=
await
this
.
galleryService
.
download
(
extension
,
installed
.
filter
(
i
=>
areSameExtensions
(
i
.
identifier
,
extension
.
identifier
))[
0
]
?
InstallOperation
.
Update
:
InstallOperation
.
Install
);
return
super
.
install
(
URI
.
file
(
location
)
);
const
location
=
await
this
.
galleryService
.
download
(
extension
,
URI
.
file
(
tmpdir
()),
installed
.
filter
(
i
=>
areSameExtensions
(
i
.
identifier
,
extension
.
identifier
))[
0
]
?
InstallOperation
.
Update
:
InstallOperation
.
Install
);
return
super
.
install
(
location
);
}
private
async
installUIDependenciesAndPackedExtensions
(
local
:
ILocalExtension
):
Promise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录