Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5bdb90de
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,发现更多精彩内容 >>
提交
5bdb90de
编写于
1月 23, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scripts/code.sh picks up marketplace built-in extensions automatically
上级
53a2781d
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
100 addition
and
10 deletion
+100
-10
build/builtInExtensions.json
build/builtInExtensions.json
+4
-0
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+21
-5
build/lib/builtInExtensions.js
build/lib/builtInExtensions.js
+32
-0
extensions/ms-vscode.node-debug/package.json
extensions/ms-vscode.node-debug/package.json
+2
-2
extensions/ms-vscode.node-debug2/package.json
extensions/ms-vscode.node-debug2/package.json
+2
-2
scripts/code.sh
scripts/code.sh
+3
-0
src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts
...h/services/extensions/electron-browser/extensionPoints.ts
+4
-0
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+32
-1
未找到文件。
build/builtInExtensions.json
0 → 100644
浏览文件 @
5bdb90de
[
{
"name"
:
"ms-vscode.node-debug"
,
"version"
:
"1.20.3"
},
{
"name"
:
"ms-vscode.node-debug2"
,
"version"
:
"1.20.1"
}
]
\ No newline at end of file
build/gulpfile.vscode.js
浏览文件 @
5bdb90de
...
@@ -44,14 +44,13 @@ const nodeModules = ['electron', 'original-fs']
...
@@ -44,14 +44,13 @@ const nodeModules = ['electron', 'original-fs']
// Build
// Build
const
builtInExtensions
=
[
const
builtInExtensions
=
require
(
'
./builtInExtensions
'
);
{
name
:
'
ms-vscode.node-debug
'
,
version
:
'
1.20.3
'
},
{
name
:
'
ms-vscode.node-debug2
'
,
version
:
'
1.20.1
'
}
];
const
excludedExtensions
=
[
const
excludedExtensions
=
[
'
vscode-api-tests
'
,
'
vscode-api-tests
'
,
'
vscode-colorize-tests
'
'
vscode-colorize-tests
'
,
'
ms-vscode.node-debug
'
,
'
ms-vscode.node-debug2
'
,
];
];
const
vscodeEntryPoints
=
_
.
flatten
([
const
vscodeEntryPoints
=
_
.
flatten
([
...
@@ -584,3 +583,20 @@ gulp.task('generate-vscode-configuration', () => {
...
@@ -584,3 +583,20 @@ gulp.task('generate-vscode-configuration', () => {
console
.
error
(
e
.
toString
());
console
.
error
(
e
.
toString
());
});
});
});
});
//#region Built-In Extensions
gulp
.
task
(
'
clean-builtInExtensions
'
,
util
.
rimraf
(
'
.build/builtInExtensions
'
));
gulp
.
task
(
'
builtInExtensions
'
,
[
'
clean-builtInExtensions
'
],
function
()
{
const
marketplaceExtensions
=
es
.
merge
(...
builtInExtensions
.
map
(
extension
=>
{
return
ext
.
fromMarketplace
(
extension
.
name
,
extension
.
version
)
.
pipe
(
rename
(
p
=>
p
.
dirname
=
`
${
extension
.
name
}
/
${
p
.
dirname
}
`
));
}));
return
(
marketplaceExtensions
.
pipe
(
util
.
setExecutableBit
([
'
**/*.sh
'
]))
.
pipe
(
vfs
.
dest
(
'
.build/builtInExtensions
'
))
);
});
//#endregion
build/lib/builtInExtensions.js
0 → 100644
浏览文件 @
5bdb90de
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
const
root
=
path
.
dirname
(
path
.
dirname
(
__dirname
));
function
isUpToDate
(
extension
)
{
const
packagePath
=
path
.
join
(
root
,
'
.build
'
,
'
builtInExtensions
'
,
extension
.
name
,
'
package.json
'
);
if
(
!
fs
.
existsSync
(
packagePath
))
{
return
false
;
}
const
packageContents
=
fs
.
readFileSync
(
packagePath
);
try
{
const
diskVersion
=
JSON
.
parse
(
packageContents
).
version
;
return
(
diskVersion
===
extension
.
version
);
}
catch
(
err
)
{
return
false
;
}
}
const
builtInExtensions
=
require
(
'
../builtInExtensions
'
);
builtInExtensions
.
forEach
((
extension
)
=>
{
if
(
!
isUpToDate
(
extension
))
{
process
.
exit
(
1
);
}
});
process
.
exit
(
0
);
extensions/ms-vscode.node-debug/package.json
浏览文件 @
5bdb90de
{
{
"name"
:
"node-debug
-placeholder
"
,
"name"
:
"node-debug"
,
"version"
:
"1.6.0"
,
"version"
:
"1.6.0"
,
"publisher"
:
"vscode"
,
"publisher"
:
"
ms-
vscode"
,
"engines"
:
{
"engines"
:
{
"vscode"
:
"1.6.x"
"vscode"
:
"1.6.x"
}
}
...
...
extensions/ms-vscode.node-debug2/package.json
浏览文件 @
5bdb90de
{
{
"name"
:
"node-debug2
-placeholder
"
,
"name"
:
"node-debug2"
,
"version"
:
"0.0.3"
,
"version"
:
"0.0.3"
,
"publisher"
:
"vscode"
,
"publisher"
:
"
ms-
vscode"
,
"engines"
:
{
"engines"
:
{
"vscode"
:
"1.6.x"
"vscode"
:
"1.6.x"
}
}
...
...
scripts/code.sh
浏览文件 @
5bdb90de
...
@@ -24,6 +24,9 @@ function code() {
...
@@ -24,6 +24,9 @@ function code() {
# Get electron
# Get electron
node build/lib/electron.js
||
./node_modules/.bin/gulp electron
node build/lib/electron.js
||
./node_modules/.bin/gulp electron
# Get built-in extensions
node build/lib/builtInExtensions.js
||
./node_modules/.bin/gulp builtInExtensions
# Build
# Build
test
-d
out
||
./node_modules/.bin/gulp compile
test
-d
out
||
./node_modules/.bin/gulp compile
...
...
src/vs/workbench/services/extensions/electron-browser/extensionPoints.ts
浏览文件 @
5bdb90de
...
@@ -334,6 +334,10 @@ export class ExtensionScanner {
...
@@ -334,6 +334,10 @@ export class ExtensionScanner {
}
}
const
rawFolders
=
await
pfs
.
readDirsInDir
(
absoluteFolderPath
);
const
rawFolders
=
await
pfs
.
readDirsInDir
(
absoluteFolderPath
);
// Ensure the same extension order
rawFolders
.
sort
();
let
folders
:
string
[]
=
null
;
let
folders
:
string
[]
=
null
;
if
(
isBuiltin
)
{
if
(
isBuiltin
)
{
folders
=
rawFolders
;
folders
=
rawFolders
;
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
5bdb90de
...
@@ -44,6 +44,7 @@ import * as strings from 'vs/base/common/strings';
...
@@ -44,6 +44,7 @@ import * as strings from 'vs/base/common/strings';
import
{
RPCProtocol
}
from
'
vs/workbench/services/extensions/node/rpcProtocol
'
;
import
{
RPCProtocol
}
from
'
vs/workbench/services/extensions/node/rpcProtocol
'
;
const
SystemExtensionsRoot
=
path
.
normalize
(
path
.
join
(
URI
.
parse
(
require
.
toUrl
(
''
)).
fsPath
,
'
..
'
,
'
extensions
'
));
const
SystemExtensionsRoot
=
path
.
normalize
(
path
.
join
(
URI
.
parse
(
require
.
toUrl
(
''
)).
fsPath
,
'
..
'
,
'
extensions
'
));
const
ExtraDevSystemExtensionsRoot
=
path
.
normalize
(
path
.
join
(
URI
.
parse
(
require
.
toUrl
(
''
)).
fsPath
,
'
..
'
,
'
.build
'
,
'
builtInExtensions
'
));
// Enable to see detailed message communication between window and extension host
// Enable to see detailed message communication between window and extension host
const
logExtensionHostCommunication
=
false
;
const
logExtensionHostCommunication
=
false
;
...
@@ -624,6 +625,36 @@ export class ExtensionService extends Disposable implements IExtensionService {
...
@@ -624,6 +625,36 @@ export class ExtensionService extends Disposable implements IExtensionService {
log
log
);
);
let
finalBuiltinExtensions
:
TPromise
<
IExtensionDescription
[]
>
=
builtinExtensions
;
if
(
devMode
)
{
const
extraBuiltinExtensions
=
ExtensionScanner
.
scanExtensions
(
new
ExtensionScannerInput
(
version
,
commit
,
locale
,
devMode
,
ExtraDevSystemExtensionsRoot
,
true
),
log
);
finalBuiltinExtensions
=
TPromise
.
join
([
builtinExtensions
,
extraBuiltinExtensions
]).
then
(([
builtinExtensions
,
extraBuiltinExtensions
])
=>
{
let
resultMap
:
{
[
id
:
string
]:
IExtensionDescription
;
}
=
Object
.
create
(
null
);
for
(
let
i
=
0
,
len
=
builtinExtensions
.
length
;
i
<
len
;
i
++
)
{
resultMap
[
builtinExtensions
[
i
].
id
]
=
builtinExtensions
[
i
];
}
// Overwrite with extensions found in extra
for
(
let
i
=
0
,
len
=
extraBuiltinExtensions
.
length
;
i
<
len
;
i
++
)
{
resultMap
[
extraBuiltinExtensions
[
i
].
id
]
=
extraBuiltinExtensions
[
i
];
}
let
resultArr
=
Object
.
keys
(
resultMap
).
map
((
id
)
=>
resultMap
[
id
]);
resultArr
.
sort
((
a
,
b
)
=>
{
const
aLastSegment
=
path
.
basename
(
a
.
extensionFolderPath
);
const
bLastSegment
=
path
.
basename
(
b
.
extensionFolderPath
);
if
(
aLastSegment
<
bLastSegment
)
{
return
-
1
;
}
if
(
aLastSegment
>
bLastSegment
)
{
return
1
;
}
return
0
;
});
return
resultArr
;
});
}
const
userExtensions
=
(
const
userExtensions
=
(
environmentService
.
disableExtensions
||
!
environmentService
.
extensionsPath
environmentService
.
disableExtensions
||
!
environmentService
.
extensionsPath
?
TPromise
.
as
([])
?
TPromise
.
as
([])
...
@@ -646,7 +677,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
...
@@ -646,7 +677,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
:
TPromise
.
as
([])
:
TPromise
.
as
([])
);
);
return
TPromise
.
join
([
b
uiltinExtensions
,
userExtensions
,
developedExtensions
])
return
TPromise
.
join
([
finalB
uiltinExtensions
,
userExtensions
,
developedExtensions
])
.
then
((
extensionDescriptions
:
IExtensionDescription
[][])
=>
{
.
then
((
extensionDescriptions
:
IExtensionDescription
[][])
=>
{
const
system
=
extensionDescriptions
[
0
];
const
system
=
extensionDescriptions
[
0
];
const
user
=
extensionDescriptions
[
1
];
const
user
=
extensionDescriptions
[
1
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录