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
Copy file name to clipboardExpand all lines: userdocs/userdocs.docc/Articles/Topics/installation.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
3
3
Install the Swift extension via the VS Code Marketplace.
4
4
5
-
The Swift extension is supported on macOS, Linux, and Windows.
5
+
The Swift extension is supported on macOS, Linux, and Windows. Here's what you will need to do to get set up:
6
+
1. Install Swift from the [Swift.org website](https://www.swift.org/install).
7
+
2. Install [Visual Studio Code](https://code.visualstudio.com/Download).
8
+
3. Install the Swift extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode).
6
9
7
-
To install, firstly ensure you have [Swift installed on your system](https://www.swift.org/install/). Then [install the Swift extension](https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode). Once your machine is ready, you can get started with the **Swift: Create New Project...** command.
10
+
Once your machine is ready, you can get started with the **Swift: Create New Project...** command.
The Swift extension will automatically detect installations of the Swift toolchain in your environment. It will look for a `swift` binary available in `PATH` and, if one cannot be found, will prompt you to [install a toolchain from Swift.org](https://www.swift.org/install).
24
+
25
+
If you have multiple Swift toolchains installed on your system then you can use the command `Swift: Select Toolchain...` to tell the extension which toolchain you would like to use. This will show you a list of all toolchains that VS Code was able to find on your system and let you switch between them.
26
+
27
+
@Video(
28
+
source: "toolchain-selection.mp4",
29
+
alt: "A video showing a VS Code window. The command palette is opened to run the 'Swift: Select toolchain' command which is then used to select Xcode as the preferred toolchain.",
30
+
poster: "toolchain-selection.png"
31
+
)
32
+
21
33
## Swiftly Support
22
34
23
-
The extension supports toolchains managed by [swiftly](https://github.com/swiftlang/swiftly), the Swift toolchain installer and manager. For instructions on installing swiftly see the [installation instructions on Swift.org](https://www.swift.org/install).
35
+
The extension supports toolchains managed by [swiftly](https://github.com/swiftlang/swiftly), the Swift toolchain installer and manager. This is the recommended way of installing Swift toolchains on macOS and Linux. For instructions on installing swiftly see the [installation instructions on Swift.org](https://www.swift.org/install).
24
36
25
-
You can choose a swiftly managed toolchain to use from the `> Swift: Select Toolchain` menu.
37
+
You can choose a swiftly managed toolchain to use from the `> Swift: Select Toolchain...` menu.
26
38
27
39
If you do `swiftly use` on the command line you must restart VS Code or do `> Developer: Reload Window` in order for the VS Code Swift extension to start using the new toolchain.
28
40
41
+
### Installing Toolchains
42
+
43
+
The Swift extension can use swiftly to install toolchains on your behalf. This allows you to discover, install, and configure Swift toolchains directly from the VS Code interface without needing to use the command line.
44
+
45
+
Before using the toolchain installation feature, ensure you meet the following requirements:
46
+
47
+
***Swiftly 1.1.0 or newer** - The installation feature requires swiftly version 1.1.0 or newer
48
+
***Administrator Privileges** - On Linux systems, administrator privileges may be required to execute post-installation scripts
49
+
50
+
You can access the installation commands via toolchain selection, or by running the following commands directly:
51
+
-**`Swift: Install Swiftly Toolchain...`** - installs stable Swift toolchains via swiftly
52
+
-**`Swift: Install Swiftly Snapshot Toolchain...`** - installs snapshot Swift toolchains via swiftly
53
+
29
54
### .swift-version Support
30
55
31
56
Swiftly can use a special `.swift-version` file in the root of your package so that you can share your toolchain preference with the rest of your team. The VS Code Swift extension respects this file if it exists and will use the toolchain specified within it to build and test your package.
0 commit comments