@@ -26,17 +26,20 @@ export async function captureDiagnostics(ctx: WorkspaceContext) {
26
26
`vscode-diagnostics-${ formatDateString ( new Date ( ) ) } `
27
27
) ;
28
28
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
+ ) ;
31
34
32
35
const logs = ctx . outputChannel . logs . join ( "\n" ) ;
33
- const versionLogs = versionOutputChannel . logs . join ( "\n" ) ;
36
+ const environmentLogs = environmentOutputChannel . logs . join ( "\n" ) ;
34
37
const diagnosticLogs = buildDiagnostics ( ) ;
35
38
36
39
try {
37
40
await fs . mkdir ( diagnosticsDir ) ;
38
41
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 ) ;
40
43
await fs . writeFile ( path . join ( diagnosticsDir , "diagnostics.txt" ) , diagnosticLogs ) ;
41
44
42
45
ctx . outputChannel . log ( `Saved diagnostics to ${ diagnosticsDir } ` ) ;
@@ -113,11 +116,9 @@ function severityToString(severity: vscode.DiagnosticSeverity): string {
113
116
}
114
117
}
115
118
116
- function padZero ( num : number , length : number = 2 ) : string {
117
- return num . toString ( ) . padStart ( length , "0" ) ;
118
- }
119
-
120
119
function formatDateString ( date : Date ) : string {
120
+ const padZero = ( num : number , length : number = 2 ) => num . toString ( ) . padStart ( length , "0" ) ;
121
+
121
122
const year = date . getFullYear ( ) ;
122
123
const month = padZero ( date . getMonth ( ) + 1 ) ;
123
124
const day = padZero ( date . getDate ( ) ) ;
0 commit comments