Skip to content
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

Automatically teardown settings for diagnotics tests #1398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion assets/test/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"-DTEST_ARGUMENT_SET_VIA_TEST_BUILD_ARGUMENTS_SETTING"
],
"lldb.verboseLogging": true,
"swift.backgroundCompilation": false
"swift.backgroundCompilation": false,
"swift.diagnosticsStyle": "llvm",
"swift.diagnosticsCollection": "onlySwiftc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this addition intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, thanks

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

/** sourcekit-lsp configuration */
export interface LSPConfiguration {
Expand Down Expand Up @@ -288,8 +289,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
Loading