Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
0b5d9520
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,发现更多精彩内容 >>
提交
0b5d9520
编写于
4月 11, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small tweaks
上级
2559767a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
68 addition
and
13 deletion
+68
-13
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+14
-7
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+15
-2
src/vs/workbench/services/extensions/node/extensionHostMain.ts
...s/workbench/services/extensions/node/extensionHostMain.ts
+22
-3
src/vs/workbench/services/extensions/node/extensionHostProcess.ts
...orkbench/services/extensions/node/extensionHostProcess.ts
+17
-1
未找到文件。
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
0b5d9520
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
localize
}
from
'
vs/nls
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -44,7 +43,7 @@ import { LogOutputChannelFactory } from 'vs/workbench/api/node/extHostOutputServ
import
{
ExtHostProgress
}
from
'
vs/workbench/api/common/extHostProgress
'
;
import
{
ExtHostQuickOpen
}
from
'
vs/workbench/api/common/extHostQuickOpen
'
;
import
{
ExtHostSCM
}
from
'
vs/workbench/api/common/extHostSCM
'
;
import
{
ExtHostSearch
}
from
'
vs/workbench/api/node/extHostSearch
'
;
import
{
ExtHostSearch
,
registerEHSearchProviders
}
from
'
vs/workbench/api/node/extHostSearch
'
;
import
{
ExtHostStatusBar
}
from
'
vs/workbench/api/common/extHostStatusBar
'
;
import
{
ExtHostStorage
}
from
'
vs/workbench/api/common/extHostStorage
'
;
import
{
ExtHostTask
}
from
'
vs/workbench/api/node/extHostTask
'
;
...
...
@@ -67,6 +66,7 @@ import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
values
}
from
'
vs/base/common/collections
'
;
import
{
endsWith
}
from
'
vs/base/common/strings
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
interface
IExtensionApiFactory
{
(
extension
:
IExtensionDescription
,
registry
:
ExtensionDescriptionRegistry
,
configProvider
:
ExtHostConfigProvider
):
typeof
vscode
;
...
...
@@ -90,11 +90,11 @@ export function createApiFactory(
extHostConfiguration
:
ExtHostConfiguration
,
extensionService
:
ExtHostExtensionService
,
extHostLogService
:
ExtHostLogService
,
extHostStorage
:
ExtHostStorage
extHostStorage
:
ExtHostStorage
,
schemeTransformer
:
ISchemeTransformer
|
null
,
outputChannelName
:
string
):
IExtensionApiFactory
{
const
schemeTransformer
:
ISchemeTransformer
|
null
=
null
;
// Addressable instances
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostLogService
,
extHostLogService
);
const
extHostHeapService
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostHeapService
,
new
ExtHostHeapService
());
...
...
@@ -127,6 +127,14 @@ export function createApiFactory(
const
extHostOutputService
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostOutputService
,
new
ExtHostOutputService
(
LogOutputChannelFactory
,
initData
.
logsLocation
,
rpcProtocol
));
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostStorage
,
extHostStorage
);
if
(
initData
.
remoteAuthority
)
{
extHostTask
.
registerTaskSystem
(
Schemas
.
vscodeRemote
,
{
scheme
:
Schemas
.
vscodeRemote
,
authority
:
initData
.
remoteAuthority
,
platform
:
process
.
platform
});
registerEHSearchProviders
(
extHostSearch
,
extHostLogService
);
const
cliServer
=
new
CLIServer
(
extHostCommands
);
process
.
env
[
'
VSCODE_IPC_HOOK_CLI
'
]
=
cliServer
.
ipcHandlePath
;
}
...
...
@@ -143,8 +151,7 @@ export function createApiFactory(
const
extHostLanguages
=
new
ExtHostLanguages
(
rpcProtocol
,
extHostDocuments
);
// Register an output channel for exthost log
const
name
=
localize
(
'
extensionsLog
'
,
"
Extension Host
"
);
extHostOutputService
.
createOutputChannelFromLogFile
(
name
,
extHostLogService
.
logFile
);
extHostOutputService
.
createOutputChannelFromLogFile
(
outputChannelName
,
extHostLogService
.
logFile
);
// Register API-ish commands
ExtHostApiCommands
.
register
(
extHostCommands
);
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
0b5d9520
...
...
@@ -32,6 +32,7 @@ import { Schemas } from 'vs/base/common/network';
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
realpath
}
from
'
vs/base/node/extpath
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
ISchemeTransformer
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
class
ExtensionMemento
implements
IExtensionMemento
{
...
...
@@ -189,7 +190,9 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
extHostWorkspace
:
ExtHostWorkspace
,
extHostConfiguration
:
ExtHostConfiguration
,
environment
:
IEnvironment
,
extHostLogService
:
ExtHostLogService
extHostLogService
:
ExtHostLogService
,
schemeTransformer
:
ISchemeTransformer
|
null
,
outputChannelName
:
string
)
{
this
.
_nativeExit
=
nativeExit
;
this
.
_initData
=
initData
;
...
...
@@ -230,7 +233,17 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
this
.
_extensionPathIndex
=
null
;
// initialize API first (i.e. do not release barrier until the API is initialized)
this
.
_extensionApiFactory
=
createApiFactory
(
this
.
_initData
,
this
.
_extHostContext
,
this
.
_extHostWorkspace
,
this
.
_extHostConfiguration
,
this
,
this
.
_extHostLogService
,
this
.
_storage
);
this
.
_extensionApiFactory
=
createApiFactory
(
this
.
_initData
,
this
.
_extHostContext
,
this
.
_extHostWorkspace
,
this
.
_extHostConfiguration
,
this
,
this
.
_extHostLogService
,
this
.
_storage
,
schemeTransformer
,
outputChannelName
);
this
.
_resolvers
=
Object
.
create
(
null
);
...
...
src/vs/workbench/services/extensions/node/extensionHostMain.ts
浏览文件 @
0b5d9520
...
...
@@ -19,6 +19,7 @@ import { RPCProtocol } from 'vs/workbench/services/extensions/common/rpcProtocol
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ISchemeTransformer
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
// we don't (yet) throw when extensions parse
// uris that have no scheme
...
...
@@ -46,10 +47,18 @@ export class ExtensionHostMain {
private
_searchRequestIdProvider
:
Counter
;
constructor
(
protocol
:
IMessagePassingProtocol
,
initData
:
IInitData
,
exitFn
:
IExitFn
,
consolePatchFn
:
IConsolePatchFn
,
logServiceFn
:
ILogServiceFn
)
{
constructor
(
protocol
:
IMessagePassingProtocol
,
initData
:
IInitData
,
exitFn
:
IExitFn
,
consolePatchFn
:
IConsolePatchFn
,
logServiceFn
:
ILogServiceFn
,
uriTransformer
:
IURITransformer
|
null
,
schemeTransformer
:
ISchemeTransformer
|
null
,
outputChannelName
:
string
)
{
this
.
_isTerminating
=
false
;
this
.
_exitFn
=
exitFn
;
const
uriTransformer
:
IURITransformer
|
null
=
null
;
const
rpcProtocol
=
new
RPCProtocol
(
protocol
,
null
,
uriTransformer
);
// ensure URIs are transformed and revived
...
...
@@ -69,7 +78,17 @@ export class ExtensionHostMain {
this
.
_extHostLogService
.
trace
(
'
initData
'
,
initData
);
const
extHostConfiguraiton
=
new
ExtHostConfiguration
(
rpcProtocol
.
getProxy
(
MainContext
.
MainThreadConfiguration
),
extHostWorkspace
);
this
.
_extensionService
=
new
ExtHostExtensionService
(
exitFn
,
initData
,
rpcProtocol
,
extHostWorkspace
,
extHostConfiguraiton
,
initData
.
environment
,
this
.
_extHostLogService
);
this
.
_extensionService
=
new
ExtHostExtensionService
(
exitFn
,
initData
,
rpcProtocol
,
extHostWorkspace
,
extHostConfiguraiton
,
initData
.
environment
,
this
.
_extHostLogService
,
schemeTransformer
,
outputChannelName
);
// error forwarding and stack trace scanning
Error
.
stackTraceLimit
=
100
;
// increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API)
...
...
src/vs/workbench/services/extensions/node/extensionHostProcess.ts
浏览文件 @
0b5d9520
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
nativeWatchdog
from
'
native-watchdog
'
;
import
*
as
net
from
'
net
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
...
...
@@ -17,6 +18,8 @@ import { ExtensionHostMain, IExitFn, ILogServiceFn } from 'vs/workbench/services
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ExtensionHostLogFileName
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ISchemeTransformer
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
import
{
IURITransformer
}
from
'
vs/base/common/uriIpc
'
;
// With Electron 2.x and node.js 8.x the "natives" module
// can cause a native crash (see https://github.com/nodejs/node/issues/19891 and
...
...
@@ -263,7 +266,20 @@ createExtHostProtocol().then(protocol => {
// setup things
patchProcess
(
!!
initData
.
environment
.
extensionTestsLocationURI
);
// to support other test frameworks like Jasmin that use process.exit (https://github.com/Microsoft/vscode/issues/37708)
const
extensionHostMain
=
new
ExtensionHostMain
(
renderer
.
protocol
,
initData
,
nativeExit
,
patchPatchedConsole
,
createLogService
);
const
uriTransformer
:
IURITransformer
|
null
=
null
;
const
schemeTransformer
:
ISchemeTransformer
|
null
=
null
;
const
outputChannelName
=
nls
.
localize
(
'
extension host Log
'
,
"
Extension Host
"
);
const
extensionHostMain
=
new
ExtensionHostMain
(
renderer
.
protocol
,
initData
,
nativeExit
,
patchPatchedConsole
,
createLogService
,
uriTransformer
,
schemeTransformer
,
outputChannelName
);
// rewrite onTerminate-function to be a proper shutdown
onTerminate
=
()
=>
extensionHostMain
.
terminate
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录