@@ -11,7 +11,12 @@ import { getLocalGoplsVersion, lastUserAction, latestConfig } from './goLanguage
11
11
import { outputChannel } from './goStatus' ;
12
12
import { extensionId } from './const' ;
13
13
import { getFromGlobalState , getFromWorkspaceState , updateGlobalState } from './stateUtils' ;
14
- import { developerSurveyConfig } from './goDeveloperSurvey' ;
14
+ import {
15
+ developerSurveyConfig ,
16
+ getDeveloperSurveyConfig ,
17
+ maybePromptForDeveloperSurvey ,
18
+ promptForDeveloperSurvey
19
+ } from './goDeveloperSurvey' ;
15
20
import { getGoConfig } from './config' ;
16
21
17
22
// GoplsSurveyConfig is the set of global properties used to determine if
@@ -50,7 +55,7 @@ export function maybePromptForGoplsSurvey() {
50
55
return ;
51
56
}
52
57
const now = new Date ( ) ;
53
- let cfg = shouldPromptForSurvey ( now , getSurveyConfig ( ) ) ;
58
+ let cfg = shouldPromptForSurvey ( now , getGoplsSurveyConfig ( ) ) ;
54
59
if ( ! cfg ) {
55
60
return ;
56
61
}
@@ -200,7 +205,7 @@ To opt-out of all survey prompts, please disable the 'Go > Survey: Prompt' setti
200
205
201
206
export const goplsSurveyConfig = 'goplsSurveyConfig' ;
202
207
203
- function getSurveyConfig ( ) : GoplsSurveyConfig {
208
+ function getGoplsSurveyConfig ( ) : GoplsSurveyConfig {
204
209
return getStateConfig ( goplsSurveyConfig ) as GoplsSurveyConfig ;
205
210
}
206
211
@@ -244,21 +249,36 @@ export function getStateConfig(globalStateKey: string, workspace?: boolean): any
244
249
245
250
export async function showSurveyConfig ( ) {
246
251
// TODO(rstambler): Add developer survey config.
247
- outputChannel . appendLine ( 'Survey Configuration' ) ;
248
- outputChannel . appendLine ( JSON . stringify ( getSurveyConfig ( ) , null , 2 ) ) ;
252
+ outputChannel . appendLine ( 'HaTs Survey Configuration' ) ;
253
+ outputChannel . appendLine ( JSON . stringify ( getGoplsSurveyConfig ( ) , null , 2 ) ) ;
249
254
outputChannel . show ( ) ;
250
255
251
- const selected = await vscode . window . showInformationMessage ( 'Prompt for survey?' , 'Yes' , 'Maybe' , 'No' ) ;
256
+ outputChannel . appendLine ( 'Developer Survey Configuration' ) ;
257
+ outputChannel . appendLine ( JSON . stringify ( getDeveloperSurveyConfig ( ) , null , 2 ) ) ;
258
+ outputChannel . show ( ) ;
259
+
260
+ let selected = await vscode . window . showInformationMessage ( 'Prompt for HaTS survey?' , 'Yes' , 'Maybe' , 'No' ) ;
252
261
switch ( selected ) {
253
262
case 'Yes' :
254
- promptForGoplsSurvey ( getSurveyConfig ( ) , new Date ( ) ) ;
263
+ promptForGoplsSurvey ( getGoplsSurveyConfig ( ) , new Date ( ) ) ;
255
264
break ;
256
265
case 'Maybe' :
257
266
maybePromptForGoplsSurvey ( ) ;
258
267
break ;
259
268
default :
260
269
break ;
261
270
}
271
+ selected = await vscode . window . showInformationMessage ( 'Prompt for Developer survey?' , 'Yes' , 'Maybe' , 'No' ) ;
272
+ switch ( selected ) {
273
+ case 'Yes' :
274
+ promptForDeveloperSurvey ( getDeveloperSurveyConfig ( ) , new Date ( ) ) ;
275
+ break ;
276
+ case 'Maybe' :
277
+ maybePromptForDeveloperSurvey ( ) ;
278
+ break ;
279
+ default :
280
+ break ;
281
+ }
262
282
}
263
283
264
284
export const timeMinute = 1000 * 60 ;
0 commit comments