import * as vscode from 'vscode' ; import { DialogResponses , IActionContext } from 'vscode-azureextensionui' ; import { initProjectForVSCode } from '../commands/initProjectForVSCode/initProjectForVSCode' ; import { localize } from '../localize' ; import { getWorkspaceSetting , updateWorkspaceSetting } from './settings' ; export async function promptToReinitializeProject ( fsPath , settingKey , message , learnMoreLink , context ) { if ( getWorkspaceSetting < boolean > ( settingKey ) ) { const updateConfig = { title : localize ( 'reinit' , 'Reinitialize Project' ) } ; const result = await context . ui . showWarningMessage ( message , { learnMoreLink , stepName : 'reinitProject' } , updateConfig , DialogResponses . dontWarnAgain ) ; if ( result === DialogResponses . dontWarnAgain ) { context . telemetry . properties . verifyConfigResult = 'dontWarnAgain' ; await updateWorkspaceSetting ( settingKey , false , fsPath ) ; } else { context . telemetry . properties . verifyConfigResult = 'update' ; await initProjectForVSCode ( context , fsPath ) ; } } else { context . telemetry . properties . verifyConfigResult = 'suppressed' ; } }