Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
397629a1
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
397629a1
编写于
6月 24, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
return local extension after install
上级
e899b1c6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
30 addition
and
27 deletion
+30
-27
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+2
-2
src/vs/platform/extensionManagement/node/extensionManagementIpc.ts
...atform/extensionManagement/node/extensionManagementIpc.ts
+7
-6
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+7
-7
src/vs/workbench/browser/web.simpleservices.ts
src/vs/workbench/browser/web.simpleservices.ts
+6
-4
src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts
...nch/contrib/extensions/node/extensionsWorkbenchService.ts
+3
-3
src/vs/workbench/services/extensions/node/multiExtensionManagement.ts
...ench/services/extensions/node/multiExtensionManagement.ts
+5
-5
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
397629a1
...
...
@@ -196,8 +196,8 @@ export interface IExtensionManagementService {
zip
(
extension
:
ILocalExtension
):
Promise
<
URI
>
;
unzip
(
zipLocation
:
URI
,
type
:
ExtensionType
):
Promise
<
IExtensionIdentifier
>
;
install
(
vsix
:
URI
):
Promise
<
I
ExtensionIdentifier
>
;
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
void
>
;
install
(
vsix
:
URI
):
Promise
<
I
LocalExtension
>
;
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
;
uninstall
(
extension
:
ILocalExtension
,
force
?:
boolean
):
Promise
<
void
>
;
reinstallFromGallery
(
extension
:
ILocalExtension
):
Promise
<
void
>
;
getInstalled
(
type
?:
ExtensionType
):
Promise
<
ILocalExtension
[]
>
;
...
...
src/vs/platform/extensionManagement/node/extensionManagementIpc.ts
浏览文件 @
397629a1
...
...
@@ -101,13 +101,14 @@ export class ExtensionManagementChannelClient implements IExtensionManagementSer
return
Promise
.
resolve
(
this
.
channel
.
call
(
'
unzip
'
,
[
zipLocation
,
type
]));
}
install
(
vsix
:
URI
):
Promise
<
I
ExtensionIdentifier
>
{
return
Promise
.
resolve
(
this
.
channel
.
call
(
'
install
'
,
[
vsix
]
));
install
(
vsix
:
URI
):
Promise
<
I
LocalExtension
>
{
return
Promise
.
resolve
(
this
.
channel
.
call
<
ILocalExtension
>
(
'
install
'
,
[
vsix
])).
then
(
local
=>
transformIncomingExtension
(
local
,
null
));
}
async
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
void
>
{
async
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
{
try
{
await
Promise
.
resolve
(
this
.
channel
.
call
(
'
installFromGallery
'
,
[
extension
]));
const
local
=
await
Promise
.
resolve
(
this
.
channel
.
call
<
ILocalExtension
>
(
'
installFromGallery
'
,
[
extension
]));
return
transformIncomingExtension
(
local
,
null
);
}
catch
(
error
)
{
if
(
this
.
remote
)
{
try
{
...
...
@@ -117,9 +118,9 @@ export class ExtensionManagementChannelClient implements IExtensionManagementSer
if
(
compatible
)
{
const
installed
=
await
this
.
getInstalled
(
ExtensionType
.
User
);
const
location
=
await
this
.
galleryService
.
download
(
compatible
,
installed
.
filter
(
i
=>
areSameExtensions
(
i
.
identifier
,
extension
.
identifier
))[
0
]
?
InstallOperation
.
Update
:
InstallOperation
.
Install
);
await
this
.
install
(
URI
.
file
(
location
));
const
local
=
await
this
.
install
(
URI
.
file
(
location
));
this
.
logService
.
info
(
`Successfully installed '
${
extension
.
identifier
.
id
}
' extension`
);
return
;
return
local
;
}
}
catch
(
e
)
{
this
.
logService
.
error
(
e
);
...
...
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
397629a1
...
...
@@ -109,7 +109,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
private
uninstalledFileLimiter
:
Queue
<
any
>
;
private
reportedExtensions
:
Promise
<
IReportedExtension
[]
>
|
undefined
;
private
lastReportTimestamp
=
0
;
private
readonly
installingExtensions
:
Map
<
string
,
CancelablePromise
<
void
>>
=
new
Map
<
string
,
CancelablePromise
<
void
>>
();
private
readonly
installingExtensions
:
Map
<
string
,
CancelablePromise
<
ILocalExtension
>>
=
new
Map
<
string
,
CancelablePromise
<
ILocalExtension
>>
();
private
readonly
uninstallingExtensions
:
Map
<
string
,
CancelablePromise
<
void
>>
=
new
Map
<
string
,
CancelablePromise
<
void
>>
();
private
readonly
manifestCache
:
ExtensionsManifestCache
;
private
readonly
extensionLifecycle
:
ExtensionsLifecycle
;
...
...
@@ -158,7 +158,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
unzip
(
zipLocation
:
URI
,
type
:
ExtensionType
):
Promise
<
IExtensionIdentifier
>
{
this
.
logService
.
trace
(
'
ExtensionManagementService#unzip
'
,
zipLocation
.
toString
());
return
this
.
install
(
zipLocation
,
type
);
return
this
.
install
(
zipLocation
,
type
)
.
then
(
local
=>
local
.
identifier
)
;
}
private
collectFiles
(
extension
:
ILocalExtension
):
Promise
<
IFile
[]
>
{
...
...
@@ -187,7 +187,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
}
install
(
vsix
:
URI
,
type
:
ExtensionType
=
ExtensionType
.
User
):
Promise
<
I
ExtensionIdentifier
>
{
install
(
vsix
:
URI
,
type
:
ExtensionType
=
ExtensionType
.
User
):
Promise
<
I
LocalExtension
>
{
this
.
logService
.
trace
(
'
ExtensionManagementService#install
'
,
vsix
.
toString
());
return
createCancelablePromise
(
token
=>
{
return
this
.
downloadVsix
(
vsix
).
then
(
downloadLocation
=>
{
...
...
@@ -222,7 +222,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
metadata
=>
this
.
installFromZipPath
(
identifierWithVersion
,
zipPath
,
metadata
,
type
,
operation
,
token
),
()
=>
this
.
installFromZipPath
(
identifierWithVersion
,
zipPath
,
null
,
type
,
operation
,
token
))
.
then
(
()
=>
{
this
.
logService
.
info
(
'
Successfully installed the extension:
'
,
identifier
.
id
);
return
identifier
;
},
local
=>
{
this
.
logService
.
info
(
'
Successfully installed the extension:
'
,
identifier
.
id
);
return
local
;
},
e
=>
{
this
.
logService
.
error
(
'
Failed to install the extension:
'
,
identifier
.
id
,
e
.
message
);
return
Promise
.
reject
(
e
);
...
...
@@ -264,7 +264,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
));
}
async
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
void
>
{
async
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
{
if
(
!
this
.
galleryService
.
isEnabled
())
{
return
Promise
.
reject
(
new
Error
(
nls
.
localize
(
'
MarketPlaceDisabled
'
,
"
Marketplace is not enabled
"
)));
}
...
...
@@ -301,7 +301,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
this
.
_onInstallExtension
.
fire
({
identifier
:
extension
.
identifier
,
gallery
:
extension
});
let
operation
:
InstallOperation
=
InstallOperation
.
Install
;
let
cancellationToken
:
CancellationToken
,
successCallback
:
(
a
?:
any
)
=>
void
,
errorCallback
:
(
e
?:
any
)
=>
any
|
null
;
let
cancellationToken
:
CancellationToken
,
successCallback
:
(
local
:
ILocalExtension
)
=>
void
,
errorCallback
:
(
e
?:
any
)
=>
any
|
null
;
cancellablePromise
=
createCancelablePromise
(
token
=>
{
cancellationToken
=
token
;
return
new
Promise
((
c
,
e
)
=>
{
successCallback
=
c
;
errorCallback
=
e
;
});
});
this
.
installingExtensions
.
set
(
key
,
cancellablePromise
);
try
{
...
...
@@ -323,7 +323,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
}
this
.
installingExtensions
.
delete
(
key
);
onDidInstallExtensionSuccess
(
extension
,
operation
,
local
);
successCallback
(
nul
l
);
successCallback
(
loca
l
);
},
error
=>
{
this
.
installingExtensions
.
delete
(
key
);
...
...
src/vs/workbench/browser/web.simpleservices.ts
浏览文件 @
397629a1
...
...
@@ -401,12 +401,13 @@ export class SimpleExtensionManagementService implements IExtensionManagementSer
return
Promise
.
resolve
(
undefined
);
}
install
(
vsix
:
URI
):
Promise
<
I
ExtensionIdentifier
>
{
install
(
vsix
:
URI
):
Promise
<
I
LocalExtension
>
{
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
}
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
void
>
{
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
{
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
}
...
...
@@ -488,12 +489,13 @@ export class SimpleMultiExtensionsManagementService implements IExtensionManagem
return
Promise
.
resolve
(
undefined
);
}
install
(
vsix
:
URI
):
Promise
<
I
ExtensionIdentifier
>
{
install
(
vsix
:
URI
):
Promise
<
I
LocalExtension
>
{
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
}
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
void
>
{
installFromGallery
(
extension
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
{
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
}
...
...
src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts
浏览文件 @
397629a1
...
...
@@ -761,9 +761,9 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
install
(
extension
:
string
|
IExtension
):
Promise
<
IExtension
>
{
if
(
typeof
extension
===
'
string
'
)
{
return
this
.
installWithProgress
(
async
()
=>
{
const
extensionIdentifier
=
await
this
.
extensionService
.
install
(
URI
.
file
(
extension
));
this
.
checkAndEnableDisabledDependencies
(
extensionI
dentifier
);
return
this
.
local
.
filter
(
local
=>
areSameExtensions
(
local
.
identifier
,
extensionI
dentifier
))[
0
];
const
{
identifier
}
=
await
this
.
extensionService
.
install
(
URI
.
file
(
extension
));
this
.
checkAndEnableDisabledDependencies
(
i
dentifier
);
return
this
.
local
.
filter
(
local
=>
areSameExtensions
(
local
.
identifier
,
i
dentifier
))[
0
];
});
}
...
...
src/vs/workbench/services/extensions/node/multiExtensionManagement.ts
浏览文件 @
397629a1
...
...
@@ -134,13 +134,13 @@ export class MultiExtensionManagementService extends Disposable implements IExte
return
Promise
.
all
(
this
.
servers
.
map
(({
extensionManagementService
})
=>
extensionManagementService
.
unzip
(
zipLocation
,
type
))).
then
(([
extensionIdentifier
])
=>
extensionIdentifier
);
}
async
install
(
vsix
:
URI
):
Promise
<
I
ExtensionIdentifier
>
{
async
install
(
vsix
:
URI
):
Promise
<
I
LocalExtension
>
{
if
(
this
.
extensionManagementServerService
.
remoteExtensionManagementServer
)
{
const
manifest
=
await
getManifest
(
vsix
.
fsPath
);
if
(
isLanguagePackExtension
(
manifest
))
{
// Install on both servers
const
[
extensionIdentifier
]
=
await
Promise
.
all
(
this
.
servers
.
map
(
server
=>
server
.
extensionManagementService
.
install
(
vsix
)));
return
extensionIdentifier
;
const
[
local
]
=
await
Promise
.
all
(
this
.
servers
.
map
(
server
=>
server
.
extensionManagementService
.
install
(
vsix
)));
return
local
;
}
if
(
isUIExtension
(
manifest
,
this
.
productService
,
this
.
configurationService
))
{
// Install only on local server
...
...
@@ -155,13 +155,13 @@ export class MultiExtensionManagementService extends Disposable implements IExte
return
this
.
extensionManagementServerService
.
localExtensionManagementServer
.
extensionManagementService
.
install
(
vsix
);
}
async
installFromGallery
(
gallery
:
IGalleryExtension
):
Promise
<
void
>
{
async
installFromGallery
(
gallery
:
IGalleryExtension
):
Promise
<
ILocalExtension
>
{
if
(
this
.
extensionManagementServerService
.
remoteExtensionManagementServer
)
{
const
manifest
=
await
this
.
extensionGalleryService
.
getManifest
(
gallery
,
CancellationToken
.
None
);
if
(
manifest
)
{
if
(
isLanguagePackExtension
(
manifest
))
{
// Install on both servers
return
Promise
.
all
(
this
.
servers
.
map
(
server
=>
server
.
extensionManagementService
.
installFromGallery
(
gallery
))).
then
((
)
=>
undefined
);
return
Promise
.
all
(
this
.
servers
.
map
(
server
=>
server
.
extensionManagementService
.
installFromGallery
(
gallery
))).
then
((
[
local
])
=>
local
);
}
if
(
isUIExtension
(
manifest
,
this
.
productService
,
this
.
configurationService
))
{
// Install only on local server
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录