Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7b2b4b93
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,发现更多精彩内容 >>
提交
7b2b4b93
编写于
11月 08, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipc: remove vscode:telemetry
上级
14713079
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
17 deletion
+22
-17
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+14
-9
src/vs/code/electron-main/menus.ts
src/vs/code/electron-main/menus.ts
+4
-2
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+4
-2
src/vs/workbench/electron-browser/integration.ts
src/vs/workbench/electron-browser/integration.ts
+0
-4
未找到文件。
src/vs/code/electron-main/main.ts
浏览文件 @
7b2b4b93
...
...
@@ -84,10 +84,9 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
const
instantiationService
=
accessor
.
get
(
IInstantiationService
);
const
logService
=
accessor
.
get
(
ILogService
);
const
environmentService
=
accessor
.
get
(
IEnvironmentService
);
const
windowsMainService
=
accessor
.
get
(
IWindowsMainService
);
const
lifecycleService
=
accessor
.
get
(
ILifecycleService
);
const
configurationService
=
accessor
.
get
(
IConfigurationService
)
as
ConfigurationService
<
any
>
;
const
windowEventChannel
=
new
WindowEventChannel
(
windowsMainService
)
;
let
windowsMainService
:
IWindowsMainService
;
// We handle uncaught exceptions here to prevent electron from opening a dialog to the user
process
.
on
(
'
uncaughtException
'
,
(
err
:
any
)
=>
{
...
...
@@ -100,7 +99,9 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
};
// handle on client side
windowsMainService
.
sendToFocused
(
'
vscode:reportError
'
,
JSON
.
stringify
(
friendlyError
));
if
(
windowsMainService
)
{
windowsMainService
.
sendToFocused
(
'
vscode:reportError
'
,
JSON
.
stringify
(
friendlyError
));
}
}
console
.
error
(
'
[uncaught exception in main]:
'
+
err
);
...
...
@@ -141,10 +142,6 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
const
urlChannel
=
instantiationService
.
createInstance
(
URLChannel
,
urlService
);
electronIpcServer
.
registerChannel
(
'
url
'
,
urlChannel
);
const
windowsService
=
accessor
.
get
(
IWindowsService
);
const
windowsChannel
=
new
WindowsChannel
(
windowsService
);
electronIpcServer
.
registerChannel
(
'
windows
'
,
windowsChannel
);
// Spawn shared process
const
initData
=
{
args
:
environmentService
.
args
};
const
options
=
{
...
...
@@ -163,7 +160,10 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
// requires a connection to shared process, which was only established
// now.
const
services
=
new
ServiceCollection
();
services
.
set
(
IUpdateService
,
new
SyncDescriptor
(
UpdateService
));
services
.
set
(
IWindowsMainService
,
new
SyncDescriptor
(
WindowsManager
));
services
.
set
(
IWindowsService
,
new
SyncDescriptor
(
WindowsService
));
if
(
environmentService
.
isBuilt
&&
!
environmentService
.
extensionDevelopmentPath
&&
!!
product
.
enableTelemetry
)
{
const
channel
=
getDelayedChannel
<
ITelemetryAppenderChannel
>
(
sharedProcess
.
then
(
c
=>
c
.
getChannel
(
'
telemetryAppender
'
)));
...
...
@@ -184,7 +184,14 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
const
updateChannel
=
new
UpdateChannel
(
updateService
);
electronIpcServer
.
registerChannel
(
'
update
'
,
updateChannel
);
const
windowsService
=
accessor
.
get
(
IWindowsService
);
const
windowsChannel
=
new
WindowsChannel
(
windowsService
);
electronIpcServer
.
registerChannel
(
'
windows
'
,
windowsChannel
);
// TODO@Joao revisit this
// Register windowEvent
windowsMainService
=
accessor
.
get
(
IWindowsMainService
);
const
windowEventChannel
=
new
WindowEventChannel
(
windowsMainService
);
sharedProcess
.
done
(
client
=>
client
.
registerChannel
(
'
windowEvent
'
,
windowEventChannel
));
// Make sure we associate the program with the app user model id
...
...
@@ -485,8 +492,6 @@ function createServices(args): IInstantiationService {
services
.
set
(
IEnvironmentService
,
new
SyncDescriptor
(
EnvironmentService
,
args
,
process
.
execPath
));
services
.
set
(
ILogService
,
new
SyncDescriptor
(
MainLogService
));
services
.
set
(
IWindowsMainService
,
new
SyncDescriptor
(
WindowsManager
));
services
.
set
(
IWindowsService
,
new
SyncDescriptor
(
WindowsService
));
services
.
set
(
ILifecycleService
,
new
SyncDescriptor
(
LifecycleService
));
services
.
set
(
IStorageService
,
new
SyncDescriptor
(
StorageService
));
services
.
set
(
IConfigurationService
,
new
SyncDescriptor
(
ConfigurationService
));
...
...
src/vs/code/electron-main/menus.ts
浏览文件 @
7b2b4b93
...
...
@@ -15,6 +15,7 @@ import { IPath, VSCodeWindow } from 'vs/code/electron-main/window';
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
}
from
'
vs/code/electron-main/storage
'
;
import
{
IFilesConfiguration
,
AutoSaveConfiguration
}
from
'
vs/platform/files/common/files
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IUpdateService
,
State
as
UpdateState
}
from
'
vs/platform/update/common/update
'
;
import
{
Keybinding
}
from
'
vs/base/common/keybinding
'
;
import
product
from
'
vs/platform/product
'
;
...
...
@@ -58,7 +59,8 @@ export class VSCodeMenu {
@
IUpdateService
private
updateService
:
IUpdateService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IWindowsMainService
private
windowsService
:
IWindowsMainService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
)
{
this
.
actionIdKeybindingRequests
=
[];
...
...
@@ -884,7 +886,7 @@ export class VSCodeMenu {
}
private
reportMenuActionTelemetry
(
id
:
string
):
void
{
this
.
windowsService
.
sendToFocused
(
'
vscode:telemetry
'
,
{
eventName
:
'
workbenchActionExecuted
'
,
data
:
{
id
,
from
:
'
menu
'
}
});
this
.
telemetryService
.
publicLog
(
'
workbenchActionExecuted
'
,
{
id
,
from
:
'
menu
'
});
}
}
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
7b2b4b93
...
...
@@ -25,6 +25,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import
{
ILogService
}
from
'
vs/code/electron-main/log
'
;
import
{
IWindowEventService
}
from
'
vs/code/common/windows
'
;
import
{
createDecorator
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
CommonEvent
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
product
from
'
vs/platform/product
'
;
import
{
ParsedArgs
}
from
'
vs/platform/environment/node/argv
'
;
...
...
@@ -152,7 +153,8 @@ export class WindowsManager implements IWindowsMainService, IWindowEventService
@
IStorageService
private
storageService
:
IStorageService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
)
{
}
onOpen
(
clb
:
(
path
:
IPath
)
=>
void
):
()
=>
void
{
...
...
@@ -296,7 +298,7 @@ export class WindowsManager implements IWindowsMainService, IWindowEventService
this
.
logService
.
log
(
error
);
// be on the safe side with these hardware method calls
}
window
.
send
(
'
vscode:telemetry
'
,
{
eventName
:
'
startupTime
'
,
data
:
{
ellapsed
:
Date
.
now
()
-
global
.
vscodeStart
,
totalmem
,
cpus
}
});
this
.
telemetryService
.
publicLog
(
'
startupTime
'
,
{
ellapsed
:
Date
.
now
()
-
global
.
vscodeStart
,
totalmem
,
cpus
});
}
private
onBroadcast
(
event
:
string
,
payload
:
any
):
void
{
...
...
src/vs/workbench/electron-browser/integration.ts
浏览文件 @
7b2b4b93
...
...
@@ -107,10 +107,6 @@ export class ElectronIntegration {
},
()
=>
errors
.
onUnexpectedError
);
});
ipc
.
on
(
'
vscode:telemetry
'
,
(
event
,
{
eventName
,
data
})
=>
{
this
.
telemetryService
.
publicLog
(
eventName
,
data
);
});
ipc
.
on
(
'
vscode:reportError
'
,
(
event
,
error
)
=>
{
if
(
error
)
{
const
errorParsed
=
JSON
.
parse
(
error
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录