Skip to content

Commit 91260d2

Browse files
committed
Automatically teardown settings for diagnotics tests
Moved these tests over to the fixture to make teardown less error
1 parent 87e6248 commit 91260d2

File tree

3 files changed

+235
-334
lines changed

3 files changed

+235
-334
lines changed

assets/test/.vscode/settings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
"-DTEST_ARGUMENT_SET_VIA_TEST_BUILD_ARGUMENTS_SETTING"
99
],
1010
"lldb.verboseLogging": true,
11-
"swift.backgroundCompilation": false
11+
"swift.backgroundCompilation": false,
12+
"swift.diagnosticsStyle": "llvm",
13+
"swift.diagnosticsCollection": "onlySwiftc"
1214
}

src/configuration.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export type DiagnosticCollectionOptions =
3636
| "keepSwiftc"
3737
| "keepSourceKit"
3838
| "keepAll";
39+
export type DiagnosticStyle = "default" | "llvm" | "swift";
3940

4041
/** sourcekit-lsp configuration */
4142
export interface LSPConfiguration {
@@ -367,8 +368,10 @@ const configuration = {
367368
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "keepSourceKit");
368369
},
369370
/** set the -diagnostic-style option when running `swift` tasks */
370-
get diagnosticsStyle(): "default" | "llvm" | "swift" {
371-
return vscode.workspace.getConfiguration("swift").get("diagnosticsStyle", "llvm");
371+
get diagnosticsStyle(): DiagnosticStyle {
372+
return vscode.workspace
373+
.getConfiguration("swift")
374+
.get<DiagnosticStyle>("diagnosticsStyle", "llvm");
372375
},
373376
/** where to show the build progress for the running task */
374377
get showBuildStatus(): ShowBuildStatusOptions {

0 commit comments

Comments
 (0)