Skip to content

Commit d2990b3

Browse files
Document how to use a different Visual Studio (#1421)
* Document how to use a different Visual Studio Add some documentation to the settings docs that outlines how to specify which Visual Studio installation Swift should pull its dependencies from on Windows. Also annotates existing setting names in the document with links that jump straight to the relevent setting in VS Code. Issue: #1419 Co-authored-by: Rishi <[email protected]>
1 parent 09cca61 commit d2990b3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docs/settings.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This document outlines useful configuration options not covered by the settings
66

77
## Command Plugins
88

9-
Swift packages can define [command plugins](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Plugins.md) that can perform arbitrary tasks. For example, the [swift-format](https://github.com/swiftlang/swift-format) package exposes a `format-source-code` command which will use swift-format to format source code in a folder. These plugin commands can be invoked from VS Code using `> Swift: Run Command Plugin`.
9+
Swift packages can define [command plugins](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Plugins.md) that can perform arbitrary tasks. For example, the [swift-format](https://github.com/swiftlang/swift-format) package exposes a `format-source-code` command which will use swift-format to format source code in a folder. These plugin commands can be invoked from VS Code using `> Swift: Run Command Plugin`.
1010

11-
A plugin may require permissions to perform tasks like writing to the file system or using the network. If a plugin command requires one of these permissions, you will be prompted in the integrated terminal to accept them. If you trust the command and wish to apply permissions on every command execution, you can configure a setting in your `settings.json`.
11+
A plugin may require permissions to perform tasks like writing to the file system or using the network. If a plugin command requires one of these permissions, you will be prompted in the integrated terminal to accept them. If you trust the command and wish to apply permissions on every command execution, you can configure the [`swift.pluginPermissions`](vscode://settings/swift.pluginPermissions) setting in your `settings.json`.
1212

1313
```json
1414
{
@@ -51,17 +51,25 @@ Alternatively, you can define a task in your tasks.json and define permissions d
5151

5252
If you're using a nightly (`main`) or recent `6.0` toolchain you can enable support for background indexing in Sourcekit-LSP. This removes the need to do a build before getting code completion and diagnostics.
5353

54-
To enable support, set the `swift.sourcekit-lsp.backgroundIndexing` setting to `true`.
54+
To enable support, set the [`swift.sourcekit-lsp.backgroundIndexing`](vscode://settings/swift.sourcekit-lsp.backgroundIndexing) setting to `true`.
5555

5656
### Support for 'Expand Macro'
5757

5858
If you are using a nightly (`main`) toolchain you can enable support for the "Peek Macro" Quick Action, accessible through the light bulb icon when the cursor is on a macro.
5959

60-
To enable support, set the following Sourcekit-LSP server arguments in your settings.json, or add two new entries to the `Sourcekit-lsp: Server Arguments` entry in the extension settings page.
60+
To enable support, set the following Sourcekit-LSP server arguments in your settings.json, or add two new entries to the [`swift.sourcekit-lsp.serverArguments`](vscode://settings/swift.sourcekit-lsp.serverArguments) setting.
6161

62-
```
62+
```json
6363
"swift.sourcekit-lsp.serverArguments": [
6464
"--experimental-feature",
6565
"show-macro-expansions"
6666
]
6767
```
68+
69+
## Windows Development
70+
71+
### Specifying a Visual Studio installation
72+
73+
Swift depends on a number of developer tools when running on Windows, including the C++ toolchain and the Windows SDK. Typically these are installed with [Visual Studio](https://visualstudio.microsoft.com/).
74+
75+
If you have multiple versions of Visual Studio installed you can specify the path to the desired version by setting a `VCToolsInstallDir` environment variable using the [`swift.swiftEnvironmentVariables`](vscode://settings/swift.swiftEnvironmentVariables) setting.

0 commit comments

Comments
 (0)