Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
22a6f7a8
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,发现更多精彩内容 >>
提交
22a6f7a8
编写于
2月 16, 2017
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tag editor action telemetry in walk-through (fixes #19888)
上级
8fc9afcc
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
47 addition
and
11 deletion
+47
-11
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+4
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+5
-0
src/vs/editor/common/editorCommonExtensions.ts
src/vs/editor/common/editorCommonExtensions.ts
+3
-3
src/vs/editor/contrib/folding/browser/folding.ts
src/vs/editor/contrib/folding/browser/folding.ts
+1
-1
src/vs/editor/contrib/gotoError/browser/gotoError.ts
src/vs/editor/contrib/gotoError/browser/gotoError.ts
+1
-1
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+2
-2
src/vs/platform/telemetry/common/telemetry.ts
src/vs/platform/telemetry/common/telemetry.ts
+1
-0
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
...s/welcome/walkThrough/electron-browser/walkThroughPart.ts
+27
-1
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
...kbench/parts/welcome/walkThrough/node/walkThroughInput.ts
+3
-3
未找到文件。
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
22a6f7a8
...
@@ -1006,6 +1006,10 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
...
@@ -1006,6 +1006,10 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
protected
abstract
_registerDecorationType
(
key
:
string
,
options
:
editorCommon
.
IDecorationRenderOptions
,
parentTypeKey
?:
string
):
void
;
protected
abstract
_registerDecorationType
(
key
:
string
,
options
:
editorCommon
.
IDecorationRenderOptions
,
parentTypeKey
?:
string
):
void
;
protected
abstract
_removeDecorationType
(
key
:
string
):
void
;
protected
abstract
_removeDecorationType
(
key
:
string
):
void
;
protected
abstract
_resolveDecorationOptions
(
typeKey
:
string
,
writable
:
boolean
):
editorCommon
.
IModelDecorationOptions
;
protected
abstract
_resolveDecorationOptions
(
typeKey
:
string
,
writable
:
boolean
):
editorCommon
.
IModelDecorationOptions
;
public
getTelemetryData
():
{
[
key
:
string
]:
any
;
}
{
return
null
;
}
}
}
class
EditorContextKeysManager
extends
Disposable
{
class
EditorContextKeysManager
extends
Disposable
{
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
22a6f7a8
...
@@ -4039,6 +4039,11 @@ export interface ICommonCodeEditor extends IEditor {
...
@@ -4039,6 +4039,11 @@ export interface ICommonCodeEditor extends IEditor {
* Get the layout info for the editor.
* Get the layout info for the editor.
*/
*/
getLayoutInfo
():
EditorLayoutInfo
;
getLayoutInfo
():
EditorLayoutInfo
;
/**
* @internal
*/
getTelemetryData
():
{
[
key
:
string
]:
any
;
};
}
}
export
interface
ICommonDiffEditor
extends
IEditor
{
export
interface
ICommonDiffEditor
extends
IEditor
{
...
...
src/vs/editor/common/editorCommonExtensions.ts
浏览文件 @
22a6f7a8
...
@@ -62,12 +62,12 @@ export abstract class EditorAction extends ConfigEditorCommand {
...
@@ -62,12 +62,12 @@ export abstract class EditorAction extends ConfigEditorCommand {
}
}
public
runEditorCommand
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
,
args
:
any
):
void
|
TPromise
<
void
>
{
public
runEditorCommand
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
,
args
:
any
):
void
|
TPromise
<
void
>
{
this
.
reportTelemetry
(
accessor
);
this
.
reportTelemetry
(
accessor
,
editor
);
return
this
.
run
(
accessor
,
editor
,
args
);
return
this
.
run
(
accessor
,
editor
,
args
);
}
}
protected
reportTelemetry
(
accessor
:
ServicesAccessor
)
{
protected
reportTelemetry
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
)
{
accessor
.
get
(
ITelemetryService
).
publicLog
(
'
editorActionInvoked
'
,
{
name
:
this
.
label
,
id
:
this
.
id
});
accessor
.
get
(
ITelemetryService
).
publicLog
(
'
editorActionInvoked
'
,
{
name
:
this
.
label
,
id
:
this
.
id
,
...
editor
.
getTelemetryData
()
});
}
}
public
abstract
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
,
args
:
any
):
void
|
TPromise
<
void
>
;
public
abstract
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
,
args
:
any
):
void
|
TPromise
<
void
>
;
...
...
src/vs/editor/contrib/folding/browser/folding.ts
浏览文件 @
22a6f7a8
...
@@ -505,7 +505,7 @@ abstract class FoldingAction<T> extends EditorAction {
...
@@ -505,7 +505,7 @@ abstract class FoldingAction<T> extends EditorAction {
if
(
!
foldingController
)
{
if
(
!
foldingController
)
{
return
;
return
;
}
}
this
.
reportTelemetry
(
accessor
);
this
.
reportTelemetry
(
accessor
,
editor
);
this
.
invoke
(
foldingController
,
editor
,
args
);
this
.
invoke
(
foldingController
,
editor
,
args
);
}
}
...
...
src/vs/editor/contrib/gotoError/browser/gotoError.ts
浏览文件 @
22a6f7a8
...
@@ -322,7 +322,7 @@ class MarkerNavigationAction extends EditorAction {
...
@@ -322,7 +322,7 @@ class MarkerNavigationAction extends EditorAction {
}
}
let
model
=
controller
.
getOrCreateModel
();
let
model
=
controller
.
getOrCreateModel
();
telemetryService
.
publicLog
(
'
zoneWidgetShown
'
,
{
mode
:
'
go to error
'
});
telemetryService
.
publicLog
(
'
zoneWidgetShown
'
,
{
mode
:
'
go to error
'
,
...
editor
.
getTelemetryData
()
});
if
(
model
)
{
if
(
model
)
{
if
(
this
.
_isNext
)
{
if
(
this
.
_isNext
)
{
model
.
next
();
model
.
next
();
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
22a6f7a8
...
@@ -593,7 +593,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
...
@@ -593,7 +593,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
}
else
{
}
else
{
const
{
stats
}
=
this
.
completionModel
;
const
{
stats
}
=
this
.
completionModel
;
stats
[
'
wasAutomaticallyTriggered
'
]
=
!!
isAuto
;
stats
[
'
wasAutomaticallyTriggered
'
]
=
!!
isAuto
;
this
.
telemetryService
.
publicLog
(
'
suggestWidget
'
,
stats
);
this
.
telemetryService
.
publicLog
(
'
suggestWidget
'
,
{
...
stats
,
...
this
.
editor
.
getTelemetryData
()
}
);
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
completionModel
.
items
);
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
completionModel
.
items
);
this
.
list
.
setFocus
([
this
.
completionModel
.
topScoreIdx
]);
this
.
list
.
setFocus
([
this
.
completionModel
.
topScoreIdx
]);
...
@@ -694,7 +694,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
...
@@ -694,7 +694,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
this
.
setState
(
State
.
Details
);
this
.
setState
(
State
.
Details
);
this
.
editor
.
focus
();
this
.
editor
.
focus
();
this
.
telemetryService
.
publicLog
(
'
suggestWidget:toggleDetails
'
);
this
.
telemetryService
.
publicLog
(
'
suggestWidget:toggleDetails
'
,
this
.
editor
.
getTelemetryData
()
);
}
}
private
show
():
void
{
private
show
():
void
{
...
...
src/vs/platform/telemetry/common/telemetry.ts
浏览文件 @
22a6f7a8
...
@@ -17,6 +17,7 @@ export interface ITelemetryInfo {
...
@@ -17,6 +17,7 @@ export interface ITelemetryInfo {
export
interface
ITelemetryData
{
export
interface
ITelemetryData
{
from
?:
string
;
from
?:
string
;
target
?:
string
;
[
key
:
string
]:
any
;
[
key
:
string
]:
any
;
}
}
...
...
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
浏览文件 @
22a6f7a8
...
@@ -36,6 +36,8 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
...
@@ -36,6 +36,8 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
import
SCMPreview
from
'
vs/workbench/parts/scm/browser/scmPreview
'
;
import
SCMPreview
from
'
vs/workbench/parts/scm/browser/scmPreview
'
;
import
{
isObject
}
from
'
vs/base/common/types
'
;
import
{
isObject
}
from
'
vs/base/common/types
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
export
const
WALK_THROUGH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
interactivePlaygroundFocus
'
,
false
);
export
const
WALK_THROUGH_FOCUS
=
new
RawContextKey
<
boolean
>
(
'
interactivePlaygroundFocus
'
,
false
);
...
@@ -57,6 +59,25 @@ interface IWalkThroughEditorViewStates {
...
@@ -57,6 +59,25 @@ interface IWalkThroughEditorViewStates {
2
?:
IWalkThroughEditorViewState
;
2
?:
IWalkThroughEditorViewState
;
}
}
class
WalkThroughCodeEditor
extends
CodeEditor
{
constructor
(
domElement
:
HTMLElement
,
options
:
IEditorOptions
,
private
telemetryData
:
Object
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICommandService
commandService
:
ICommandService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
super
(
domElement
,
options
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
);
}
getTelemetryData
()
{
return
this
.
telemetryData
;
}
}
export
class
WalkThroughPart
extends
BaseEditor
{
export
class
WalkThroughPart
extends
BaseEditor
{
static
ID
:
string
=
'
workbench.editor.walkThroughPart
'
;
static
ID
:
string
=
'
workbench.editor.walkThroughPart
'
;
...
@@ -308,7 +329,12 @@ export class WalkThroughPart extends BaseEditor {
...
@@ -308,7 +329,12 @@ export class WalkThroughPart extends BaseEditor {
const
id
=
`snippet-
${
model
.
uri
.
fragment
}
`
;
const
id
=
`snippet-
${
model
.
uri
.
fragment
}
`
;
const
div
=
innerContent
.
querySelector
(
`#
${
id
.
replace
(
/
\.
/g
,
'
\\
.
'
)}
`
)
as
HTMLElement
;
const
div
=
innerContent
.
querySelector
(
`#
${
id
.
replace
(
/
\.
/g
,
'
\\
.
'
)}
`
)
as
HTMLElement
;
const
editor
=
this
.
instantiationService
.
createInstance
(
CodeEditor
,
div
,
this
.
getEditorOptions
(
snippet
.
textEditorModel
.
getModeId
()));
const
options
=
this
.
getEditorOptions
(
snippet
.
textEditorModel
.
getModeId
());
const
telemetryData
=
{
target
:
this
.
input
instanceof
WalkThroughInput
?
this
.
input
.
getTelemetryFrom
()
:
undefined
,
snippet
:
i
};
const
editor
=
this
.
instantiationService
.
createInstance
(
WalkThroughCodeEditor
,
div
,
options
,
telemetryData
);
editor
.
setModel
(
model
);
editor
.
setModel
(
model
);
this
.
contentDisposables
.
push
(
editor
);
this
.
contentDisposables
.
push
(
editor
);
...
...
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
浏览文件 @
22a6f7a8
...
@@ -88,7 +88,7 @@ export class WalkThroughInput extends EditorInput {
...
@@ -88,7 +88,7 @@ export class WalkThroughInput extends EditorInput {
getTelemetryDescriptor
():
{
[
key
:
string
]:
any
;
}
{
getTelemetryDescriptor
():
{
[
key
:
string
]:
any
;
}
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
resourceTag
'
]
=
this
.
getTelemetryFrom
();
descriptor
[
'
target
'
]
=
this
.
getTelemetryFrom
();
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
resource
);
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
resource
);
return
descriptor
;
return
descriptor
;
}
}
...
@@ -175,7 +175,7 @@ export class WalkThroughInput extends EditorInput {
...
@@ -175,7 +175,7 @@ export class WalkThroughInput extends EditorInput {
if
(
!
this
.
resolveTime
)
{
if
(
!
this
.
resolveTime
)
{
this
.
resolveTime
=
Date
.
now
();
this
.
resolveTime
=
Date
.
now
();
this
.
telemetryService
.
publicLog
(
'
resolvingInput
'
,
{
this
.
telemetryService
.
publicLog
(
'
resolvingInput
'
,
{
resourceTag
:
this
.
getTelemetryFrom
(),
target
:
this
.
getTelemetryFrom
(),
});
});
}
}
}
}
...
@@ -183,7 +183,7 @@ export class WalkThroughInput extends EditorInput {
...
@@ -183,7 +183,7 @@ export class WalkThroughInput extends EditorInput {
private
disposeTelemetry
(
reason
?:
ShutdownReason
)
{
private
disposeTelemetry
(
reason
?:
ShutdownReason
)
{
if
(
this
.
resolveTime
)
{
if
(
this
.
resolveTime
)
{
this
.
telemetryService
.
publicLog
(
'
disposingInput
'
,
{
this
.
telemetryService
.
publicLog
(
'
disposingInput
'
,
{
resourceTag
:
this
.
getTelemetryFrom
(),
target
:
this
.
getTelemetryFrom
(),
timeSpent
:
(
Date
.
now
()
-
this
.
resolveTime
)
/
60
,
timeSpent
:
(
Date
.
now
()
-
this
.
resolveTime
)
/
60
,
reason
:
reason
?
ShutdownReason
[
reason
]
:
'
DISPOSE
'
,
reason
:
reason
?
ShutdownReason
[
reason
]
:
'
DISPOSE
'
,
maxTopScroll
:
this
.
maxTopScroll
,
maxTopScroll
:
this
.
maxTopScroll
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录