You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: docs/settings.md
+13-5
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ This document outlines useful configuration options not covered by the settings
6
6
7
7
## Command Plugins
8
8
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`.
10
10
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`.
12
12
13
13
```json
14
14
{
@@ -51,17 +51,25 @@ Alternatively, you can define a task in your tasks.json and define permissions d
51
51
52
52
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.
53
53
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`.
55
55
56
56
### Support for 'Expand Macro'
57
57
58
58
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.
59
59
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.
61
61
62
-
```
62
+
```json
63
63
"swift.sourcekit-lsp.serverArguments": [
64
64
"--experimental-feature",
65
65
"show-macro-expansions"
66
66
]
67
67
```
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