Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cf879447
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,发现更多精彩内容 >>
提交
cf879447
编写于
5月 23, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
do not check for ui extensions while installing on remote server
上级
8aa90d44
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
84 deletion
+47
-84
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
.../code/electron-browser/sharedProcess/sharedProcessMain.ts
+1
-1
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+2
-14
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+2
-15
src/vs/platform/extensions/node/extensionsUtil.ts
src/vs/platform/extensions/node/extensionsUtil.ts
+0
-51
src/vs/workbench/services/extensions/node/extensionsUtil.ts
src/vs/workbench/services/extensions/node/extensionsUtil.ts
+42
-3
未找到文件。
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
浏览文件 @
cf879447
...
...
@@ -144,7 +144,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
}
server
.
registerChannel
(
'
telemetryAppender
'
,
new
TelemetryAppenderChannel
(
appInsightsAppender
));
services
.
set
(
IExtensionManagementService
,
new
SyncDescriptor
(
ExtensionManagementService
,
[
false
]
));
services
.
set
(
IExtensionManagementService
,
new
SyncDescriptor
(
ExtensionManagementService
));
services
.
set
(
IExtensionGalleryService
,
new
SyncDescriptor
(
ExtensionGalleryService
));
services
.
set
(
ILocalizationsService
,
new
SyncDescriptor
(
LocalizationsService
));
...
...
src/vs/code/node/cliProcessMain.ts
浏览文件 @
cf879447
...
...
@@ -38,7 +38,6 @@ import { areSameExtensions, adoptToGalleryExtensionId, getGalleryExtensionId } f
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
getManifest
}
from
'
vs/platform/extensionManagement/node/extensionManagementUtil
'
;
import
{
IExtensionManifest
,
ExtensionType
,
isLanguagePackExtension
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
isUIExtension
}
from
'
vs/platform/extensions/node/extensionsUtil
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
LocalizationsService
}
from
'
vs/platform/localizations/node/localizations
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
...
...
@@ -69,10 +68,8 @@ export function getIdAndVersion(id: string): [string, string | undefined] {
export
class
Main
{
constructor
(
private
readonly
remote
:
boolean
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IExtensionManagementService
private
readonly
extensionManagementService
:
IExtensionManagementService
,
@
IExtensionGalleryService
private
readonly
extensionGalleryService
:
IExtensionGalleryService
)
{
}
...
...
@@ -138,10 +135,6 @@ export class Main {
extension
=
path
.
isAbsolute
(
extension
)
?
extension
:
path
.
join
(
process
.
cwd
(),
extension
);
const
manifest
=
await
getManifest
(
extension
);
if
(
this
.
remote
&&
(
!
isLanguagePackExtension
(
manifest
)
&&
isUIExtension
(
manifest
,
[],
this
.
configurationService
)))
{
console
.
log
(
localize
(
'
notSupportedUIExtension
'
,
"
Can't install extension {0} since UI Extensions are not supported
"
,
getBaseLabel
(
extension
)));
return
null
;
}
const
valid
=
await
this
.
validate
(
manifest
,
force
);
if
(
valid
)
{
...
...
@@ -180,11 +173,6 @@ export class Main {
}
const
manifest
=
await
this
.
extensionGalleryService
.
getManifest
(
extension
,
CancellationToken
.
None
);
if
(
this
.
remote
&&
manifest
&&
(
!
isLanguagePackExtension
(
manifest
)
&&
isUIExtension
(
manifest
,
[],
this
.
configurationService
)))
{
console
.
log
(
localize
(
'
notSupportedUIExtension
'
,
"
Can't install extension {0} since UI Extensions are not supported
"
,
extension
.
identifier
.
id
));
return
null
;
}
const
[
installedExtension
]
=
installed
.
filter
(
e
=>
areSameExtensions
(
e
.
identifier
,
{
id
}));
if
(
installedExtension
)
{
if
(
extension
.
version
===
installedExtension
.
manifest
.
version
)
{
...
...
@@ -312,7 +300,7 @@ export function main(argv: ParsedArgs): Promise<void> {
const
services
=
new
ServiceCollection
();
services
.
set
(
IConfigurationService
,
new
SyncDescriptor
(
ConfigurationService
,
[
environmentService
.
appSettingsPath
]));
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
services
.
set
(
IExtensionManagementService
,
new
SyncDescriptor
(
ExtensionManagementService
,
[
false
]
));
services
.
set
(
IExtensionManagementService
,
new
SyncDescriptor
(
ExtensionManagementService
));
services
.
set
(
IExtensionGalleryService
,
new
SyncDescriptor
(
ExtensionGalleryService
));
const
appenders
:
AppInsightsAppender
[]
=
[];
...
...
@@ -334,7 +322,7 @@ export function main(argv: ParsedArgs): Promise<void> {
}
const
instantiationService2
=
instantiationService
.
createChild
(
services
);
const
main
=
instantiationService2
.
createInstance
(
Main
,
false
);
const
main
=
instantiationService2
.
createInstance
(
Main
);
return
main
.
run
(
argv
).
then
(()
=>
{
// Dispose the AI adapter so that remaining data gets flushed.
...
...
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
cf879447
...
...
@@ -44,9 +44,7 @@ import { Schemas } from 'vs/base/common/network';
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
getManifest
}
from
'
vs/platform/extensionManagement/node/extensionManagementUtil
'
;
import
{
IExtensionManifest
,
ExtensionType
,
ExtensionIdentifierWithVersion
,
isLanguagePackExtension
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
isUIExtension
}
from
'
vs/platform/extensions/node/extensionsUtil
'
;
import
{
IExtensionManifest
,
ExtensionType
,
ExtensionIdentifierWithVersion
}
from
'
vs/platform/extensions/common/extensions
'
;
const
ERROR_SCANNING_SYS_EXTENSIONS
=
'
scanningSystem
'
;
const
ERROR_SCANNING_USER_EXTENSIONS
=
'
scanningUser
'
;
...
...
@@ -129,9 +127,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
onDidUninstallExtension
:
Event
<
DidUninstallExtensionEvent
>
=
this
.
_onDidUninstallExtension
.
event
;
constructor
(
private
readonly
remote
:
boolean
,
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IExtensionGalleryService
private
readonly
galleryService
:
IExtensionGalleryService
,
@
ILogService
private
readonly
logService
:
ILogService
,
@
optional
(
IDownloadService
)
private
downloadService
:
IDownloadService
,
...
...
@@ -506,16 +502,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
return
this
.
galleryService
.
query
({
names
,
pageSize
:
dependenciesAndPackExtensions
.
length
},
CancellationToken
.
None
)
.
then
(
galleryResult
=>
{
const
extensionsToInstall
=
galleryResult
.
firstPage
;
return
Promise
.
all
(
extensionsToInstall
.
map
(
async
e
=>
{
if
(
this
.
remote
)
{
const
manifest
=
await
this
.
galleryService
.
getManifest
(
e
,
CancellationToken
.
None
);
if
(
manifest
&&
isUIExtension
(
manifest
,
[],
this
.
configurationService
)
&&
!
isLanguagePackExtension
(
manifest
))
{
this
.
logService
.
info
(
'
Ignored installing the UI dependency
'
,
e
.
identifier
.
id
);
return
;
}
}
return
this
.
installFromGallery
(
e
);
}))
return
Promise
.
all
(
extensionsToInstall
.
map
(
e
=>
this
.
installFromGallery
(
e
)))
.
then
(()
=>
null
,
errors
=>
this
.
rollback
(
extensionsToInstall
).
then
(()
=>
Promise
.
reject
(
errors
),
()
=>
Promise
.
reject
(
errors
)));
});
}
...
...
src/vs/platform/extensions/node/extensionsUtil.ts
已删除
100644 → 0
浏览文件 @
8aa90d44
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
getGalleryExtensionId
,
areSameExtensions
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
product
from
'
vs/platform/product/node/product
'
;
export
function
isUIExtension
(
manifest
:
IExtensionManifest
,
uiContributions
:
string
[],
configurationService
:
IConfigurationService
):
boolean
{
const
extensionId
=
getGalleryExtensionId
(
manifest
.
publisher
,
manifest
.
name
);
const
extensionKind
=
getExtensionKind
(
manifest
,
configurationService
);
switch
(
extensionKind
)
{
case
'
ui
'
:
return
true
;
case
'
workspace
'
:
return
false
;
default
:
{
// Tagged as UI extension in product
if
(
isNonEmptyArray
(
product
.
uiExtensions
)
&&
product
.
uiExtensions
.
some
(
id
=>
areSameExtensions
({
id
},
{
id
:
extensionId
})))
{
return
true
;
}
// Not an UI extension if it has main
if
(
manifest
.
main
)
{
return
false
;
}
// Not an UI extension if it has dependencies or an extension pack
if
(
isNonEmptyArray
(
manifest
.
extensionDependencies
)
||
isNonEmptyArray
(
manifest
.
extensionPack
))
{
return
false
;
}
if
(
manifest
.
contributes
)
{
// Not an UI extension if it has no ui contributions
if
(
!
uiContributions
.
length
||
Object
.
keys
(
manifest
.
contributes
).
some
(
contribution
=>
uiContributions
.
indexOf
(
contribution
)
===
-
1
))
{
return
false
;
}
}
return
true
;
}
}
}
function
getExtensionKind
(
manifest
:
IExtensionManifest
,
configurationService
:
IConfigurationService
):
string
|
undefined
{
const
extensionId
=
getGalleryExtensionId
(
manifest
.
publisher
,
manifest
.
name
);
const
configuredExtensionKinds
=
configurationService
.
getValue
<
{
[
key
:
string
]:
string
}
>
(
'
remote.extensionKind
'
)
||
{};
for
(
const
id
of
Object
.
keys
(
configuredExtensionKinds
))
{
if
(
areSameExtensions
({
id
:
extensionId
},
{
id
}))
{
return
configuredExtensionKinds
[
id
];
}
}
return
manifest
.
extensionKind
;
}
src/vs/workbench/services/extensions/node/extensionsUtil.ts
浏览文件 @
cf879447
...
...
@@ -6,9 +6,48 @@
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ExtensionsRegistry
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
isUIExtension
as
_isUIExtension
}
from
'
vs/platform/extensions/node/extensionsUtil
'
;
import
{
getGalleryExtensionId
,
areSameExtensions
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
isNonEmptyArray
}
from
'
vs/base/common/arrays
'
;
import
product
from
'
vs/platform/product/node/product
'
;
export
function
isUIExtension
(
manifest
:
IExtensionManifest
,
configurationService
:
IConfigurationService
):
boolean
{
const
uiExtensionPoints
=
ExtensionsRegistry
.
getExtensionPoints
().
filter
(
e
=>
e
.
defaultExtensionKind
!==
'
workspace
'
).
map
(
e
=>
e
.
name
);
return
_isUIExtension
(
manifest
,
uiExtensionPoints
,
configurationService
);
const
uiContributions
=
ExtensionsRegistry
.
getExtensionPoints
().
filter
(
e
=>
e
.
defaultExtensionKind
!==
'
workspace
'
).
map
(
e
=>
e
.
name
);
const
extensionId
=
getGalleryExtensionId
(
manifest
.
publisher
,
manifest
.
name
);
const
extensionKind
=
getExtensionKind
(
manifest
,
configurationService
);
switch
(
extensionKind
)
{
case
'
ui
'
:
return
true
;
case
'
workspace
'
:
return
false
;
default
:
{
// Tagged as UI extension in product
if
(
isNonEmptyArray
(
product
.
uiExtensions
)
&&
product
.
uiExtensions
.
some
(
id
=>
areSameExtensions
({
id
},
{
id
:
extensionId
})))
{
return
true
;
}
// Not an UI extension if it has main
if
(
manifest
.
main
)
{
return
false
;
}
// Not an UI extension if it has dependencies or an extension pack
if
(
isNonEmptyArray
(
manifest
.
extensionDependencies
)
||
isNonEmptyArray
(
manifest
.
extensionPack
))
{
return
false
;
}
if
(
manifest
.
contributes
)
{
// Not an UI extension if it has no ui contributions
if
(
!
uiContributions
.
length
||
Object
.
keys
(
manifest
.
contributes
).
some
(
contribution
=>
uiContributions
.
indexOf
(
contribution
)
===
-
1
))
{
return
false
;
}
}
return
true
;
}
}
}
function
getExtensionKind
(
manifest
:
IExtensionManifest
,
configurationService
:
IConfigurationService
):
string
|
undefined
{
const
extensionId
=
getGalleryExtensionId
(
manifest
.
publisher
,
manifest
.
name
);
const
configuredExtensionKinds
=
configurationService
.
getValue
<
{
[
key
:
string
]:
string
}
>
(
'
remote.extensionKind
'
)
||
{};
for
(
const
id
of
Object
.
keys
(
configuredExtensionKinds
))
{
if
(
areSameExtensions
({
id
:
extensionId
},
{
id
}))
{
return
configuredExtensionKinds
[
id
];
}
}
return
manifest
.
extensionKind
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录