@@ -7,11 +7,11 @@ import {
77 EventEmitter ,
88 commands ,
99 ProviderResult ,
10- window ,
1110} from 'vscode' ;
12- import { RequestType , RequestType0 } from 'vscode-languageclient' ;
11+ import { RequestType0 } from 'vscode-languageclient' ;
1312import { ConnectionHandler } from '../handler' ;
14- import { PuppetVersionRequest , PuppetVersionDetails } from '../messages' ;
13+ import { PuppetVersionDetails } from '../messages' ;
14+ import { reporter } from '../telemetry' ;
1515
1616class PuppetFact extends TreeItem {
1717 constructor (
@@ -81,7 +81,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
8181 ) ;
8282 if ( ! details . factsLoaded ) {
8383 // language server is ready, but hasn't loaded facts yet
84- return new Promise < PuppetFact [ ] > ( ( resolve , reject ) => {
84+ return new Promise < PuppetFact [ ] > ( ( resolve ) => {
8585 let count = 0 ;
8686 let handle = setInterval ( async ( ) => {
8787 count ++ ;
@@ -93,6 +93,10 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
9393 ) ;
9494 this . elements = this . toList ( results . facts ) ;
9595
96+ if ( reporter ) {
97+ reporter . sendTelemetryEvent ( 'puppetFacts' ) ;
98+ }
99+
96100 resolve ( this . elements . map ( ( e ) => e [ 1 ] ) ) ;
97101 }
98102
@@ -107,6 +111,10 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
107111 ) ;
108112 this . elements = this . toList ( results . facts ) ;
109113
114+ if ( reporter ) {
115+ reporter . sendTelemetryEvent ( 'puppetFacts' ) ;
116+ }
117+
110118 resolve ( this . elements . map ( ( e ) => e [ 1 ] ) ) ;
111119 } else {
112120 // not ready yet
@@ -119,6 +127,11 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
119127 new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' )
120128 ) ;
121129 this . elements = this . toList ( results . facts ) ;
130+
131+ if ( reporter ) {
132+ reporter . sendTelemetryEvent ( 'puppetFacts' ) ;
133+ }
134+
122135 return this . elements . map ( ( e ) => e [ 1 ] ) ;
123136 }
124137
0 commit comments