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
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
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. To set it 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 start writing Swift code:
11
+
* Use the **`Swift: Create New Project...`** command from the command palette to initialize a new project.
12
+
* Navigate to **`File > Open Folder`** in the menu bar to open an existing project on your machine.
The Swift extension automatically detects installations of the Swift toolchain in your environment. It looks for a `swift` binary available in `PATH` and, if one cannot be found, prompts 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, use the command `Swift: Select Toolchain...` to tell the extension which toolchain to use. The command shows you a list of all the toolchains that VS Code found on your system and lets 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). There is also a [getting started guide for swiftly on Swift.org](https://www.swift.org/swiftly/documentation/swiftly/getting-started/).
24
36
25
-
You can choose a swiftly managed toolchain to use from the `> Swift: Select Toolchain` menu.
37
+
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. Run **`swiftly self-update`** in your terminal to get the latest version of swiftly.
48
+
***Administrator Privileges** - On Linux systems, `sudo` may be required to install system dependencies for the toolchain after installation.
49
+
50
+
You can access the installation commands via the `Swift: Select Toolchain...` command, 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