Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0074066c
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,发现更多精彩内容 >>
提交
0074066c
编写于
4月 06, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "extensions: allow built-in extensions on different qualities (#89199)"
This reverts commit
7ad58a9b
.
上级
404f66c1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
63 deletion
+10
-63
build/builtInExtensions.json
build/builtInExtensions.json
+0
-18
build/builtin/browser-main.js
build/builtin/browser-main.js
+1
-7
build/lib/extensions.ts
build/lib/extensions.ts
+1
-5
src/vs/platform/extensionManagement/common/extensionManagementUtil.ts
...orm/extensionManagement/common/extensionManagementUtil.ts
+1
-22
src/vs/platform/extensionManagement/node/extensionManagementService.ts
...rm/extensionManagement/node/extensionManagementService.ts
+5
-4
src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
...ces/extensions/electron-browser/cachedExtensionScanner.ts
+2
-7
未找到文件。
build/builtInExtensions.json
浏览文件 @
0074066c
...
@@ -44,24 +44,6 @@
...
@@ -44,24 +44,6 @@
"publisherDisplayName"
:
"Microsoft"
"publisherDisplayName"
:
"Microsoft"
}
}
},
},
{
"name"
:
"ms-vscode.js-debug-nightly"
,
"version"
:
"2020.3.3117"
,
"forQualities"
:
[
"insider"
],
"repo"
:
"https://github.com/Microsoft/vscode-js-debug"
,
"metadata"
:
{
"id"
:
"7acbb4ce-c85a-49d4-8d95-a8054406ae97"
,
"publisherId"
:
{
"publisherId"
:
"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee"
,
"publisherName"
:
"ms-vscode"
,
"displayName"
:
"Microsoft"
,
"flags"
:
"verified"
},
"publisherDisplayName"
:
"Microsoft"
}
},
{
{
"name"
:
"ms-vscode.js-debug-companion"
,
"name"
:
"ms-vscode.js-debug-companion"
,
"version"
:
"0.0.4"
,
"version"
:
"0.0.4"
,
...
...
build/builtin/browser-main.js
浏览文件 @
0074066c
...
@@ -9,7 +9,6 @@ const os = require('os');
...
@@ -9,7 +9,6 @@ const os = require('os');
const
{
remote
}
=
require
(
'
electron
'
);
const
{
remote
}
=
require
(
'
electron
'
);
const
dialog
=
remote
.
dialog
;
const
dialog
=
remote
.
dialog
;
const
productJsonPath
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
product.json
'
);
const
builtInExtensionsPath
=
path
.
join
(
__dirname
,
'
..
'
,
'
builtInExtensions.json
'
);
const
builtInExtensionsPath
=
path
.
join
(
__dirname
,
'
..
'
,
'
builtInExtensions.json
'
);
const
controlFilePath
=
path
.
join
(
os
.
homedir
(),
'
.vscode-oss-dev
'
,
'
extensions
'
,
'
control.json
'
);
const
controlFilePath
=
path
.
join
(
os
.
homedir
(),
'
.vscode-oss-dev
'
,
'
extensions
'
,
'
control.json
'
);
...
@@ -51,7 +50,6 @@ function render(el, state) {
...
@@ -51,7 +50,6 @@ function render(el, state) {
}
}
const
ul
=
document
.
createElement
(
'
ul
'
);
const
ul
=
document
.
createElement
(
'
ul
'
);
const
{
quality
}
=
readJson
(
productJsonPath
);
const
{
builtin
,
control
}
=
state
;
const
{
builtin
,
control
}
=
state
;
for
(
const
ext
of
builtin
)
{
for
(
const
ext
of
builtin
)
{
...
@@ -62,10 +60,6 @@ function render(el, state) {
...
@@ -62,10 +60,6 @@ function render(el, state) {
const
name
=
document
.
createElement
(
'
code
'
);
const
name
=
document
.
createElement
(
'
code
'
);
name
.
textContent
=
ext
.
name
;
name
.
textContent
=
ext
.
name
;
if
(
quality
&&
ext
.
forQualities
&&
!
ext
.
forQualities
.
includes
(
quality
))
{
name
.
textContent
+=
` (only on
${
ext
.
forQualities
.
join
(
'
,
'
)}
)`
;
}
li
.
appendChild
(
name
);
li
.
appendChild
(
name
);
const
form
=
document
.
createElement
(
'
form
'
);
const
form
=
document
.
createElement
(
'
form
'
);
...
@@ -128,4 +122,4 @@ function main() {
...
@@ -128,4 +122,4 @@ function main() {
render
(
el
,
{
builtin
,
control
});
render
(
el
,
{
builtin
,
control
});
}
}
window
.
onload
=
main
;
window
.
onload
=
main
;
\ No newline at end of file
build/lib/extensions.ts
浏览文件 @
0074066c
...
@@ -27,7 +27,6 @@ const util = require('./util');
...
@@ -27,7 +27,6 @@ const util = require('./util');
const
root
=
path
.
dirname
(
path
.
dirname
(
__dirname
));
const
root
=
path
.
dirname
(
path
.
dirname
(
__dirname
));
const
commit
=
util
.
getVersion
(
root
);
const
commit
=
util
.
getVersion
(
root
);
const
sourceMappingURLBase
=
`https://ticino.blob.core.windows.net/sourcemaps/
${
commit
}
`
;
const
sourceMappingURLBase
=
`https://ticino.blob.core.windows.net/sourcemaps/
${
commit
}
`
;
const
product
=
require
(
'
../../product.json
'
);
function
fromLocal
(
extensionPath
:
string
):
Stream
{
function
fromLocal
(
extensionPath
:
string
):
Stream
{
const
webpackFilename
=
path
.
join
(
extensionPath
,
'
extension.webpack.config.js
'
);
const
webpackFilename
=
path
.
join
(
extensionPath
,
'
extension.webpack.config.js
'
);
...
@@ -221,19 +220,16 @@ const excludedExtensions = [
...
@@ -221,19 +220,16 @@ const excludedExtensions = [
'
vscode-test-resolver
'
,
'
vscode-test-resolver
'
,
'
ms-vscode.node-debug
'
,
'
ms-vscode.node-debug
'
,
'
ms-vscode.node-debug2
'
,
'
ms-vscode.node-debug2
'
,
'
ms.vscode.js-debug-nightly
'
];
];
interface
IBuiltInExtension
{
interface
IBuiltInExtension
{
name
:
string
;
name
:
string
;
version
:
string
;
version
:
string
;
repo
:
string
;
repo
:
string
;
forQualities
?:
ReadonlyArray
<
string
>
;
metadata
:
any
;
metadata
:
any
;
}
}
const
builtInExtensions
=
(
<
IBuiltInExtension
[]
>
require
(
'
../builtInExtensions.json
'
))
const
builtInExtensions
:
IBuiltInExtension
[]
=
require
(
'
../builtInExtensions.json
'
);
.
filter
(({
forQualities
})
=>
!
product
.
quality
||
forQualities
?.
includes
?.(
product
.
quality
)
!==
false
);
export
function
packageLocalExtensionsStream
():
NodeJS
.
ReadWriteStream
{
export
function
packageLocalExtensionsStream
():
NodeJS
.
ReadWriteStream
{
const
localExtensionDescriptions
=
(
<
string
[]
>
glob
.
sync
(
'
extensions/*/package.json
'
))
const
localExtensionDescriptions
=
(
<
string
[]
>
glob
.
sync
(
'
extensions/*/package.json
'
))
...
...
src/vs/platform/extensionManagement/common/extensionManagementUtil.ts
浏览文件 @
0074066c
...
@@ -116,25 +116,4 @@ export function getMaliciousExtensionsSet(report: IReportedExtension[]): Set<str
...
@@ -116,25 +116,4 @@ export function getMaliciousExtensionsSet(report: IReportedExtension[]): Set<str
}
}
return
result
;
return
result
;
}
}
\ No newline at end of file
export
interface
IBuiltInExtension
{
name
:
string
;
version
:
string
;
repo
:
string
;
forQualities
?:
ReadonlyArray
<
string
>
;
metadata
:
any
;
}
/**
* Parses the built-in extension JSON data and filters it down to the
* extensions built into this product quality.
*/
export
function
parseBuiltInExtensions
(
rawJson
:
string
,
productQuality
:
string
|
undefined
)
{
const
parsed
:
IBuiltInExtension
[]
=
JSON
.
parse
(
rawJson
);
if
(
!
productQuality
)
{
return
parsed
;
}
return
parsed
.
filter
(
ext
=>
ext
.
forQualities
?.
indexOf
?.(
productQuality
)
!==
-
1
);
}
src/vs/platform/extensionManagement/node/extensionManagementService.ts
浏览文件 @
0074066c
...
@@ -21,7 +21,7 @@ import {
...
@@ -21,7 +21,7 @@ import {
INSTALL_ERROR_MALICIOUS
,
INSTALL_ERROR_MALICIOUS
,
INSTALL_ERROR_INCOMPATIBLE
INSTALL_ERROR_INCOMPATIBLE
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
areSameExtensions
,
getGalleryExtensionId
,
groupByExtension
,
getMaliciousExtensionsSet
,
getGalleryExtensionTelemetryData
,
getLocalExtensionTelemetryData
,
ExtensionIdentifierWithVersion
,
parseBuiltInExtensions
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
areSameExtensions
,
getGalleryExtensionId
,
groupByExtension
,
getMaliciousExtensionsSet
,
getGalleryExtensionTelemetryData
,
getLocalExtensionTelemetryData
,
ExtensionIdentifierWithVersion
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
localizeManifest
}
from
'
../common/extensionNls
'
;
import
{
localizeManifest
}
from
'
../common/extensionNls
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INativeEnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
{
INativeEnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
...
@@ -46,7 +46,6 @@ import { CancellationToken } from 'vs/base/common/cancellation';
...
@@ -46,7 +46,6 @@ import { CancellationToken } from 'vs/base/common/cancellation';
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
getManifest
}
from
'
vs/platform/extensionManagement/node/extensionManagementUtil
'
;
import
{
getManifest
}
from
'
vs/platform/extensionManagement/node/extensionManagementUtil
'
;
import
{
IExtensionManifest
,
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IExtensionManifest
,
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
const
ERROR_SCANNING_SYS_EXTENSIONS
=
'
scanningSystem
'
;
const
ERROR_SCANNING_SYS_EXTENSIONS
=
'
scanningSystem
'
;
const
ERROR_SCANNING_USER_EXTENSIONS
=
'
scanningUser
'
;
const
ERROR_SCANNING_USER_EXTENSIONS
=
'
scanningUser
'
;
...
@@ -134,7 +133,6 @@ export class ExtensionManagementService extends Disposable implements IExtension
...
@@ -134,7 +133,6 @@ export class ExtensionManagementService extends Disposable implements IExtension
@
ILogService
private
readonly
logService
:
ILogService
,
@
ILogService
private
readonly
logService
:
ILogService
,
@
optional
(
IDownloadService
)
private
downloadService
:
IDownloadService
,
@
optional
(
IDownloadService
)
private
downloadService
:
IDownloadService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
IProductService
private
readonly
productService
:
IProductService
,
)
{
)
{
super
();
super
();
this
.
systemExtensionsPath
=
environmentService
.
builtinExtensionsPath
;
this
.
systemExtensionsPath
=
environmentService
.
builtinExtensionsPath
;
...
@@ -957,7 +955,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
...
@@ -957,7 +955,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
private
getDevSystemExtensionsList
():
Promise
<
string
[]
>
{
private
getDevSystemExtensionsList
():
Promise
<
string
[]
>
{
return
pfs
.
readFile
(
this
.
devSystemExtensionsFilePath
,
'
utf8
'
)
return
pfs
.
readFile
(
this
.
devSystemExtensionsFilePath
,
'
utf8
'
)
.
then
(
data
=>
parseBuiltInExtensions
(
data
,
this
.
productService
.
quality
).
map
(
ext
=>
ext
.
name
));
.
then
<
string
[]
>
(
raw
=>
{
const
parsed
:
{
name
:
string
}[]
=
JSON
.
parse
(
raw
);
return
parsed
.
map
(({
name
})
=>
name
);
});
}
}
private
toNonCancellablePromise
<
T
>
(
promise
:
Promise
<
T
>
):
Promise
<
T
>
{
private
toNonCancellablePromise
<
T
>
(
promise
:
Promise
<
T
>
):
Promise
<
T
>
{
...
...
src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
浏览文件 @
0074066c
...
@@ -23,8 +23,6 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
...
@@ -23,8 +23,6 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
ExtensionScanner
,
ExtensionScannerInput
,
IExtensionReference
,
IExtensionResolver
,
IRelaxedExtensionDescription
}
from
'
vs/workbench/services/extensions/node/extensionPoints
'
;
import
{
ExtensionScanner
,
ExtensionScannerInput
,
IExtensionReference
,
IExtensionResolver
,
IRelaxedExtensionDescription
}
from
'
vs/workbench/services/extensions/node/extensionPoints
'
;
import
{
Translations
,
ILog
}
from
'
vs/workbench/services/extensions/common/extensionPoints
'
;
import
{
Translations
,
ILog
}
from
'
vs/workbench/services/extensions/common/extensionPoints
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
parseBuiltInExtensions
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
interface
IExtensionCacheData
{
interface
IExtensionCacheData
{
input
:
ExtensionScannerInput
;
input
:
ExtensionScannerInput
;
...
@@ -59,7 +57,6 @@ export class CachedExtensionScanner {
...
@@ -59,7 +57,6 @@ export class CachedExtensionScanner {
@
IWorkbenchEnvironmentService
private
readonly
_environmentService
:
INativeWorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
private
readonly
_environmentService
:
INativeWorkbenchEnvironmentService
,
@
IWorkbenchExtensionEnablementService
private
readonly
_extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
@
IWorkbenchExtensionEnablementService
private
readonly
_extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IProductService
private
readonly
_productService
:
IProductService
,
)
{
)
{
this
.
scannedExtensions
=
new
Promise
<
IExtensionDescription
[]
>
((
resolve
,
reject
)
=>
{
this
.
scannedExtensions
=
new
Promise
<
IExtensionDescription
[]
>
((
resolve
,
reject
)
=>
{
this
.
_scannedExtensionsResolve
=
resolve
;
this
.
_scannedExtensionsResolve
=
resolve
;
...
@@ -82,7 +79,7 @@ export class CachedExtensionScanner {
...
@@ -82,7 +79,7 @@ export class CachedExtensionScanner {
public
async
startScanningExtensions
(
log
:
ILog
):
Promise
<
void
>
{
public
async
startScanningExtensions
(
log
:
ILog
):
Promise
<
void
>
{
try
{
try
{
const
translations
=
await
this
.
translationConfig
;
const
translations
=
await
this
.
translationConfig
;
const
{
system
,
user
,
development
}
=
await
CachedExtensionScanner
.
_scanInstalledExtensions
(
this
.
_hostService
,
this
.
_notificationService
,
this
.
_environmentService
,
this
.
_extensionEnablementService
,
this
.
_productService
,
log
,
translations
);
const
{
system
,
user
,
development
}
=
await
CachedExtensionScanner
.
_scanInstalledExtensions
(
this
.
_hostService
,
this
.
_notificationService
,
this
.
_environmentService
,
this
.
_extensionEnablementService
,
log
,
translations
);
let
result
=
new
Map
<
string
,
IExtensionDescription
>
();
let
result
=
new
Map
<
string
,
IExtensionDescription
>
();
system
.
forEach
((
systemExtension
)
=>
{
system
.
forEach
((
systemExtension
)
=>
{
...
@@ -242,7 +239,6 @@ export class CachedExtensionScanner {
...
@@ -242,7 +239,6 @@ export class CachedExtensionScanner {
notificationService
:
INotificationService
,
notificationService
:
INotificationService
,
environmentService
:
INativeWorkbenchEnvironmentService
,
environmentService
:
INativeWorkbenchEnvironmentService
,
extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
productService
:
IProductService
,
log
:
ILog
,
log
:
ILog
,
translations
:
Translations
translations
:
Translations
):
Promise
<
{
system
:
IExtensionDescription
[],
user
:
IExtensionDescription
[],
development
:
IExtensionDescription
[]
}
>
{
):
Promise
<
{
system
:
IExtensionDescription
[],
user
:
IExtensionDescription
[],
development
:
IExtensionDescription
[]
}
>
{
...
@@ -266,7 +262,7 @@ export class CachedExtensionScanner {
...
@@ -266,7 +262,7 @@ export class CachedExtensionScanner {
if
(
devMode
)
{
if
(
devMode
)
{
const
builtInExtensionsFilePath
=
path
.
normalize
(
path
.
join
(
getPathFromAmdModule
(
require
,
''
),
'
..
'
,
'
build
'
,
'
builtInExtensions.json
'
));
const
builtInExtensionsFilePath
=
path
.
normalize
(
path
.
join
(
getPathFromAmdModule
(
require
,
''
),
'
..
'
,
'
build
'
,
'
builtInExtensions.json
'
));
const
builtInExtensions
=
pfs
.
readFile
(
builtInExtensionsFilePath
,
'
utf8
'
)
const
builtInExtensions
=
pfs
.
readFile
(
builtInExtensionsFilePath
,
'
utf8
'
)
.
then
(
raw
=>
parseBuiltInExtensions
(
raw
,
productService
.
quality
));
.
then
<
IBuiltInExtension
[]
>
(
raw
=>
JSON
.
parse
(
raw
));
const
controlFilePath
=
path
.
join
(
os
.
homedir
(),
'
.vscode-oss-dev
'
,
'
extensions
'
,
'
control.json
'
);
const
controlFilePath
=
path
.
join
(
os
.
homedir
(),
'
.vscode-oss-dev
'
,
'
extensions
'
,
'
control.json
'
);
const
controlFile
=
pfs
.
readFile
(
controlFilePath
,
'
utf8
'
)
const
controlFile
=
pfs
.
readFile
(
controlFilePath
,
'
utf8
'
)
...
@@ -326,7 +322,6 @@ interface IBuiltInExtension {
...
@@ -326,7 +322,6 @@ interface IBuiltInExtension {
name
:
string
;
name
:
string
;
version
:
string
;
version
:
string
;
repo
:
string
;
repo
:
string
;
forQualities
?:
ReadonlyArray
<
string
>
;
}
}
interface
IBuiltInExtensionControl
{
interface
IBuiltInExtensionControl
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录