@@ -26,17 +26,20 @@ export async function captureDiagnostics(ctx: WorkspaceContext) {
2626        `vscode-diagnostics-${ formatDateString ( new  Date ( ) ) }  
2727    ) ; 
2828
29-     const  versionOutputChannel  =  new  SwiftOutputChannel ( ) ; 
30-     ctx . toolchain . logDiagnostics ( versionOutputChannel ) ; 
29+     const  environmentOutputChannel  =  new  SwiftOutputChannel ( ) ; 
30+     ctx . toolchain . logDiagnostics ( environmentOutputChannel ) ; 
31+     environmentOutputChannel . log ( 
32+         JSON . stringify ( vscode . workspace . getConfiguration ( "swift" ) ,  null ,  2 ) 
33+     ) ; 
3134
3235    const  logs  =  ctx . outputChannel . logs . join ( "\n" ) ; 
33-     const  versionLogs  =  versionOutputChannel . logs . join ( "\n" ) ; 
36+     const  environmentLogs  =  environmentOutputChannel . logs . join ( "\n" ) ; 
3437    const  diagnosticLogs  =  buildDiagnostics ( ) ; 
3538
3639    try  { 
3740        await  fs . mkdir ( diagnosticsDir ) ; 
3841        await  fs . writeFile ( path . join ( diagnosticsDir ,  "logs.txt" ) ,  logs ) ; 
39-         await  fs . writeFile ( path . join ( diagnosticsDir ,  "version .txt" ) ,  versionLogs ) ; 
42+         await  fs . writeFile ( path . join ( diagnosticsDir ,  "environment .txt" ) ,  environmentLogs ) ; 
4043        await  fs . writeFile ( path . join ( diagnosticsDir ,  "diagnostics.txt" ) ,  diagnosticLogs ) ; 
4144
4245        ctx . outputChannel . log ( `Saved diagnostics to ${ diagnosticsDir }  ) ; 
@@ -113,11 +116,9 @@ function severityToString(severity: vscode.DiagnosticSeverity): string {
113116    } 
114117} 
115118
116- function  padZero ( num : number ,  length : number  =  2 ) : string  { 
117-     return  num . toString ( ) . padStart ( length ,  "0" ) ; 
118- } 
119- 
120119function  formatDateString ( date : Date ) : string  { 
120+     const  padZero  =  ( num : number ,  length : number  =  2 )  =>  num . toString ( ) . padStart ( length ,  "0" ) ; 
121+ 
121122    const  year  =  date . getFullYear ( ) ; 
122123    const  month  =  padZero ( date . getMonth ( )  +  1 ) ; 
123124    const  day  =  padZero ( date . getDate ( ) ) ; 
0 commit comments