Skip to content

Commit de4b4e2

Browse files
committed
Automatically teardown settings for diagnotics tests
Moved these tests over to the fixture to make teardown less error
1 parent 5550413 commit de4b4e2

File tree

3 files changed

+229
-223
lines changed

3 files changed

+229
-223
lines changed

assets/test/.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
"-DTEST_ARGUMENT_SET_VIA_TEST_BUILD_ARGUMENTS_SETTING"
88
],
99
"lldb.verboseLogging": true,
10-
"swift.backgroundCompilation": false
10+
"swift.backgroundCompilation": false,
11+
"swift.diagnosticsStyle": "llvm",
12+
"swift.diagnosticsCollection": "onlySwiftc"
1113
}

src/configuration.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type DiagnosticCollectionOptions =
2929
| "keepSwiftc"
3030
| "keepSourceKit"
3131
| "keepAll";
32+
export type DiagnosticStyle = "default" | "llvm" | "swift";
3233

3334
/** sourcekit-lsp configuration */
3435
export interface LSPConfiguration {
@@ -288,8 +289,10 @@ const configuration = {
288289
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "keepSourceKit");
289290
},
290291
/** set the -diagnostic-style option when running `swift` tasks */
291-
get diagnosticsStyle(): "default" | "llvm" | "swift" {
292-
return vscode.workspace.getConfiguration("swift").get("diagnosticsStyle", "llvm");
292+
get diagnosticsStyle(): DiagnosticStyle {
293+
return vscode.workspace
294+
.getConfiguration("swift")
295+
.get<DiagnosticStyle>("diagnosticsStyle", "llvm");
293296
},
294297
/** where to show the build progress for the running task */
295298
get showBuildStatus(): ShowBuildStatusOptions {

0 commit comments

Comments
 (0)