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: documentation/articles/wasm-getting-started.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ Build of product 'Hello' complete! (1.31s)
100
100
Hello from WASI!
101
101
```
102
102
103
-
# Embedded Swift Support
103
+
##Embedded Swift Support
104
104
105
105
[Embedded Swift](https://github.com/swiftlang/swift-evolution/blob/main/visions/embedded-swift.md) is an experimental [subset of the language](https://docs.swift.org/embedded/documentation/embedded/languagesubset)
106
106
allowing the toolchain to produce Wasm binaries that are multiple orders of magnitude smaller. One of the Swift SDKs in the artifact bundle you've installed
@@ -117,3 +117,57 @@ or
117
117
```
118
118
swift run --swift-sdk {{ tag }}_wasm-embedded
119
119
```
120
+
121
+
## Editor Configuration
122
+
123
+
This section shows you how to configure your development environment for Swift WebAssembly development using the Swift SDKs you installed in the previous section.
124
+
125
+
### Visual Studio Code
126
+
127
+
If you haven't set up VSCode for Swift development yet, see the [Configuring VS Code for Swift Development guide](/documentation/articles/getting-started-with-vscode-swift/).
128
+
129
+
**Configure VSCode for WebAssembly:**
130
+
131
+
1. Open your Swift package in VSCode.
132
+
133
+
2. Use the Command Palette (`Cmd + Shift + P` on macOS, `Ctrl + Shift + P` on other platforms) and select `Swift: Select Toolchain...`.
134
+
135
+
3. Choose your Swift toolchain from the list (should match the version installed with `swiftly`).
136
+
137
+
4. When prompted, save the toolchain setting in **Workspace Settings**. This will create or update the `swift.path` setting in `.vscode/settings.json`.
138
+
139
+
5. Create a `.sourcekit-lsp/config.json` file in your project root:
140
+
141
+
```json
142
+
{
143
+
"swiftPM": {
144
+
"swiftSDK": "{{ tag }}_wasm"
145
+
}
146
+
}
147
+
```
148
+
149
+
Replace `{{ tag }}_wasm` with the exact Swift SDK ID from your `swift sdk list` output. Use `{{ tag }}_wasm-embedded` if you're working with Embedded Swift.
150
+
151
+
6. Reload VSCode using the Command Palette: `Developer: Reload Window`.
152
+
153
+
### Other Editors
154
+
155
+
For other editors (Vim, Neovim, Emacs, etc.) with LSP support already configured for Swift:
156
+
157
+
1. Ensure your editor is using the correct Swift toolchain (the one installed with `swiftly`).
158
+
159
+
2. Create a `.sourcekit-lsp/config.json` file in your project root:
160
+
161
+
```json
162
+
{
163
+
"swiftPM": {
164
+
"swiftSDK": "{{ tag }}_wasm"
165
+
}
166
+
}
167
+
```
168
+
169
+
Replace `{{ tag }}_wasm` with your Swift SDK ID from `swift sdk list`. Use `{{ tag }}_wasm-embedded` for Embedded Swift.
170
+
171
+
For initial Swift LSP setup guides, see:
172
+
-[Zero to Swift with Neovim](/documentation/articles/zero-to-swift-nvim/)
173
+
-[Zero to Swift with Emacs](/documentation/articles/zero-to-swift-emacs/)
0 commit comments