From f7d02e2aca5de76ef988c3aaba9ef6a679484fea Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Thu, 19 Jun 2025 09:56:30 -0400 Subject: [PATCH 1/3] Properly scope all settings Be more explicit about settings scopes, marking appropriate ones as `application` (user settings applied across all swift projects) and `machine-overridable` (for per-project settings). --- package.json | 83 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 87739a6c0..76193d10a 100644 --- a/package.json +++ b/package.json @@ -320,7 +320,8 @@ "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", @@ -328,7 +329,8 @@ "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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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": [], @@ -560,7 +570,8 @@ "items": { "type": "string" }, - "default": [] + "default": [], + "scope": "machine-overridable" } } }, @@ -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", @@ -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" } } }, @@ -658,7 +672,8 @@ "cpp" ] }, - "order": 3 + "order": 3, + "scope": "machine-overridable" }, "swift.sourcekit-lsp.backgroundIndexing": { "type": "string", @@ -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", @@ -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", @@ -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", @@ -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": "application" }, "swift.debugger.useDebugAdapterFromToolchain": { "type": "boolean", @@ -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" } } } @@ -1746,4 +1773,4 @@ "vscode-languageclient": "^9.0.1", "xml2js": "^0.6.2" } -} +} \ No newline at end of file From 79d7b42aab698c4da94b99ae9cc6ffd2cf2e78d0 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Fri, 20 Jun 2025 10:31:03 -0400 Subject: [PATCH 2/3] Fix formatting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76193d10a..011d3fd23 100644 --- a/package.json +++ b/package.json @@ -1773,4 +1773,4 @@ "vscode-languageclient": "^9.0.1", "xml2js": "^0.6.2" } -} \ No newline at end of file +} From 44e9833c4a0a26b4a139de76338f302b8b60b8e2 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Fri, 20 Jun 2025 10:57:59 -0400 Subject: [PATCH 3/3] Tweak setupCodeLLDB --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 011d3fd23..f87f26817 100644 --- a/package.json +++ b/package.json @@ -805,7 +805,7 @@ ], "markdownDescription": "Choose how CodeLLDB settings are updated when debugging Swift executables.", "order": 3, - "scope": "application" + "scope": "machine-overridable" }, "swift.debugger.useDebugAdapterFromToolchain": { "type": "boolean",