Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c473c552
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,发现更多精彩内容 >>
提交
c473c552
编写于
6月 18, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #52077
上级
79b64c4f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
26 deletion
+29
-26
src/vs/platform/extensionManagement/node/extensionLifecycle.ts
...s/platform/extensionManagement/node/extensionLifecycle.ts
+2
-1
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+2
-2
src/vs/platform/localizations/node/localizations.ts
src/vs/platform/localizations/node/localizations.ts
+2
-1
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
...bench/parts/extensions/node/extensionsWorkbenchService.ts
+2
-2
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
...xtensions/test/electron-browser/extensionsActions.test.ts
+19
-18
src/vs/workbench/services/extensions/node/extensionManagementServerService.ts
...vices/extensions/node/extensionManagementServerService.ts
+2
-2
未找到文件。
src/vs/platform/extensionManagement/node/extensionLifecycle.ts
浏览文件 @
c473c552
...
...
@@ -13,6 +13,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
{
join
}
from
'
vs/base/common/paths
'
;
import
{
Limiter
}
from
'
vs/base/common/async
'
;
import
{
fromNodeEventEmitter
,
anyEvent
,
mapEvent
,
debounceEvent
}
from
'
vs/base/common/event
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
class
ExtensionsLifecycle
extends
Disposable
{
...
...
@@ -36,7 +37,7 @@ export class ExtensionsLifecycle extends Disposable {
}
private
parseUninstallScript
(
extension
:
ILocalExtension
):
{
uninstallHook
:
string
,
args
:
string
[]
}
{
if
(
extension
.
manifest
&&
extension
.
manifest
[
'
scripts
'
]
&&
typeof
extension
.
manifest
[
'
scripts
'
][
'
vscode:uninstall
'
]
===
'
string
'
)
{
if
(
extension
.
location
.
scheme
===
Schemas
.
file
&&
extension
.
manifest
&&
extension
.
manifest
[
'
scripts
'
]
&&
typeof
extension
.
manifest
[
'
scripts
'
][
'
vscode:uninstall
'
]
===
'
string
'
)
{
const
uninstallScript
=
(
<
string
>
extension
.
manifest
[
'
scripts
'
][
'
vscode:uninstall
'
]).
split
(
'
'
);
if
(
uninstallScript
.
length
<
2
||
uninstallScript
[
0
]
!==
'
node
'
||
!
uninstallScript
[
1
])
{
this
.
logService
.
warn
(
extension
.
identifier
.
id
,
'
Uninstall script should be a node script
'
);
...
...
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
c473c552
...
...
@@ -658,7 +658,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
}
private
preUninstallExtension
(
extension
:
ILocalExtension
):
TPromise
<
void
>
{
return
pfs
.
exists
(
extension
.
location
.
p
ath
)
return
pfs
.
exists
(
extension
.
location
.
fsP
ath
)
.
then
(
exists
=>
exists
?
null
:
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
notExists
'
,
"
Could not find extension
"
))))
.
then
(()
=>
{
this
.
logService
.
info
(
'
Uninstalling extension:
'
,
extension
.
identifier
.
id
);
...
...
@@ -788,7 +788,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
private
removeExtension
(
extension
:
ILocalExtension
,
type
:
string
):
TPromise
<
void
>
{
this
.
logService
.
trace
(
`Deleting
${
type
}
extension from disk`
,
extension
.
identifier
.
id
);
return
pfs
.
rimraf
(
extension
.
location
.
p
ath
).
then
(()
=>
this
.
logService
.
info
(
'
Deleted from disk
'
,
extension
.
identifier
.
id
));
return
pfs
.
rimraf
(
extension
.
location
.
fsP
ath
).
then
(()
=>
this
.
logService
.
info
(
'
Deleted from disk
'
,
extension
.
identifier
.
id
));
}
private
isUninstalled
(
id
:
string
):
TPromise
<
boolean
>
{
...
...
src/vs/platform/localizations/node/localizations.ts
浏览文件 @
c473c552
...
...
@@ -17,6 +17,7 @@ import { isValidLocalization, ILocalizationsService, LanguageType } from 'vs/pla
import
product
from
'
vs/platform/node/product
'
;
import
{
distinct
,
equals
}
from
'
vs/base/common/arrays
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
interface
ILanguagePack
{
hash
:
string
;
...
...
@@ -138,7 +139,7 @@ class LanguagePacksCache extends Disposable {
private
createLanguagePacksFromExtension
(
languagePacks
:
{
[
language
:
string
]:
ILanguagePack
},
extension
:
ILocalExtension
):
void
{
const
extensionIdentifier
=
{
id
:
getGalleryExtensionIdFromLocal
(
extension
),
uuid
:
extension
.
identifier
.
uuid
};
for
(
const
localizationContribution
of
extension
.
manifest
.
contributes
.
localizations
)
{
if
(
isValidLocalization
(
localizationContribution
))
{
if
(
extension
.
location
.
scheme
===
Schemas
.
file
&&
isValidLocalization
(
localizationContribution
))
{
let
languagePack
=
languagePacks
[
localizationContribution
.
languageId
];
if
(
!
languagePack
)
{
languagePack
=
{
hash
:
''
,
extensions
:
[],
translations
:
{}
};
...
...
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
浏览文件 @
c473c552
...
...
@@ -8,7 +8,6 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
readFile
}
from
'
vs/base/node/pfs
'
;
import
*
as
semver
from
'
semver
'
;
import
*
as
path
from
'
path
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
index
}
from
'
vs/base/common/arrays
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
...
...
@@ -40,6 +39,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
groupBy
}
from
'
vs/base/common/collections
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
join
}
from
'
vs/base/common/paths
'
;
interface
IExtensionStateProvider
<
T
>
{
(
extension
:
Extension
):
T
;
...
...
@@ -138,7 +138,7 @@ class Extension implements IExtension {
private
get
localIconUrl
():
string
{
if
(
this
.
local
&&
this
.
local
.
manifest
.
icon
)
{
return
this
.
local
.
location
.
with
({
path
:
path
.
join
(
this
.
local
.
location
.
path
,
this
.
local
.
manifest
.
icon
)
}).
toString
();
return
this
.
local
.
location
.
with
({
path
:
join
(
this
.
local
.
location
.
path
,
this
.
local
.
manifest
.
icon
)
}).
toString
();
}
return
null
;
}
...
...
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
浏览文件 @
c473c552
...
...
@@ -36,6 +36,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows';
import
{
URLService
}
from
'
vs/platform/url/common/urlService
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
ExtensionManagementServerService
}
from
'
vs/workbench/services/extensions/node/extensionManagementServerService
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
suite
(
'
ExtensionsActions Test
'
,
()
=>
{
...
...
@@ -94,14 +95,14 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Install action is disabled when there is no extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
assert
.
ok
(
!
testObject
.
enabled
);
});
test
(
'
Test Install action when state is installed
'
,
()
=>
{
const
workbenchService
=
instantiationService
.
get
(
IExtensionsWorkbenchService
);
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
return
workbenchService
.
queryLocal
()
...
...
@@ -119,7 +120,7 @@ suite('ExtensionsActions Test', () => {
test
(
'
Test Install action when state is installing
'
,
()
=>
{
const
workbenchService
=
instantiationService
.
get
(
IExtensionsWorkbenchService
);
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
gallery
=
aGalleryExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionGalleryService
,
'
query
'
,
aPage
(
gallery
));
return
workbenchService
.
queryGallery
()
...
...
@@ -135,7 +136,7 @@ suite('ExtensionsActions Test', () => {
test
(
'
Test Install action when state is uninstalled
'
,
()
=>
{
const
workbenchService
=
instantiationService
.
get
(
IExtensionsWorkbenchService
);
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
gallery
=
aGalleryExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionGalleryService
,
'
query
'
,
aPage
(
gallery
));
return
workbenchService
.
queryGallery
()
...
...
@@ -147,7 +148,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test Install action when extension is system action
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{},
{
type
:
LocalExtensionType
.
System
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -161,7 +162,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test Install action when extension doesnot has gallery
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
InstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
InstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -242,14 +243,14 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test CombinedInstallAction when there is no extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
assert
.
ok
(
!
testObject
.
enabled
);
assert
.
equal
(
'
extension-action prominent install no-extension
'
,
testObject
.
class
);
});
test
(
'
Test CombinedInstallAction when extension is system extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{},
{
type
:
LocalExtensionType
.
System
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -263,7 +264,7 @@ suite('ExtensionsActions Test', () => {
test
(
'
Test CombinedInstallAction when installAction is enabled
'
,
()
=>
{
const
workbenchService
=
instantiationService
.
get
(
IExtensionsWorkbenchService
);
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
gallery
=
aGalleryExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionGalleryService
,
'
query
'
,
aPage
(
gallery
));
...
...
@@ -277,7 +278,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test CombinedInstallAction when unInstallAction is enabled
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -291,7 +292,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test CombinedInstallAction when state is installing
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
workbenchService
=
instantiationService
.
get
(
IExtensionsWorkbenchService
);
const
gallery
=
aGalleryExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionGalleryService
,
'
query
'
,
aPage
(
gallery
));
...
...
@@ -307,7 +308,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test CombinedInstallAction when state is uninstalling
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
CombinedInstallAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
CombinedInstallAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
);
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -322,13 +323,13 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test UpdateAction when there is no extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
assert
.
ok
(
!
testObject
.
enabled
);
});
test
(
'
Test UpdateAction when extension is uninstalled
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
gallery
=
aGalleryExtension
(
'
a
'
,
{
version
:
'
1.0.0
'
});
instantiationService
.
stubPromise
(
IExtensionGalleryService
,
'
query
'
,
aPage
(
gallery
));
return
instantiationService
.
get
(
IExtensionsWorkbenchService
).
queryGallery
()
...
...
@@ -339,7 +340,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test UpdateAction when extension is installed and not outdated
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{
version
:
'
1.0.0
'
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -353,7 +354,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test UpdateAction when extension is installed outdated and system extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{
version
:
'
1.0.0
'
},
{
type
:
LocalExtensionType
.
System
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -367,7 +368,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test UpdateAction when extension is installed outdated and user extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{
version
:
'
1.0.0
'
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
@@ -381,7 +382,7 @@ suite('ExtensionsActions Test', () => {
});
test
(
'
Test UpdateAction when extension is installing and outdated and user extension
'
,
()
=>
{
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
});
const
testObject
:
ExtensionsActions
.
UpdateAction
=
instantiationService
.
createInstance
(
ExtensionsActions
.
UpdateAction
,
<
IExtensionManagementServer
>
{
extensionManagementService
:
null
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
});
const
local
=
aLocalExtension
(
'
a
'
,
{
version
:
'
1.0.0
'
});
instantiationService
.
stubPromise
(
IExtensionManagementService
,
'
getInstalled
'
,
[
local
]);
...
...
src/vs/workbench/services/extensions/node/extensionManagementServerService.ts
浏览文件 @
c473c552
...
...
@@ -16,7 +16,7 @@ export class ExtensionManagementServerService implements IExtensionManagementSer
constructor
(
localExtensionManagementService
:
IExtensionManagementService
)
{
this
.
extensionManagementServers
=
[{
extensionManagementService
:
localExtensionManagementService
,
location
:
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
}];
this
.
extensionManagementServers
=
[{
extensionManagementService
:
localExtensionManagementService
,
location
:
URI
.
from
({
scheme
:
Schemas
.
file
})
}];
}
getExtensionManagementServer
(
location
:
URI
):
IExtensionManagementServer
{
...
...
@@ -37,7 +37,7 @@ export class SingleServerExtensionManagementServerService implements IExtensionM
}
getExtensionManagementServer
(
location
:
URI
):
IExtensionManagementServer
{
location
=
location
.
scheme
===
Schemas
.
file
?
URI
.
from
({
scheme
:
'
vscode-local
'
,
authority
:
'
local
'
})
:
location
;
location
=
location
.
scheme
===
Schemas
.
file
?
URI
.
from
({
scheme
:
Schemas
.
file
})
:
location
;
return
this
.
extensionManagementServers
.
filter
(
server
=>
location
.
authority
===
server
.
location
.
authority
)[
0
];
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录