@@ -15,7 +15,7 @@ import { EditOperation } from 'vs/editor/common/core/editOperation';
1515import { Range } from 'vs/editor/common/core/range' ;
1616import { IEditorContribution , ScrollType } from 'vs/editor/common/editorCommon' ;
1717import { EditorContextKeys } from 'vs/editor/common/editorContextKeys' ;
18- import { ISuggestSupport } from 'vs/editor/common/modes' ;
18+ import { ISuggestSupport , ISuggestion } from 'vs/editor/common/modes' ;
1919import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2' ;
2020import { SnippetParser } from 'vs/editor/contrib/snippet/snippetParser' ;
2121import { SuggestMemories } from 'vs/editor/contrib/suggest/suggestMemory' ;
@@ -28,6 +28,7 @@ import { ICompletionItem } from './completionModel';
2828import { Context as SuggestContext } from './suggest' ;
2929import { State , SuggestModel } from './suggestModel' ;
3030import { ISelectedSuggestion , SuggestWidget } from './suggestWidget' ;
31+ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
3132
3233class AcceptOnCharacterOracle {
3334
@@ -94,6 +95,7 @@ export class SuggestController implements IEditorContribution {
9495 private _editor : ICodeEditor ,
9596 @ICommandService private readonly _commandService : ICommandService ,
9697 @IContextKeyService private readonly _contextKeyService : IContextKeyService ,
98+ @ITelemetryService private readonly _telemetryService : ITelemetryService ,
9799 @IInstantiationService private readonly _instantiationService : IInstantiationService ,
98100 ) {
99101 this . _model = new SuggestModel ( this . _editor ) ;
@@ -244,6 +246,20 @@ export class SuggestController implements IEditorContribution {
244246 }
245247
246248 this . _alertCompletionItem ( event . item ) ;
249+ SuggestController . _onDidSelectTelemetry ( this . _telemetryService , suggestion ) ;
250+ }
251+
252+ private static _onDidSelectTelemetry ( service : ITelemetryService , item : ISuggestion ) : void {
253+ /* __GDPR__
254+ "acceptSuggestion" : {
255+ "type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
256+ "multiline" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
257+ }
258+ */
259+ service . publicLog ( 'acceptSuggestion' , {
260+ type : item . type ,
261+ multiline : item . insertText . match ( / \r | \n / )
262+ } ) ;
247263 }
248264
249265 private _alertCompletionItem ( { suggestion } : ICompletionItem ) : void {
0 commit comments