Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c436e773
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,发现更多精彩内容 >>
提交
c436e773
编写于
4月 19, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compute 'enableProposedApi' property on main
上级
3500eb87
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
32 deletion
+34
-32
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+0
-23
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+0
-2
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
...nch/services/extensions/electron-browser/extensionHost.ts
+1
-4
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+33
-3
未找到文件。
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
c436e773
...
...
@@ -54,7 +54,6 @@ import { ExtHostFileSystem } from 'vs/workbench/api/node/extHostFileSystem';
import
{
ExtHostDecorations
}
from
'
vs/workbench/api/node/extHostDecorations
'
;
import
{
toGlobPattern
,
toLanguageSelector
}
from
'
vs/workbench/api/node/extHostTypeConverters
'
;
import
{
ExtensionActivatedByAPI
}
from
'
vs/workbench/api/node/extHostExtensionActivator
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
OverviewRulerLane
}
from
'
vs/editor/common/model
'
;
import
{
ExtHostLogService
}
from
'
vs/workbench/api/node/extHostLogService
'
;
import
{
ExtHostWebviews
}
from
'
vs/workbench/api/node/extHostWebview
'
;
...
...
@@ -164,28 +163,6 @@ export function createApiFactory(
};
})();
if
(
!
isFalsyOrEmpty
(
product
.
extensionAllowedProposedApi
)
&&
product
.
extensionAllowedProposedApi
.
indexOf
(
extension
.
id
)
>=
0
)
{
// fast lane -> proposed api is available to all extensions
// that are listed in product.json-files
extension
.
enableProposedApi
=
true
;
}
else
if
(
extension
.
enableProposedApi
&&
!
extension
.
isBuiltin
)
{
if
(
!
initData
.
environment
.
enableProposedApiForAll
&&
initData
.
environment
.
enableProposedApiFor
.
indexOf
(
extension
.
id
)
<
0
)
{
extension
.
enableProposedApi
=
false
;
console
.
error
(
`Extension '
${
extension
.
id
}
cannot use PROPOSED API (must started out of dev or enabled via --enable-proposed-api)`
);
}
else
{
// proposed api is available when developing or when an extension was explicitly
// spelled out via a command line argument
console
.
warn
(
`Extension '
${
extension
.
id
}
' uses PROPOSED API which is subject to change and removal without notice.`
);
}
}
// namespace: commands
const
commands
:
typeof
vscode
.
commands
=
{
registerCommand
(
id
:
string
,
command
:
<
T
>
(...
args
:
any
[])
=>
T
|
Thenable
<
T
>
,
thisArgs
?:
any
):
vscode
.
Disposable
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
c436e773
...
...
@@ -52,8 +52,6 @@ import { TaskExecutionDTO, TaskDTO, TaskHandleDTO } from 'vs/workbench/api/share
export
interface
IEnvironment
{
isExtensionDevelopmentDebug
:
boolean
;
enableProposedApiForAll
:
boolean
;
enableProposedApiFor
:
string
|
string
[];
appRoot
:
string
;
appSettingsHome
:
string
;
disableExtensions
:
boolean
;
...
...
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
浏览文件 @
c436e773
...
...
@@ -371,10 +371,7 @@ export class ExtensionHostProcessWorker {
appSettingsHome
:
this
.
_environmentService
.
appSettingsHome
,
disableExtensions
:
this
.
_environmentService
.
disableExtensions
,
extensionDevelopmentPath
:
this
.
_environmentService
.
extensionDevelopmentPath
,
extensionTestsPath
:
this
.
_environmentService
.
extensionTestsPath
,
// globally disable proposed api when built and not insiders developing extensions
enableProposedApiForAll
:
!
this
.
_environmentService
.
isBuilt
||
(
!!
this
.
_environmentService
.
extensionDevelopmentPath
&&
product
.
nameLong
.
indexOf
(
'
Insiders
'
)
>=
0
),
enableProposedApiFor
:
this
.
_environmentService
.
args
[
'
enable-proposed-api
'
]
||
[]
extensionTestsPath
:
this
.
_environmentService
.
extensionTestsPath
},
workspace
:
this
.
_contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
?
null
:
<
IWorkspaceData
>
this
.
_contextService
.
getWorkspace
(),
extensions
:
extensionDescriptions
,
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
c436e773
...
...
@@ -41,6 +41,7 @@ import product from 'vs/platform/node/product';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
RPCProtocol
}
from
'
vs/workbench/services/extensions/node/rpcProtocol
'
;
import
{
INotificationService
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
let
_SystemExtensionsRoot
:
string
=
null
;
function
getSystemExtensionsRoot
():
string
{
...
...
@@ -497,7 +498,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
private
_scanAndHandleExtensions
():
void
{
this
.
_getRuntimeExtension
()
this
.
_getRuntimeExtension
s
()
.
then
(
runtimeExtensons
=>
{
this
.
_registry
=
new
ExtensionDescriptionRegistry
(
runtimeExtensons
);
...
...
@@ -522,7 +523,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
});
}
private
_getRuntimeExtension
():
TPromise
<
IExtensionDescription
[]
>
{
private
_getRuntimeExtension
s
():
TPromise
<
IExtensionDescription
[]
>
{
const
log
=
new
Logger
((
severity
,
source
,
message
)
=>
{
this
.
_logOrShowMessage
(
severity
,
this
.
_isDev
?
messageWithSource2
(
source
,
message
)
:
message
);
});
...
...
@@ -586,7 +587,36 @@ export class ExtensionService extends Disposable implements IExtensionService {
return
runtimeExtensions
;
}
});
});
}).
then
(
extensions
=>
this
.
_updateEnableProposedApi
(
extensions
));
}
private
_updateEnableProposedApi
(
extensions
:
IExtensionDescription
[]):
IExtensionDescription
[]
{
const
enableProposedApiForAll
=
!
this
.
_environmentService
.
isBuilt
||
(
!!
this
.
_environmentService
.
extensionDevelopmentPath
&&
product
.
nameLong
.
indexOf
(
'
Insiders
'
)
>=
0
);
const
enableProposedApiFor
=
this
.
_environmentService
.
args
[
'
enable-proposed-api
'
]
||
[];
for
(
const
extension
of
extensions
)
{
if
(
!
isFalsyOrEmpty
(
product
.
extensionAllowedProposedApi
)
&&
product
.
extensionAllowedProposedApi
.
indexOf
(
extension
.
id
)
>=
0
)
{
// fast lane -> proposed api is available to all extensions
// that are listed in product.json-files
extension
.
enableProposedApi
=
true
;
}
else
if
(
extension
.
enableProposedApi
&&
!
extension
.
isBuiltin
)
{
if
(
!
enableProposedApiForAll
&&
enableProposedApiFor
.
indexOf
(
extension
.
id
)
<
0
)
{
extension
.
enableProposedApi
=
false
;
console
.
error
(
`Extension '
${
extension
.
id
}
cannot use PROPOSED API (must started out of dev or enabled via --enable-proposed-api)`
);
}
else
{
// proposed api is available when developing or when an extension was explicitly
// spelled out via a command line argument
console
.
warn
(
`Extension '
${
extension
.
id
}
' uses PROPOSED API which is subject to change and removal without notice.`
);
}
}
}
return
extensions
;
}
private
_handleExtensionPointMessage
(
msg
:
IMessage
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录