Skip to content

Commit a42be57

Browse files
authored
Automatically teardown settings for diagnotics tests (#1398)
* Automatically teardown settings for diagnotics tests Moved these tests over to the fixture to make teardown less error * Fix failing tests * Revert removed suite * Revert
1 parent a1a2a72 commit a42be57

File tree

3 files changed

+309
-298
lines changed

3 files changed

+309
-298
lines changed

src/DiagnosticsManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class DiagnosticsManager implements vscode.Disposable {
5959

6060
private diagnosticCollection: vscode.DiagnosticCollection =
6161
vscode.languages.createDiagnosticCollection("swift");
62-
private allDiagnostics: Map<string, vscode.Diagnostic[]> = new Map();
62+
allDiagnostics: Map<string, vscode.Diagnostic[]> = new Map();
6363
private disposed = false;
6464

6565
constructor(context: WorkspaceContext) {

src/configuration.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type DiagnosticCollectionOptions =
3838
| "keepSwiftc"
3939
| "keepSourceKit"
4040
| "keepAll";
41+
export type DiagnosticStyle = "default" | "llvm" | "swift";
4142

4243
/** sourcekit-lsp configuration */
4344
export interface LSPConfiguration {
@@ -369,8 +370,10 @@ const configuration = {
369370
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "keepSourceKit");
370371
},
371372
/** set the -diagnostic-style option when running `swift` tasks */
372-
get diagnosticsStyle(): "default" | "llvm" | "swift" {
373-
return vscode.workspace.getConfiguration("swift").get("diagnosticsStyle", "llvm");
373+
get diagnosticsStyle(): DiagnosticStyle {
374+
return vscode.workspace
375+
.getConfiguration("swift")
376+
.get<DiagnosticStyle>("diagnosticsStyle", "llvm");
374377
},
375378
/** where to show the build progress for the running task */
376379
get showBuildStatus(): ShowBuildStatusOptions {

0 commit comments

Comments
 (0)