Skip to content

Properly scope all settings #1629

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 3 commits into from
Jul 7, 2025
Merged
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
81 changes: 54 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,17 @@
"swift.path": {
"type": "string",
"default": "",
"markdownDescription": "Override the default path of the folder containing the Swift executables. The default is to look in the `PATH` environment variable. This path is also used to search for other executables used by the extension like `sourcekit-lsp` and `lldb`."
"markdownDescription": "Override the default path of the folder containing the Swift executables. The default is to look in the `PATH` environment variable. This path is also used to search for other executables used by the extension like `sourcekit-lsp` and `lldb`.",
"scope": "machine-overridable"
},
"swift.buildArguments": {
"type": "array",
"default": [],
"items": {
"type": "string"
},
"markdownDescription": "Additional arguments to pass to `swift build` and `swift test`. Keys and values should be provided as individual entries in the list. If you have created a copy of the build task in `tasks.json` then these build arguments will not be propagated to that task."
"markdownDescription": "Additional arguments to pass to `swift build` and `swift test`. Keys and values should be provided as individual entries in the list. If you have created a copy of the build task in `tasks.json` then these build arguments will not be propagated to that task.",
"scope": "machine-overridable"
},
"swift.scriptSwiftLanguageVersion": {
"type": "string",
Expand All @@ -354,7 +356,8 @@
"items": {
"type": "string"
},
"markdownDescription": "Additional arguments to pass to swift commands that do package resolution, such as `swift package resolve`, `swift package update`, `swift build` and `swift test`. Keys and values should be provided as individual entries in the list."
"markdownDescription": "Additional arguments to pass to swift commands that do package resolution, such as `swift package resolve`, `swift package update`, `swift build` and `swift test`. Keys and values should be provided as individual entries in the list.",
"scope": "machine-overridable"
},
"swift.additionalTestArguments": {
"type": "array",
Expand Down Expand Up @@ -422,7 +425,8 @@
"When merging diagnostics, give precedence to diagnostics from `swiftc`.",
"When merging diagnostics, give precedence to diagnostics from `SourceKit`.",
"Keep diagnostics from all providers."
]
],
"scope": "machine-overridable"
},
"swift.diagnosticsStyle": {
"type": "string",
Expand All @@ -437,12 +441,14 @@
"Use whichever diagnostics style `swiftc` produces by default.",
"Use the `llvm` diagnostic style. This allows the parsing of \"notes\".",
"Use the `swift` diagnostic style. This means that \"notes\" will not be parsed. This option has no effect in Swift versions prior to 5.10."
]
],
"scope": "machine-overridable"
},
"swift.backgroundCompilation": {
"type": "boolean",
"default": false,
"markdownDescription": "**Experimental**: Run `swift build` in the background whenever a file is saved. It is possible the background compilation will already be running when you attempt a compile yourself, so this is disabled by default."
"markdownDescription": "**Experimental**: Run `swift build` in the background whenever a file is saved. It is possible the background compilation will already be running when you attempt a compile yourself, so this is disabled by default.",
"scope": "machine-overridable"
},
"swift.actionAfterBuildError": {
"type": "string",
Expand All @@ -456,17 +462,20 @@
"Focus on Problems View",
"Focus on Build Task Terminal"
],
"markdownDescription": "Action after a Build task generates errors."
"markdownDescription": "Action after a Build task generates errors.",
"scope": "application"
},
"swift.buildPath": {
"type": "string",
"default": "",
"markdownDescription": "The path to a directory that will be used for build artifacts. This path will be added to all swift package manager commands that are executed by vscode-swift extension via `--scratch-path` option. When no value provided - nothing gets passed to swift package manager and it will use its default value of `.build` folder in the workspace.\n\nYou can use absolute path for directory or the relative path, which will use the workspace path as a base. Note that VS Code does not respect tildes (`~`) in paths which represents user home folder under *nix systems."
"markdownDescription": "The path to a directory that will be used for build artifacts. This path will be added to all swift package manager commands that are executed by vscode-swift extension via `--scratch-path` option. When no value provided - nothing gets passed to swift package manager and it will use its default value of `.build` folder in the workspace.\n\nYou can use absolute path for directory or the relative path, which will use the workspace path as a base. Note that VS Code does not respect tildes (`~`) in paths which represents user home folder under *nix systems.",
"scope": "machine-overridable"
},
"swift.disableSwiftPackageManagerIntegration": {
"type": "boolean",
"default": false,
"markdownDescription": "Disables automated Build Tasks, Package Dependency view, Launch configuration generation and TestExplorer."
"markdownDescription": "Disables automated Build Tasks, Package Dependency view, Launch configuration generation and TestExplorer.",
"scope": "machine-overridable"
},
"swift.warnAboutSymlinkCreation": {
"type": "boolean",
Expand All @@ -477,7 +486,8 @@
"swift.enableTerminalEnvironment": {
"type": "boolean",
"default": true,
"markdownDescription": "Controls whether or not the extension will contribute environment variables defined in `Swift: Environment Variables` to the integrated terminal. If this is set to `true` and a custom `Swift: Path` is also set then the swift path is appended to the terminal's `PATH`."
"markdownDescription": "Controls whether or not the extension will contribute environment variables defined in `Swift: Environment Variables` to the integrated terminal. If this is set to `true` and a custom `Swift: Path` is also set then the swift path is appended to the terminal's `PATH`.",
"scope": "application"
},
"swift.pluginArguments": {
"default": [],
Expand Down Expand Up @@ -560,7 +570,8 @@
"items": {
"type": "string"
},
"default": []
"default": [],
"scope": "machine-overridable"
}
}
},
Expand Down Expand Up @@ -594,12 +605,14 @@
"Show the Swift build status in a status bar item provided by the Swift extension.",
"Show the Swift build status in the \"Progress Message\" status bar item provided by VS Code.",
"Show the Swift build status as a progress notification."
]
],
"scope": "application"
},
"swift.showCreateSwiftProjectInWelcomePage": {
"type": "boolean",
"default": true,
"markdownDescription": "Controls whether or not the create new swift project button appears in the welcome page."
"markdownDescription": "Controls whether or not the create new swift project button appears in the welcome page.",
"scope": "application"
},
"swift.openAfterCreateNewProject": {
"type": "string",
Expand All @@ -616,7 +629,8 @@
"Always prompt for action."
],
"default": "prompt",
"markdownDescription": "Controls whether to open a swift project automatically after creating it."
"markdownDescription": "Controls whether to open a swift project automatically after creating it.",
"scope": "application"
}
}
},
Expand Down Expand Up @@ -658,7 +672,8 @@
"cpp"
]
},
"order": 3
"order": 3,
"scope": "machine-overridable"
},
"swift.sourcekit-lsp.backgroundIndexing": {
"type": "string",
Expand All @@ -669,7 +684,8 @@
],
"default": "auto",
"markdownDescription": "Turns background indexing `on` or `off`. `auto` will enable background indexing if the Swift version is >= 6.1. This option has no effect in Swift versions prior to 6.0.",
"order": 4
"order": 4,
"scope": "machine-overridable"
},
"swift.sourcekit-lsp.trace.server": {
"type": "string",
Expand All @@ -680,13 +696,15 @@
"verbose"
],
"markdownDescription": "Controls logging the communication between VS Code and the SourceKit-LSP language server. Logs can be viewed in Output > SourceKit Language Server.",
"order": 5
"order": 5,
"scope": "machine-overridable"
},
"swift.sourcekit-lsp.disable": {
"type": "boolean",
"default": false,
"markdownDescription": "Disable SourceKit-LSP. This will turn off features like code completion, error diagnostics and jump-to-definition. Features like swift-testing test discovery will not work correctly.",
"order": 6
"order": 6,
"scope": "machine-overridable"
},
"sourcekit-lsp.inlayHints.enabled": {
"type": "boolean",
Expand Down Expand Up @@ -760,13 +778,15 @@
"Use the CodeLLDB extension's debug adapter."
],
"markdownDescription": "Select which debug adapter to use to debug Swift executables.",
"order": 1
"order": 1,
"scope": "machine-overridable"
},
"swift.debugger.path": {
"type": "string",
"default": "",
"markdownDescription": "Path to lldb debug adapter.",
"order": 2
"order": 2,
"scope": "machine-overridable"
},
"swift.debugger.setupCodeLLDB": {
"type": "string",
Expand All @@ -784,7 +804,8 @@
"Never automatically update CodeLLDB settings when they are incorrect."
],
"markdownDescription": "Choose how CodeLLDB settings are updated when debugging Swift executables.",
"order": 3
"order": 3,
"scope": "machine-overridable"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe application scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the CodeLLDB settings should be per project because its possible some projects may work better with one debugger over the other.

},
"swift.debugger.useDebugAdapterFromToolchain": {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe application?

"type": "boolean",
Expand All @@ -807,36 +828,42 @@
},
"default": {},
"markdownDescription": "Additional environment variables to pass to swift operations (`swift build`, `swift resolve`, etc...).",
"order": 1
"order": 1,
"scope": "machine-overridable"
},
"swift.runtimePath": {
"type": "string",
"default": "",
"markdownDescription": "The path of the folder containing the Swift runtime libraries. This is of use when supporting non-standard SDK layouts on Windows. On Windows the runtime path is added to the `Path` environment variable. This is of less use on macOS and Linux but will be added to `DYLD_LIBRARY_PATH` and `LD_LIBRARY_PATH` environment variables respectively on each platform. ",
"order": 2
"order": 2,
"scope": "machine-overridable"
},
"swift.SDK": {
"type": "string",
"default": "",
"markdownDescription": "The path of the SDK to compile against (`--sdk` parameter). This is of use when supporting non-standard SDK layouts on Windows and using custom SDKs. The default SDK is determined by the environment on macOS and Windows.\n\nFor SwiftPM projects, prefer using `swift.swiftSDK` with a triple (such as `arm64-apple-ios`) or Swift SDK name instead.",
"order": 3
"order": 3,
"scope": "machine-overridable"
},
"swift.swiftSDK": {
"type": "string",
"default": "",
"markdownDescription": "The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md) to compile against (`--swift-sdk` parameter)."
"markdownDescription": "The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md) to compile against (`--swift-sdk` parameter).",
"scope": "machine-overridable"
},
"swift.disableSandox": {
"type": "boolean",
"default": false,
"markdownDescription": "Disable sandboxing when running SwiftPM commands. In most cases you should keep the sandbox enabled and leave this setting set to `false`",
"order": 4
"order": 4,
"scope": "machine-overridable"
},
"swift.diagnostics": {
"type": "boolean",
"default": false,
"markdownDescription": "Output additional diagnostics to the Swift Output View.",
"order": 100
"order": 100,
"scope": "machine-overridable"
}
}
}
Expand Down