@@ -20,6 +20,7 @@ import * as nls from 'vs/nls';
20
20
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
21
21
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
22
22
import { IOpenerService } from 'vs/platform/opener/common/opener' ;
23
+ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
23
24
24
25
export class InlineCompletionsHover implements IHoverPart {
25
26
constructor (
@@ -71,7 +72,8 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan
71
72
@ILanguageService private readonly _languageService : ILanguageService ,
72
73
@IOpenerService private readonly _openerService : IOpenerService ,
73
74
@IAccessibilityService private readonly accessibilityService : IAccessibilityService ,
74
- @IInstantiationService private readonly _instantiationService : IInstantiationService
75
+ @IInstantiationService private readonly _instantiationService : IInstantiationService ,
76
+ @ITelemetryService private readonly _telemetryService : ITelemetryService ,
75
77
) {
76
78
}
77
79
@@ -86,20 +88,20 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan
86
88
// handle the case where the mouse is over the view zone
87
89
const viewZoneData = target . detail ;
88
90
if ( controller . shouldShowHoverAtViewZone ( viewZoneData . viewZoneId ) ) {
89
- return new HoverForeignElementAnchor ( 1000 , this , Range . fromPositions ( this . _editor . getModel ( ) ! . validatePosition ( viewZoneData . positionBefore || viewZoneData . position ) ) , mouseEvent . event . posx , mouseEvent . event . posy ) ;
91
+ return new HoverForeignElementAnchor ( 1000 , this , Range . fromPositions ( this . _editor . getModel ( ) ! . validatePosition ( viewZoneData . positionBefore || viewZoneData . position ) ) , mouseEvent . event . posx , mouseEvent . event . posy , false ) ;
90
92
}
91
93
}
92
94
if ( target . type === MouseTargetType . CONTENT_EMPTY ) {
93
95
// handle the case where the mouse is over the empty portion of a line following ghost text
94
96
if ( controller . shouldShowHoverAt ( target . range ) ) {
95
- return new HoverForeignElementAnchor ( 1000 , this , target . range , mouseEvent . event . posx , mouseEvent . event . posy ) ;
97
+ return new HoverForeignElementAnchor ( 1000 , this , target . range , mouseEvent . event . posx , mouseEvent . event . posy , false ) ;
96
98
}
97
99
}
98
100
if ( target . type === MouseTargetType . CONTENT_TEXT ) {
99
101
// handle the case where the mouse is directly over ghost text
100
102
const mightBeForeignElement = target . detail . mightBeForeignElement ;
101
103
if ( mightBeForeignElement && controller . shouldShowHoverAt ( target . range ) ) {
102
- return new HoverForeignElementAnchor ( 1000 , this , target . range , mouseEvent . event . posx , mouseEvent . event . posy ) ;
104
+ return new HoverForeignElementAnchor ( 1000 , this , target . range , mouseEvent . event . posx , mouseEvent . event . posy , false ) ;
103
105
}
104
106
}
105
107
return null ;
@@ -121,6 +123,11 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan
121
123
const disposableStore = new DisposableStore ( ) ;
122
124
const part = hoverParts [ 0 ] ;
123
125
126
+ this . _telemetryService . publicLog2 < { } , {
127
+ owner : 'hediet' ;
128
+ comment : 'This event tracks whenever an inline completion hover is shown.' ;
129
+ } > ( 'inlineCompletionHover.shown' ) ;
130
+
124
131
if ( this . accessibilityService . isScreenReaderOptimized ( ) ) {
125
132
this . renderScreenReaderText ( context , part , disposableStore ) ;
126
133
}
0 commit comments