Skip to content

Commit 6fb0818

Browse files
authored
Properly scope all settings (#1629)
* 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).
1 parent 74627ad commit 6fb0818

File tree

1 file changed

+54
-27
lines changed

1 file changed

+54
-27
lines changed

package.json

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,17 @@
320320
"swift.path": {
321321
"type": "string",
322322
"default": "",
323-
"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`."
323+
"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`.",
324+
"scope": "machine-overridable"
324325
},
325326
"swift.buildArguments": {
326327
"type": "array",
327328
"default": [],
328329
"items": {
329330
"type": "string"
330331
},
331-
"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."
332+
"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.",
333+
"scope": "machine-overridable"
332334
},
333335
"swift.scriptSwiftLanguageVersion": {
334336
"type": "string",
@@ -354,7 +356,8 @@
354356
"items": {
355357
"type": "string"
356358
},
357-
"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."
359+
"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.",
360+
"scope": "machine-overridable"
358361
},
359362
"swift.additionalTestArguments": {
360363
"type": "array",
@@ -422,7 +425,8 @@
422425
"When merging diagnostics, give precedence to diagnostics from `swiftc`.",
423426
"When merging diagnostics, give precedence to diagnostics from `SourceKit`.",
424427
"Keep diagnostics from all providers."
425-
]
428+
],
429+
"scope": "machine-overridable"
426430
},
427431
"swift.diagnosticsStyle": {
428432
"type": "string",
@@ -437,12 +441,14 @@
437441
"Use whichever diagnostics style `swiftc` produces by default.",
438442
"Use the `llvm` diagnostic style. This allows the parsing of \"notes\".",
439443
"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."
440-
]
444+
],
445+
"scope": "machine-overridable"
441446
},
442447
"swift.backgroundCompilation": {
443448
"type": "boolean",
444449
"default": false,
445-
"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."
450+
"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.",
451+
"scope": "machine-overridable"
446452
},
447453
"swift.actionAfterBuildError": {
448454
"type": "string",
@@ -456,17 +462,20 @@
456462
"Focus on Problems View",
457463
"Focus on Build Task Terminal"
458464
],
459-
"markdownDescription": "Action after a Build task generates errors."
465+
"markdownDescription": "Action after a Build task generates errors.",
466+
"scope": "application"
460467
},
461468
"swift.buildPath": {
462469
"type": "string",
463470
"default": "",
464-
"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."
471+
"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.",
472+
"scope": "machine-overridable"
465473
},
466474
"swift.disableSwiftPackageManagerIntegration": {
467475
"type": "boolean",
468476
"default": false,
469-
"markdownDescription": "Disables automated Build Tasks, Package Dependency view, Launch configuration generation and TestExplorer."
477+
"markdownDescription": "Disables automated Build Tasks, Package Dependency view, Launch configuration generation and TestExplorer.",
478+
"scope": "machine-overridable"
470479
},
471480
"swift.warnAboutSymlinkCreation": {
472481
"type": "boolean",
@@ -477,7 +486,8 @@
477486
"swift.enableTerminalEnvironment": {
478487
"type": "boolean",
479488
"default": true,
480-
"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`."
489+
"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`.",
490+
"scope": "application"
481491
},
482492
"swift.pluginArguments": {
483493
"default": [],
@@ -560,7 +570,8 @@
560570
"items": {
561571
"type": "string"
562572
},
563-
"default": []
573+
"default": [],
574+
"scope": "machine-overridable"
564575
}
565576
}
566577
},
@@ -594,12 +605,14 @@
594605
"Show the Swift build status in a status bar item provided by the Swift extension.",
595606
"Show the Swift build status in the \"Progress Message\" status bar item provided by VS Code.",
596607
"Show the Swift build status as a progress notification."
597-
]
608+
],
609+
"scope": "application"
598610
},
599611
"swift.showCreateSwiftProjectInWelcomePage": {
600612
"type": "boolean",
601613
"default": true,
602-
"markdownDescription": "Controls whether or not the create new swift project button appears in the welcome page."
614+
"markdownDescription": "Controls whether or not the create new swift project button appears in the welcome page.",
615+
"scope": "application"
603616
},
604617
"swift.openAfterCreateNewProject": {
605618
"type": "string",
@@ -616,7 +629,8 @@
616629
"Always prompt for action."
617630
],
618631
"default": "prompt",
619-
"markdownDescription": "Controls whether to open a swift project automatically after creating it."
632+
"markdownDescription": "Controls whether to open a swift project automatically after creating it.",
633+
"scope": "application"
620634
}
621635
}
622636
},
@@ -658,7 +672,8 @@
658672
"cpp"
659673
]
660674
},
661-
"order": 3
675+
"order": 3,
676+
"scope": "machine-overridable"
662677
},
663678
"swift.sourcekit-lsp.backgroundIndexing": {
664679
"type": "string",
@@ -669,7 +684,8 @@
669684
],
670685
"default": "auto",
671686
"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.",
672-
"order": 4
687+
"order": 4,
688+
"scope": "machine-overridable"
673689
},
674690
"swift.sourcekit-lsp.trace.server": {
675691
"type": "string",
@@ -680,13 +696,15 @@
680696
"verbose"
681697
],
682698
"markdownDescription": "Controls logging the communication between VS Code and the SourceKit-LSP language server. Logs can be viewed in Output > SourceKit Language Server.",
683-
"order": 5
699+
"order": 5,
700+
"scope": "machine-overridable"
684701
},
685702
"swift.sourcekit-lsp.disable": {
686703
"type": "boolean",
687704
"default": false,
688705
"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.",
689-
"order": 6
706+
"order": 6,
707+
"scope": "machine-overridable"
690708
},
691709
"sourcekit-lsp.inlayHints.enabled": {
692710
"type": "boolean",
@@ -760,13 +778,15 @@
760778
"Use the CodeLLDB extension's debug adapter."
761779
],
762780
"markdownDescription": "Select which debug adapter to use to debug Swift executables.",
763-
"order": 1
781+
"order": 1,
782+
"scope": "machine-overridable"
764783
},
765784
"swift.debugger.path": {
766785
"type": "string",
767786
"default": "",
768787
"markdownDescription": "Path to lldb debug adapter.",
769-
"order": 2
788+
"order": 2,
789+
"scope": "machine-overridable"
770790
},
771791
"swift.debugger.setupCodeLLDB": {
772792
"type": "string",
@@ -784,7 +804,8 @@
784804
"Never automatically update CodeLLDB settings when they are incorrect."
785805
],
786806
"markdownDescription": "Choose how CodeLLDB settings are updated when debugging Swift executables.",
787-
"order": 3
807+
"order": 3,
808+
"scope": "machine-overridable"
788809
},
789810
"swift.debugger.useDebugAdapterFromToolchain": {
790811
"type": "boolean",
@@ -807,36 +828,42 @@
807828
},
808829
"default": {},
809830
"markdownDescription": "Additional environment variables to pass to swift operations (`swift build`, `swift resolve`, etc...).",
810-
"order": 1
831+
"order": 1,
832+
"scope": "machine-overridable"
811833
},
812834
"swift.runtimePath": {
813835
"type": "string",
814836
"default": "",
815837
"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. ",
816-
"order": 2
838+
"order": 2,
839+
"scope": "machine-overridable"
817840
},
818841
"swift.SDK": {
819842
"type": "string",
820843
"default": "",
821844
"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.",
822-
"order": 3
845+
"order": 3,
846+
"scope": "machine-overridable"
823847
},
824848
"swift.swiftSDK": {
825849
"type": "string",
826850
"default": "",
827-
"markdownDescription": "The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md) to compile against (`--swift-sdk` parameter)."
851+
"markdownDescription": "The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md) to compile against (`--swift-sdk` parameter).",
852+
"scope": "machine-overridable"
828853
},
829854
"swift.disableSandox": {
830855
"type": "boolean",
831856
"default": false,
832857
"markdownDescription": "Disable sandboxing when running SwiftPM commands. In most cases you should keep the sandbox enabled and leave this setting set to `false`",
833-
"order": 4
858+
"order": 4,
859+
"scope": "machine-overridable"
834860
},
835861
"swift.diagnostics": {
836862
"type": "boolean",
837863
"default": false,
838864
"markdownDescription": "Output additional diagnostics to the Swift Output View.",
839-
"order": 100
865+
"order": 100,
866+
"scope": "machine-overridable"
840867
}
841868
}
842869
}

0 commit comments

Comments
 (0)