Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
857ab9d5
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,体验更适合开发者的 AI 搜索 >>
提交
857ab9d5
编写于
12月 04, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use global log service
上级
83c6d5ab
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
56 addition
and
63 deletion
+56
-63
src/vs/code/electron-browser/sharedProcessMain.ts
src/vs/code/electron-browser/sharedProcessMain.ts
+3
-1
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+2
-1
src/vs/platform/commands/common/commandService.ts
src/vs/platform/commands/common/commandService.ts
+2
-4
src/vs/platform/commands/test/commandService.test.ts
src/vs/platform/commands/test/commandService.test.ts
+5
-7
src/vs/platform/log/common/log.ts
src/vs/platform/log/common/log.ts
+22
-16
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+3
-5
src/vs/workbench/api/node/extHostCommands.ts
src/vs/workbench/api/node/extHostCommands.ts
+2
-4
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+2
-4
src/vs/workbench/api/node/extHostSCM.ts
src/vs/workbench/api/node/extHostSCM.ts
+2
-4
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+3
-0
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+4
-1
src/vs/workbench/services/scm/common/scmService.ts
src/vs/workbench/services/scm/common/scmService.ts
+1
-6
src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
...ench/test/electron-browser/api/extHostApiCommands.test.ts
+1
-3
src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts
...rkbench/test/electron-browser/api/extHostCommands.test.ts
+2
-3
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
...test/electron-browser/api/extHostLanguageFeatures.test.ts
+1
-2
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
...kbench/test/electron-browser/api/extHostTreeViews.test.ts
+1
-2
未找到文件。
src/vs/code/electron-browser/sharedProcessMain.ts
浏览文件 @
857ab9d5
...
...
@@ -36,7 +36,7 @@ import { ipcRenderer } from 'electron';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
createSharedProcessContributions
}
from
'
vs/code/electron-browser/contrib/contributions
'
;
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
,
registerGlobalLogService
}
from
'
vs/platform/log/common/log
'
;
export
interface
ISharedProcessConfiguration
{
readonly
machineId
:
string
;
...
...
@@ -80,6 +80,8 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
const
environmentService
=
new
EnvironmentService
(
initData
.
args
,
process
.
execPath
);
const
logService
=
new
SpdLogService
(
'
sharedprocess
'
,
environmentService
);
registerGlobalLogService
(
logService
);
logService
.
info
(
'
main
'
,
JSON
.
stringify
(
configuration
));
services
.
set
(
IEnvironmentService
,
environmentService
);
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
857ab9d5
...
...
@@ -20,7 +20,7 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
ILogService
,
LegacyLogMainService
,
MultiplexLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
,
LegacyLogMainService
,
MultiplexLogService
,
registerGlobalLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
StateService
}
from
'
vs/platform/state/node/stateService
'
;
import
{
IStateService
}
from
'
vs/platform/state/common/state
'
;
import
{
IBackupMainService
}
from
'
vs/platform/backup/common/backup
'
;
...
...
@@ -51,6 +51,7 @@ function createServices(args: ParsedArgs): IInstantiationService {
const
spdlogService
=
new
SpdLogService
(
'
main
'
,
environmentService
);
const
legacyLogService
=
new
LegacyLogMainService
(
environmentService
);
const
logService
=
new
MultiplexLogService
([
legacyLogService
,
spdlogService
]);
registerGlobalLogService
(
logService
);
// Eventually cleanup
setTimeout
(()
=>
spdlogService
.
cleanup
().
then
(
null
,
err
=>
console
.
error
(
err
)),
10000
);
...
...
src/vs/platform/commands/common/commandService.ts
浏览文件 @
857ab9d5
...
...
@@ -11,7 +11,7 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
log
,
LogLevel
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
log
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
export
class
CommandService
extends
Disposable
implements
ICommandService
{
...
...
@@ -25,9 +25,7 @@ export class CommandService extends Disposable implements ICommandService {
constructor
(
@
IInstantiationService
private
_instantiationService
:
IInstantiationService
,
@
IExtensionService
private
_extensionService
:
IExtensionService
,
@
IContextKeyService
private
_contextKeyService
:
IContextKeyService
,
// @ts-ignore
@
ILogService
private
logService
:
ILogService
@
IContextKeyService
private
_contextKeyService
:
IContextKeyService
)
{
super
();
this
.
_extensionService
.
whenInstalledExtensionsRegistered
().
then
(
value
=>
this
.
_extensionHostIsReady
=
value
);
...
...
src/vs/platform/commands/test/commandService.test.ts
浏览文件 @
857ab9d5
...
...
@@ -16,7 +16,6 @@ import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyServ
import
{
SimpleConfigurationService
}
from
'
vs/editor/standalone/browser/simpleServices
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
NoopLogService
}
from
'
vs/platform/log/common/log
'
;
class
SimpleExtensionService
implements
IExtensionService
{
_serviceBrand
:
any
;
...
...
@@ -75,7 +74,7 @@ suite('CommandService', function () {
lastEvent
=
activationEvent
;
return
super
.
activateByEvent
(
activationEvent
);
}
},
new
ContextKeyService
(
new
SimpleConfigurationService
())
,
new
NoopLogService
()
);
},
new
ContextKeyService
(
new
SimpleConfigurationService
()));
return
service
.
executeCommand
(
'
foo
'
).
then
(()
=>
{
assert
.
ok
(
lastEvent
,
'
onCommand:foo
'
);
...
...
@@ -93,7 +92,7 @@ suite('CommandService', function () {
activateByEvent
(
activationEvent
:
string
):
TPromise
<
void
>
{
return
TPromise
.
wrapError
<
void
>
(
new
Error
(
'
bad_activate
'
));
}
},
new
ContextKeyService
(
new
SimpleConfigurationService
())
,
new
NoopLogService
()
);
},
new
ContextKeyService
(
new
SimpleConfigurationService
()));
return
service
.
executeCommand
(
'
foo
'
).
then
(()
=>
assert
.
ok
(
false
),
err
=>
{
assert
.
equal
(
err
.
message
,
'
bad_activate
'
);
...
...
@@ -109,7 +108,7 @@ suite('CommandService', function () {
whenInstalledExtensionsRegistered
()
{
return
new
TPromise
<
boolean
>
(
_resolve
=>
{
/*ignore*/
});
}
},
new
ContextKeyService
(
new
SimpleConfigurationService
())
,
new
NoopLogService
()
);
},
new
ContextKeyService
(
new
SimpleConfigurationService
()));
service
.
executeCommand
(
'
bar
'
);
assert
.
equal
(
callCounter
,
1
);
...
...
@@ -126,7 +125,7 @@ suite('CommandService', function () {
whenInstalledExtensionsRegistered
()
{
return
new
TPromise
<
boolean
>
(
_resolve
=>
{
resolveFunc
=
_resolve
;
});
}
},
new
ContextKeyService
(
new
SimpleConfigurationService
())
,
new
NoopLogService
()
);
},
new
ContextKeyService
(
new
SimpleConfigurationService
()));
let
r
=
service
.
executeCommand
(
'
bar
'
);
assert
.
equal
(
callCounter
,
0
);
...
...
@@ -145,8 +144,7 @@ suite('CommandService', function () {
let
commandService
=
new
CommandService
(
new
InstantiationService
(),
new
SimpleExtensionService
(),
contextKeyService
,
new
NoopLogService
()
contextKeyService
);
let
counter
=
0
;
...
...
src/vs/platform/log/common/log.ts
浏览文件 @
857ab9d5
...
...
@@ -107,6 +107,22 @@ export class MultiplexLogService implements ILogService {
}
}
export
class
NoopLogService
implements
ILogService
{
_serviceBrand
:
any
;
trace
(
message
:
string
,
...
args
:
any
[]):
void
{
}
debug
(
message
:
string
,
...
args
:
any
[]):
void
{
}
info
(
message
:
string
,
...
args
:
any
[]):
void
{
}
warn
(
message
:
string
,
...
args
:
any
[]):
void
{
}
error
(
message
:
string
|
Error
,
...
args
:
any
[]):
void
{
}
critical
(
message
:
string
|
Error
,
...
args
:
any
[]):
void
{
}
}
let
globalLogService
:
ILogService
=
new
NoopLogService
();
export
function
registerGlobalLogService
(
logService
:
ILogService
):
void
{
globalLogService
=
logService
;
}
export
function
log
(
level
:
LogLevel
,
prefix
:
string
,
logFn
?:
(
message
:
string
,
...
args
:
any
[])
=>
string
):
Function
{
return
createDecorator
((
fn
,
key
)
=>
{
// TODO@Joao: load-time log level? return fn;
...
...
@@ -119,25 +135,15 @@ export function log(level: LogLevel, prefix: string, logFn?: (message: string, .
}
switch
(
level
)
{
case
LogLevel
.
TRACE
:
this
.
l
ogService
.
trace
(
message
);
break
;
case
LogLevel
.
DEBUG
:
this
.
l
ogService
.
debug
(
message
);
break
;
case
LogLevel
.
INFO
:
this
.
l
ogService
.
info
(
message
);
break
;
case
LogLevel
.
WARN
:
this
.
l
ogService
.
warn
(
message
);
break
;
case
LogLevel
.
ERROR
:
this
.
l
ogService
.
error
(
message
);
break
;
case
LogLevel
.
CRITICAL
:
this
.
l
ogService
.
critical
(
message
);
break
;
case
LogLevel
.
TRACE
:
globalL
ogService
.
trace
(
message
);
break
;
case
LogLevel
.
DEBUG
:
globalL
ogService
.
debug
(
message
);
break
;
case
LogLevel
.
INFO
:
globalL
ogService
.
info
(
message
);
break
;
case
LogLevel
.
WARN
:
globalL
ogService
.
warn
(
message
);
break
;
case
LogLevel
.
ERROR
:
globalL
ogService
.
error
(
message
);
break
;
case
LogLevel
.
CRITICAL
:
globalL
ogService
.
critical
(
message
);
break
;
}
return
fn
.
apply
(
this
,
args
);
};
});
}
export
class
NoopLogService
implements
ILogService
{
_serviceBrand
:
any
;
trace
(
message
:
string
,
...
args
:
any
[]):
void
{
}
debug
(
message
:
string
,
...
args
:
any
[]):
void
{
}
info
(
message
:
string
,
...
args
:
any
[]):
void
{
}
warn
(
message
:
string
,
...
args
:
any
[]):
void
{
}
error
(
message
:
string
|
Error
,
...
args
:
any
[]):
void
{
}
critical
(
message
:
string
|
Error
,
...
args
:
any
[]):
void
{
}
}
\ No newline at end of file
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
857ab9d5
...
...
@@ -57,7 +57,6 @@ import { FileChangeType, FileType } from 'vs/platform/files/common/files';
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
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
export
interface
IExtensionApiFactory
{
...
...
@@ -82,8 +81,7 @@ export function createApiFactory(
threadService
:
ExtHostThreadService
,
extHostWorkspace
:
ExtHostWorkspace
,
extHostConfiguration
:
ExtHostConfiguration
,
extensionService
:
ExtHostExtensionService
,
logService
:
ILogService
extensionService
:
ExtHostExtensionService
):
IExtensionApiFactory
{
// Addressable instances
...
...
@@ -94,7 +92,7 @@ export function createApiFactory(
const
extHostDocumentContentProviders
=
threadService
.
set
(
ExtHostContext
.
ExtHostDocumentContentProviders
,
new
ExtHostDocumentContentProvider
(
threadService
,
extHostDocumentsAndEditors
));
const
extHostDocumentSaveParticipant
=
threadService
.
set
(
ExtHostContext
.
ExtHostDocumentSaveParticipant
,
new
ExtHostDocumentSaveParticipant
(
extHostDocuments
,
threadService
.
get
(
MainContext
.
MainThreadEditors
)));
const
extHostEditors
=
threadService
.
set
(
ExtHostContext
.
ExtHostEditors
,
new
ExtHostEditors
(
threadService
,
extHostDocumentsAndEditors
));
const
extHostCommands
=
threadService
.
set
(
ExtHostContext
.
ExtHostCommands
,
new
ExtHostCommands
(
threadService
,
extHostHeapService
,
logService
));
const
extHostCommands
=
threadService
.
set
(
ExtHostContext
.
ExtHostCommands
,
new
ExtHostCommands
(
threadService
,
extHostHeapService
));
const
extHostTreeViews
=
threadService
.
set
(
ExtHostContext
.
ExtHostTreeViews
,
new
ExtHostTreeViews
(
threadService
.
get
(
MainContext
.
MainThreadTreeViews
),
extHostCommands
));
threadService
.
set
(
ExtHostContext
.
ExtHostWorkspace
,
extHostWorkspace
);
const
extHostDebugService
=
threadService
.
set
(
ExtHostContext
.
ExtHostDebugService
,
new
ExtHostDebugService
(
threadService
,
extHostWorkspace
));
...
...
@@ -105,7 +103,7 @@ export function createApiFactory(
const
extHostFileSystemEvent
=
threadService
.
set
(
ExtHostContext
.
ExtHostFileSystemEventService
,
new
ExtHostFileSystemEventService
());
const
extHostQuickOpen
=
threadService
.
set
(
ExtHostContext
.
ExtHostQuickOpen
,
new
ExtHostQuickOpen
(
threadService
,
extHostWorkspace
,
extHostCommands
));
const
extHostTerminalService
=
threadService
.
set
(
ExtHostContext
.
ExtHostTerminalService
,
new
ExtHostTerminalService
(
threadService
));
const
extHostSCM
=
threadService
.
set
(
ExtHostContext
.
ExtHostSCM
,
new
ExtHostSCM
(
threadService
,
extHostCommands
,
logService
));
const
extHostSCM
=
threadService
.
set
(
ExtHostContext
.
ExtHostSCM
,
new
ExtHostSCM
(
threadService
,
extHostCommands
));
const
extHostTask
=
threadService
.
set
(
ExtHostContext
.
ExtHostTask
,
new
ExtHostTask
(
threadService
,
extHostWorkspace
));
const
extHostWindow
=
threadService
.
set
(
ExtHostContext
.
ExtHostWindow
,
new
ExtHostWindow
(
threadService
));
threadService
.
set
(
ExtHostContext
.
ExtHostExtensionService
,
extensionService
);
...
...
src/vs/workbench/api/node/extHostCommands.ts
浏览文件 @
857ab9d5
...
...
@@ -15,7 +15,7 @@ import { ExtHostHeapService } from 'vs/workbench/api/node/extHostHeapService';
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
ILogService
,
log
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
log
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
interface
CommandHandler
{
callback
:
Function
;
...
...
@@ -36,9 +36,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
constructor
(
mainContext
:
IMainContext
,
heapService
:
ExtHostHeapService
,
// @ts-ignore
@
ILogService
private
logService
:
ILogService
heapService
:
ExtHostHeapService
)
{
this
.
_proxy
=
mainContext
.
get
(
MainContext
.
MainThreadCommands
);
this
.
_converter
=
new
CommandsConverter
(
this
,
heapService
);
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
857ab9d5
...
...
@@ -21,7 +21,6 @@ import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
import
{
realpath
}
from
'
fs
'
;
import
{
TernarySearchTree
}
from
'
vs/base/common/map
'
;
import
{
Barrier
}
from
'
vs/base/common/async
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
class
ExtensionMemento
implements
IExtensionMemento
{
...
...
@@ -126,8 +125,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
constructor
(
initData
:
IInitData
,
threadService
:
ExtHostThreadService
,
extHostWorkspace
:
ExtHostWorkspace
,
extHostConfiguration
:
ExtHostConfiguration
,
logService
:
ILogService
extHostConfiguration
:
ExtHostConfiguration
)
{
this
.
_barrier
=
new
Barrier
();
this
.
_registry
=
new
ExtensionDescriptionRegistry
(
initData
.
extensions
);
...
...
@@ -139,7 +137,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
this
.
_activator
=
null
;
// initialize API first (i.e. do not release barrier until the API is initialized)
const
apiFactory
=
createApiFactory
(
initData
,
threadService
,
extHostWorkspace
,
extHostConfiguration
,
this
,
logService
);
const
apiFactory
=
createApiFactory
(
initData
,
threadService
,
extHostWorkspace
,
extHostConfiguration
,
this
);
initializeExtensionApi
(
this
,
apiFactory
).
then
(()
=>
{
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
857ab9d5
...
...
@@ -17,7 +17,7 @@ import { sortedDiff } from 'vs/base/common/arrays';
import
{
comparePaths
}
from
'
vs/base/common/comparers
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
ISplice
}
from
'
vs/base/common/sequence
'
;
import
{
log
,
LogLevel
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
log
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
type
ProviderHandle
=
number
;
type
GroupHandle
=
number
;
...
...
@@ -444,9 +444,7 @@ export class ExtHostSCM {
constructor
(
mainContext
:
IMainContext
,
private
_commands
:
ExtHostCommands
,
// @ts-ignore
@
ILogService
private
logService
:
ILogService
private
_commands
:
ExtHostCommands
)
{
this
.
_proxy
=
mainContext
.
get
(
MainContext
.
MainThreadSCM
);
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
857ab9d5
...
...
@@ -42,6 +42,7 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
fs
=
require
(
'
fs
'
);
import
{
registerGlobalLogService
}
from
'
vs/platform/log/common/log
'
;
gracefulFs
.
gracefulify
(
fs
);
// enable gracefulFs
const
currentWindowId
=
remote
.
getCurrentWindow
().
id
;
...
...
@@ -74,6 +75,8 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
const
environmentService
=
new
EnvironmentService
(
configuration
,
configuration
.
execPath
);
const
logService
=
new
SpdLogService
(
`renderer
${
currentWindowId
}
`
,
environmentService
);
registerGlobalLogService
(
logService
);
logService
.
info
(
'
openWorkbench
'
,
JSON
.
stringify
(
configuration
));
// Since the configuration service is one of the core services that is used in so many places, we initialize it
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
857ab9d5
...
...
@@ -24,6 +24,7 @@ import * as glob from 'vs/base/common/glob';
import
{
ExtensionActivatedByEvent
}
from
'
vs/workbench/api/node/extHostExtensionActivator
'
;
import
{
EnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
registerGlobalLogService
}
from
'
vs/platform/log/common/log
'
;
// const nativeExit = process.exit.bind(process);
function
patchProcess
(
allowExit
:
boolean
)
{
...
...
@@ -88,10 +89,12 @@ export class ExtensionHostMain {
const
extHostWorkspace
=
new
ExtHostWorkspace
(
threadService
,
initData
.
workspace
);
const
environmentService
=
new
EnvironmentService
(
initData
.
args
,
initData
.
execPath
);
const
logService
=
new
SpdLogService
(
`exthost
${
initData
.
windowId
}
`
,
environmentService
);
registerGlobalLogService
(
logService
);
logService
.
info
(
'
main {0}
'
,
initData
);
this
.
_extHostConfiguration
=
new
ExtHostConfiguration
(
threadService
.
get
(
MainContext
.
MainThreadConfiguration
),
extHostWorkspace
,
initData
.
configuration
);
this
.
_extensionService
=
new
ExtHostExtensionService
(
initData
,
threadService
,
extHostWorkspace
,
this
.
_extHostConfiguration
,
logService
);
this
.
_extensionService
=
new
ExtHostExtensionService
(
initData
,
threadService
,
extHostWorkspace
,
this
.
_extHostConfiguration
);
// error forwarding and stack trace scanning
const
extensionErrors
=
new
WeakMap
<
Error
,
IExtensionDescription
>
();
...
...
src/vs/workbench/services/scm/common/scmService.ts
浏览文件 @
857ab9d5
...
...
@@ -8,7 +8,7 @@
import
{
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
ISCMService
,
ISCMProvider
,
ISCMInput
,
ISCMRepository
}
from
'
./scm
'
;
import
{
log
,
LogLevel
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
log
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
class
SCMInput
implements
ISCMInput
{
...
...
@@ -77,11 +77,6 @@ export class SCMService implements ISCMService {
private
_onDidRemoveProvider
=
new
Emitter
<
ISCMRepository
>
();
get
onDidRemoveRepository
():
Event
<
ISCMRepository
>
{
return
this
.
_onDidRemoveProvider
.
event
;
}
constructor
(
// @ts-ignore
@
ILogService
private
logService
:
ILogService
)
{
}
@
log
(
LogLevel
.
INFO
,
'
SCMService
'
)
registerSCMProvider
(
provider
:
ISCMProvider
):
ISCMRepository
{
if
(
this
.
_providerIds
.
has
(
provider
.
id
))
{
...
...
src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
浏览文件 @
857ab9d5
...
...
@@ -32,7 +32,6 @@ import { ExtHostDiagnostics } from 'vs/workbench/api/node/extHostDiagnostics';
import
*
as
vscode
from
'
vscode
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
'
vs/workbench/parts/search/electron-browser/search.contribution
'
;
import
{
NoopLogService
}
from
'
vs/platform/log/common/log
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
EditorCommon
.
IModel
=
EditorModel
.
createFromString
(
...
...
@@ -113,9 +112,8 @@ suite('ExtHostLanguageFeatureCommands', function () {
threadService
.
set
(
ExtHostContext
.
ExtHostDocuments
,
extHostDocuments
);
const
heapService
=
new
ExtHostHeapService
();
const
logService
=
new
NoopLogService
();
commands
=
new
ExtHostCommands
(
threadService
,
heapService
,
logService
);
commands
=
new
ExtHostCommands
(
threadService
,
heapService
);
threadService
.
set
(
ExtHostContext
.
ExtHostCommands
,
commands
);
threadService
.
setTestInstance
(
MainContext
.
MainThreadCommands
,
inst
.
createInstance
(
MainThreadCommands
,
threadService
));
ExtHostApiCommands
.
register
(
commands
);
...
...
src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts
浏览文件 @
857ab9d5
...
...
@@ -12,7 +12,6 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
OneGetThreadService
}
from
'
./testThreadService
'
;
import
{
mock
}
from
'
vs/workbench/test/electron-browser/api/mock
'
;
import
{
NoopLogService
}
from
'
vs/platform/log/common/log
'
;
suite
(
'
ExtHostCommands
'
,
function
()
{
...
...
@@ -30,7 +29,7 @@ suite('ExtHostCommands', function () {
}
};
const
commands
=
new
ExtHostCommands
(
OneGetThreadService
(
shape
),
undefined
,
new
NoopLogService
()
);
const
commands
=
new
ExtHostCommands
(
OneGetThreadService
(
shape
),
undefined
);
commands
.
registerCommand
(
'
foo
'
,
():
any
=>
{
}).
dispose
();
assert
.
equal
(
lastUnregister
,
'
foo
'
);
assert
.
equal
(
CommandsRegistry
.
getCommand
(
'
foo
'
),
undefined
);
...
...
@@ -51,7 +50,7 @@ suite('ExtHostCommands', function () {
}
};
const
commands
=
new
ExtHostCommands
(
OneGetThreadService
(
shape
),
undefined
,
new
NoopLogService
()
);
const
commands
=
new
ExtHostCommands
(
OneGetThreadService
(
shape
),
undefined
);
const
reg
=
commands
.
registerCommand
(
'
foo
'
,
():
any
=>
{
});
reg
.
dispose
();
reg
.
dispose
();
...
...
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
浏览文件 @
857ab9d5
...
...
@@ -44,7 +44,6 @@ import { ExtHostDiagnostics } from 'vs/workbench/api/node/extHostDiagnostics';
import
{
ExtHostHeapService
}
from
'
vs/workbench/api/node/extHostHeapService
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
NoopLogService
}
from
'
vs/platform/log/common/log
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
EditorCommon
.
IModel
=
EditorModel
.
createFromString
(
...
...
@@ -103,7 +102,7 @@ suite('ExtHostLanguageFeatures', function () {
const
heapService
=
new
ExtHostHeapService
();
const
commands
=
new
ExtHostCommands
(
threadService
,
heapService
,
new
NoopLogService
()
);
const
commands
=
new
ExtHostCommands
(
threadService
,
heapService
);
threadService
.
set
(
ExtHostContext
.
ExtHostCommands
,
commands
);
threadService
.
setTestInstance
(
MainContext
.
MainThreadCommands
,
inst
.
createInstance
(
MainThreadCommands
,
threadService
));
...
...
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
浏览文件 @
857ab9d5
...
...
@@ -17,7 +17,6 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
import
{
MainThreadCommands
}
from
'
vs/workbench/api/electron-browser/mainThreadCommands
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
mock
}
from
'
vs/workbench/test/electron-browser/api/mock
'
;
import
{
NoopLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TreeItemCollapsibleState
,
ITreeItem
}
from
'
vs/workbench/common/views
'
;
...
...
@@ -66,7 +65,7 @@ suite('ExtHostTreeView', function () {
threadService
.
setTestInstance
(
MainContext
.
MainThreadCommands
,
inst
.
createInstance
(
MainThreadCommands
,
threadService
));
target
=
new
RecordingShape
();
testObject
=
new
ExtHostTreeViews
(
target
,
new
ExtHostCommands
(
threadService
,
new
ExtHostHeapService
()
,
new
NoopLogService
()
));
testObject
=
new
ExtHostTreeViews
(
target
,
new
ExtHostCommands
(
threadService
,
new
ExtHostHeapService
()));
onDidChangeTreeData
=
new
Emitter
<
string
>
();
testObject
.
registerTreeDataProvider
(
'
testDataProvider
'
,
aTreeDataProvider
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录