Skip to content

Automatically teardown settings for diagnotics tests #1398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DiagnosticsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class DiagnosticsManager implements vscode.Disposable {

private diagnosticCollection: vscode.DiagnosticCollection =
vscode.languages.createDiagnosticCollection("swift");
private allDiagnostics: Map<string, vscode.Diagnostic[]> = new Map();
allDiagnostics: Map<string, vscode.Diagnostic[]> = new Map();
private disposed = false;

constructor(context: WorkspaceContext) {
Expand Down
7 changes: 5 additions & 2 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type DiagnosticCollectionOptions =
| "keepSwiftc"
| "keepSourceKit"
| "keepAll";
export type DiagnosticStyle = "default" | "llvm" | "swift";

/** sourcekit-lsp configuration */
export interface LSPConfiguration {
Expand Down Expand Up @@ -367,8 +368,10 @@ const configuration = {
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "keepSourceKit");
},
/** set the -diagnostic-style option when running `swift` tasks */
get diagnosticsStyle(): "default" | "llvm" | "swift" {
return vscode.workspace.getConfiguration("swift").get("diagnosticsStyle", "llvm");
get diagnosticsStyle(): DiagnosticStyle {
return vscode.workspace
.getConfiguration("swift")
.get<DiagnosticStyle>("diagnosticsStyle", "llvm");
},
/** where to show the build progress for the running task */
get showBuildStatus(): ShowBuildStatusOptions {
Expand Down
Loading