Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
868e4fb7
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,发现更多精彩内容 >>
提交
868e4fb7
编写于
5月 07, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revive extensionLocation when reading from cache
上级
2e6ebd91
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
19 deletion
+24
-19
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+7
-3
src/vs/workbench/services/extensions/node/extensionPoints.ts
src/vs/workbench/services/extensions/node/extensionPoints.ts
+17
-16
未找到文件。
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
868e4fb7
...
...
@@ -20,7 +20,7 @@ import { USER_MANIFEST_CACHE_FILE, BUILTIN_MANIFEST_CACHE_FILE, MANIFEST_CACHE_F
import
{
IExtensionEnablementService
,
IExtensionIdentifier
,
EnablementState
,
IExtensionManagementService
,
LocalExtensionType
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
areSameExtensions
,
BetterMergeId
,
BetterMergeDisabledNowKey
,
getGalleryExtensionIdFromLocal
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
ExtensionsRegistry
,
ExtensionPoint
,
IExtensionPointUser
,
ExtensionMessageCollector
,
IExtensionPoint
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
ExtensionScanner
,
ILog
,
ExtensionScannerInput
,
IExtensionResolver
,
IExtensionReference
,
Translations
}
from
'
vs/workbench/services/extensions/node/extensionPoints
'
;
import
{
ExtensionScanner
,
ILog
,
ExtensionScannerInput
,
IExtensionResolver
,
IExtensionReference
,
Translations
,
IRelaxedExtensionDescription
}
from
'
vs/workbench/services/extensions/node/extensionPoints
'
;
import
{
ProxyIdentifier
}
from
'
vs/workbench/services/extensions/node/proxyIdentifier
'
;
import
{
ExtHostContext
,
ExtHostExtensionServiceShape
,
IExtHostContext
,
MainContext
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
...
...
@@ -630,7 +630,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
const
cacheFolder
=
path
.
join
(
environmentService
.
userDataPath
,
MANIFEST_CACHE_FOLDER
);
const
cacheFile
=
path
.
join
(
cacheFolder
,
cacheKey
);
const
expected
=
await
ExtensionScanner
.
scanExtensions
(
input
,
new
NullLogger
(
));
const
expected
=
JSON
.
parse
(
JSON
.
stringify
(
await
ExtensionScanner
.
scanExtensions
(
input
,
new
NullLogger
())
));
const
cacheContents
=
await
this
.
_readExtensionCache
(
environmentService
,
cacheKey
);
if
(
!
cacheContents
)
{
...
...
@@ -715,7 +715,11 @@ export class ExtensionService extends Disposable implements IExtensionService {
errors
.
onUnexpectedError
(
err
);
}
},
5000
);
return
cacheContents
.
result
;
return
cacheContents
.
result
.
map
((
extensionDescription
)
=>
{
// revive URI object
(
<
IRelaxedExtensionDescription
>
extensionDescription
).
extensionLocation
=
URI
.
revive
(
extensionDescription
.
extensionLocation
);
return
extensionDescription
;
});
}
const
counterLogger
=
new
CounterLogger
(
log
);
...
...
src/vs/workbench/services/extensions/node/extensionPoints.ts
浏览文件 @
868e4fb7
...
...
@@ -299,24 +299,25 @@ class ExtensionManifestNLSReplacer extends ExtensionManifestHandler {
}
}
// Relax the readonly properties here, it is the one place where we check and normalize values
export
interface
IRelaxedExtensionDescription
{
id
:
string
;
name
:
string
;
version
:
string
;
publisher
:
string
;
isBuiltin
:
boolean
;
isUnderDevelopment
:
boolean
;
extensionFolderPath
:
string
;
extensionLocation
:
URI
;
engines
:
{
vscode
:
string
;
};
main
?:
string
;
enableProposedApi
?:
boolean
;
}
class
ExtensionManifestValidator
extends
ExtensionManifestHandler
{
validate
(
_extensionDescription
:
IExtensionDescription
):
IExtensionDescription
{
// Relax the readonly properties here, it is the one place where we check and normalize values
interface
IRelaxedExtensionDescription
{
id
:
string
;
name
:
string
;
version
:
string
;
publisher
:
string
;
isBuiltin
:
boolean
;
isUnderDevelopment
:
boolean
;
extensionFolderPath
:
string
;
extensionLocation
:
URI
;
engines
:
{
vscode
:
string
;
};
main
?:
string
;
enableProposedApi
?:
boolean
;
}
let
extensionDescription
=
<
IRelaxedExtensionDescription
>
_extensionDescription
;
extensionDescription
.
isBuiltin
=
this
.
_isBuiltin
;
extensionDescription
.
isUnderDevelopment
=
this
.
_isUnderDevelopment
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录