@@ -16,7 +16,7 @@ The Swift extension includes:
16
16
- Code navigation features such as Go to Definition and Find All References
17
17
- Refactoring and quick fixes to code
18
18
- Package management and tasks with support for Swift Package Manager
19
- - Rich support for debugging
19
+ - Rich support for debugging
20
20
- Testing with XCTest or Swift Testing frameworks
21
21
22
22
The Swift extension is designed to support the following projects:
@@ -27,18 +27,18 @@ The Swift extension is designed to support the following projects:
27
27
## Install the Extension
28
28
29
29
1 . First, install Swift. If you do not already have Swift installed on your system, see the
30
- [ Getting Started Guide on Swift.org] ( https://www.swift.org/getting-started/ ) .
30
+ [ Getting Started Guide on Swift.org] ( https://www.swift.org/getting-started/ ) .
31
31
2 . Download and install [ Visual Studio Code] ( https://code.visualstudio.com/Download ) .
32
32
3 . Install the Swift extension from the
33
- [ VS Code Marketplace] ( https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang )
34
- or directly from within the VS Code extensions pane.
33
+ [ VS Code Marketplace] ( https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang )
34
+ or directly from within the VS Code extensions pane.
35
35
36
36
![ Installing the vscode-swift extension from the extensions pane] ( /assets/images/getting-started-with-vscode-swift/installation.png )
37
37
38
38
## Creating a new Swift project
39
39
40
- To create a new Swift project, you can use the ` Swift: Create New Project... ` command in
41
- the Swift extension to guide you through the process. You can find this command by opening
40
+ To create a new Swift project, you can use the ` Swift: Create New Project... ` command in
41
+ the Swift extension to guide you through the process. You can find this command by opening
42
42
the Command Palette and following the instructions below.
43
43
44
44
- For macOS: ` CMD + Shift + P `
@@ -67,17 +67,17 @@ editor. Use these links to see the VS Code documentation for each topic:
67
67
- [ Diagnostics] ( https://code.visualstudio.com/docs/editor/editingevolved#_errors-warnings )
68
68
- [ Quick Fixes] ( https://code.visualstudio.com/docs/editor/editingevolved#_code-action )
69
69
70
- ![ Package swift actions] ( /assets/images/getting-started-with-vscode-swift/language-features/package_actions.png )
71
-
72
70
SourceKit LSP also provides code actions to automate common tasks. Code actions in VS Code
73
- appear as a light bulb near the editor margin (see the above screenshot for an
71
+ appear as a light bulb near the editor margin (see the below screenshot for an
74
72
example of this). Clicking on the light bulb will show you the available actions
75
73
which can include:
76
74
77
75
- Adding targets to your ` Package.swift `
78
76
- Converting JSON to protocols
79
77
- Adding documentation to your functions
80
78
79
+ ![ Package swift actions] ( /assets/images/getting-started-with-vscode-swift/language-features/package_actions.png )
80
+
81
81
<div class =" warning " markdown =" 1 " >
82
82
Before language features can be used you must perform a ` swift build ` command on your
83
83
project either on the command line or using a task in VS Code. This populates the index in sourcekit-lsp.
@@ -163,10 +163,10 @@ target in your Swift package. You may configure these yourself by adding a
163
163
}
164
164
```
165
165
166
- You can launch a debugging session via the Debug view in VS Code.
166
+ You can launch a debugging session via the Debug view in VS Code.
167
167
168
- 1 . Select the launch configuration you wish to debug
169
- 2 . Click on the green play button to lauch a debugging session.
168
+ 1 . Select the launch configuration you wish to debug.
169
+ 2 . Click on the green play button to launch a debugging session.
170
170
171
171
The executable will be launched and you can set breakpoints in
172
172
your Swift code that will be hit as code executes.
@@ -182,6 +182,7 @@ their variable values:
182
182
183
183
Visual Studio Code provides a Test Explorer view in the left sidebar which can
184
184
be used:
185
+
185
186
- To navigate to tests
186
187
- To run tests
187
188
- To Debug tests
@@ -193,6 +194,7 @@ As you write tests they are automatically added to the Test Explorer.
193
194
![ Inline test errors] ( /assets/images/getting-started-with-vscode-swift/testing/inline_assertion_failures.png )
194
195
195
196
To debug a test:
197
+
196
198
1 . Set a breakpoint
197
199
2 . Run the test, suite, or entire test target with the ` Debug Test ` profile.
198
200
0 commit comments