Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a48a0cde
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,发现更多精彩内容 >>
提交
a48a0cde
编写于
8月 28, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #29862: Add telemetry when the user uses a template to configure the task runner
上级
c08d0606
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
9 deletion
+41
-9
src/vs/workbench/parts/tasks/common/taskSystem.ts
src/vs/workbench/parts/tasks/common/taskSystem.ts
+2
-0
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+17
-0
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+18
-8
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+2
-0
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
+1
-0
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+1
-1
未找到文件。
src/vs/workbench/parts/tasks/common/taskSystem.ts
浏览文件 @
a48a0cde
...
...
@@ -39,6 +39,8 @@ export interface TelemetryEvent {
runner
:
'
terminal
'
|
'
output
'
;
taskKind
:
string
;
// The command triggered
command
:
string
;
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
a48a0cde
...
...
@@ -231,6 +231,7 @@ export interface WorkspaceTaskSource {
kind
:
'
workspace
'
;
label
:
string
;
config
:
TaskSourceConfigElement
;
customizes
?:
TaskIdentifier
;
}
export
interface
ExtensionTaskSource
{
...
...
@@ -409,6 +410,22 @@ export namespace Task {
return
task
.
defines
.
_key
;
}
}
export
function
getTelemetryKind
(
task
:
Task
):
string
{
if
(
ContributedTask
.
is
(
task
))
{
return
'
extension
'
;
}
else
if
(
CustomTask
.
is
(
task
))
{
if
(
task
.
_source
.
customizes
)
{
return
'
workspace>extension
'
;
}
else
{
return
'
workspace
'
;
}
}
else
if
(
CompositeTask
.
is
(
task
))
{
return
'
composite
'
;
}
else
{
return
'
unknown
'
;
}
}
}
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
a48a0cde
...
...
@@ -106,7 +106,8 @@ abstract class OpenTaskConfigurationAction extends Action {
private
messageService
:
IMessageService
,
private
quickOpenService
:
IQuickOpenService
,
private
environmentService
:
IEnvironmentService
,
private
configurationResolverService
:
IConfigurationResolverService
,
private
extensionService
:
IExtensionService
)
{
private
extensionService
:
IExtensionService
,
private
telemetryService
:
ITelemetryService
)
{
super
(
id
,
label
);
}
...
...
@@ -169,7 +170,13 @@ abstract class OpenTaskConfigurationAction extends Action {
content
=
content
.
replace
(
/
(\n)(\t
+
)
/g
,
(
_
,
s1
,
s2
)
=>
s1
+
strings
.
repeat
(
'
'
,
s2
.
length
*
editorConfig
.
editor
.
tabSize
));
}
configFileCreated
=
true
;
return
this
.
fileService
.
createFile
(
this
.
contextService
.
toResource
(
'
.vscode/tasks.json
'
),
content
);
// TODO@Dirk (https://github.com/Microsoft/vscode/issues/29454)
return
this
.
fileService
.
createFile
(
this
.
contextService
.
toResource
(
'
.vscode/tasks.json
'
),
content
).
then
((
result
)
=>
{
this
.
telemetryService
.
publicLog
(
TaskService
.
TemplateTelemetryEventName
,
{
templateId
:
selection
.
id
,
autoDetect
:
selection
.
autoDetect
});
return
result
;
});
// TODO@Dirk (https://github.com/Microsoft/vscode/issues/29454)
});
/* 2.0 version
let content = selection.content;
...
...
@@ -210,10 +217,11 @@ class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
configurationResolverService
:
IConfigurationResolverService
,
@
IExtensionService
extensionService
)
{
@
IExtensionService
extensionService
,
@
ITelemetryService
telemetryService
)
{
super
(
id
,
label
,
taskService
,
configurationService
,
editorService
,
fileService
,
contextService
,
outputService
,
messageService
,
quickOpenService
,
environmentService
,
configurationResolverService
,
extensionService
);
extensionService
,
telemetryService
);
}
}
...
...
@@ -228,10 +236,11 @@ class ConfigureBuildTaskAction extends OpenTaskConfigurationAction {
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
configurationResolverService
:
IConfigurationResolverService
,
@
IExtensionService
extensionService
)
{
@
IExtensionService
extensionService
,
@
ITelemetryService
telemetryService
)
{
super
(
id
,
label
,
taskService
,
configurationService
,
editorService
,
fileService
,
contextService
,
outputService
,
messageService
,
quickOpenService
,
environmentService
,
configurationResolverService
,
extensionService
);
extensionService
,
telemetryService
);
}
}
...
...
@@ -625,6 +634,7 @@ class TaskService extends EventEmitter implements ITaskService {
private
static
RanTaskBefore_Key
=
'
workbench.tasks.ranTaskBefore
'
;
private
static
CustomizationTelemetryEventName
:
string
=
'
taskService.customize
'
;
public
static
TemplateTelemetryEventName
:
string
=
'
taskService.template
'
;
public
_serviceBrand
:
any
;
public
static
SERVICE_ID
:
string
=
'
taskService
'
;
...
...
@@ -1589,14 +1599,14 @@ class TaskService extends EventEmitter implements ITaskService {
return
new
ConfigureTaskRunnerAction
(
ConfigureTaskRunnerAction
.
ID
,
ConfigureTaskRunnerAction
.
TEXT
,
this
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
,
this
.
configurationResolverService
,
this
.
extensionService
);
this
.
extensionService
,
this
.
telemetryService
);
}
private
configureBuildTask
():
Action
{
return
new
ConfigureBuildTaskAction
(
ConfigureBuildTaskAction
.
ID
,
ConfigureBuildTaskAction
.
TEXT
,
this
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
,
this
.
configurationResolverService
,
this
.
extensionService
);
this
.
extensionService
,
this
.
telemetryService
);
}
public
beforeShutdown
():
boolean
|
TPromise
<
boolean
>
{
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
a48a0cde
...
...
@@ -403,6 +403,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let
telemetryEvent
:
TelemetryEvent
=
{
trigger
:
trigger
,
runner
:
'
terminal
'
,
taskKind
:
Task
.
getTelemetryKind
(
task
),
command
:
this
.
getSanitizedCommand
(
executedCommand
),
success
:
true
,
exitCode
:
summary
.
exitCode
...
...
@@ -416,6 +417,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let
telemetryEvent
:
TelemetryEvent
=
{
trigger
:
trigger
,
runner
:
'
terminal
'
,
taskKind
:
Task
.
getTelemetryKind
(
task
),
command
:
this
.
getSanitizedCommand
(
executedCommand
),
success
:
false
};
...
...
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
浏览文件 @
a48a0cde
...
...
@@ -139,6 +139,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem {
let
telemetryEvent
:
TelemetryEvent
=
{
trigger
:
trigger
,
runner
:
'
output
'
,
taskKind
:
Task
.
getTelemetryKind
(
task
),
command
:
'
other
'
,
success
:
true
};
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
a48a0cde
...
...
@@ -1286,7 +1286,7 @@ namespace CustomTask {
export
function
createCustomTask
(
contributedTask
:
Tasks
.
ContributedTask
,
configuredProps
:
Tasks
.
ConfigurationProperties
&
{
_id
:
string
,
_source
:
Tasks
.
WorkspaceTaskSource
}):
Tasks
.
CustomTask
{
let
result
:
Tasks
.
CustomTask
=
{
_id
:
configuredProps
.
_id
,
_source
:
configuredProps
.
_source
,
_source
:
Objects
.
assign
({},
configuredProps
.
_source
,
{
customizes
:
contributedTask
.
defines
})
,
_label
:
configuredProps
.
name
||
contributedTask
.
_label
,
type
:
'
custom
'
,
command
:
contributedTask
.
command
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录