Skip to content

Commit 7924c60

Browse files
authored
Update available commands in README (swiftlang#1140)
* Update available commands in README The section outlining what commands are added to the command palette is out of date. Add missing commands with a brief description of their purpose.
1 parent eb29cf6 commit 7924c60

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

README.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,58 @@ These tasks are available via **Terminal ▸ Run Task...** and **Terminal ▸ Ru
4242

4343
### Commands
4444

45-
The extension adds commands, available via the command palette.
45+
The extension adds the following commands, available via the command palette.
46+
47+
#### Configuration
48+
49+
- **Create New Project...**: Create a new Swift project using a template. This opens a dialog to guide you through creating a new project structure.
50+
- **Create New Swift File...**: Create a new `.swift` file in the current workspace.
51+
- **Select Toolchain**: Select which locally installed Swift toolchain (including Xcode toolchains on macOS) you want to use Swift tools from.
52+
53+
The following command is only available on macOS
54+
55+
- **Select Target Platform**: This is an experimental command used to get code completion for iOS, tvOS projects
56+
57+
#### Building and Debugging
58+
59+
- **Run Build**: Run `swift build` for the package associated with the open file.
60+
- **Debug Build**: Run `swift build` with debugging enabled for the package associated with the open file, launching the binary and attaching the debugger.
61+
- **Attach to Process...**: Attach the debugger to an already running process for debugging.
62+
- **Clean Build Folder**: Clean the build folder for the package associated with the open file, removing all previously built products.
63+
64+
#### Dependency Management
4665

4766
- **Resolve Package Dependencies**: Run `swift package resolve` on package associated with open file.
4867
- **Update Package Dependencies**: Run `swift package update` on package associated with open file.
4968
- **Reset Package Dependencies**: Run `swift package reset` on package associated with open file.
50-
- **Open Package.swift**: Open Package.swift for package associated with open file.
69+
- **Add to Workspace**: Add the current package to the active workspace in VS Code.
5170
- **Clean Build**: Run `swift package clean` on package associated with open file.
52-
- **Run Swift Script**: Run the currently open file, as a Swift script. If the file has not been saved it will save it to a temporary file so it can be run.
71+
- **Open Package.swift**: Open Package.swift for package associated with open file.
72+
- **Use Local Version**: Switch the package dependency to use a local version of the package instead of the remote repository version.
73+
- **Edit Locally**: Make the package dependency editable locally, allowing changes to the dependency to be reflected immediately.
74+
- **Revert To Original Version**: Revert the package dependency to its original, unedited state after local changes have been made.
75+
- **View Repository**: Open the external repository of the selected Swift package in a browser.
76+
77+
#### Testing
78+
79+
- **Test: Run All Tests**: Run all the tests across all test targes in the open project.
80+
- **Test: Rerun Last Run**: Perform the last test run again.
81+
- **Test: Open Coverage**: Open the last generated coverage report, if one exists.
82+
- **Test: Run All Tests in Parallel**: Run all tests in parallel. This action only affects XCTests. Swift-testing tests are parallel by default, and their parallelism [is controlled in code](https://developer.apple.com/documentation/testing/parallelization).
83+
84+
#### Snippets and Scripts
85+
86+
- **Insert Function Comment**: Insert a standard comment block for documenting a Swift function in the current file.
87+
- **Run Swift Script**: Run the currently open file, as a Swift script. The file must not be part of a build target. If the file has not been saved it will save it to a temporary file so it can be run.
5388
- **Run Swift Snippet**: If the currently open file is a Swift snippet then run it.
5489
- **Debug Swift Snippet**: If the currently open file is a Swift snippet then debug it.
55-
- **Run Command Plugin**: Display menu of command plugins for currently loaded packages.
56-
- **Select Toolchain**: Select which locally installed Swift toolchain (including Xcode toolchains on macOS) you want to use Swift tools from.
5790

91+
#### Diagnostics
5892

59-
The following command is only available on macOS
60-
- **Select Target Platform**: This is an experimental command used to get code completion for iOS, tvOS projects
93+
- **Capture VS Code Swift Diagnostic Bundle**: Capture a diagnostic bundle from VS Code, containing logs and information to aid in troubleshooting Swift-related issues.
94+
- **Clear Diagnostics Collection**: Clear all collected diagnostics in the current workspace to start fresh.
95+
- **Restart LSP Server**: Restart the Swift Language Server Protocol (LSP) server for the current workspace.
96+
- **Re-Index Project**: Force a re-index of the project to refresh code completion and symbol navigation support.
6197

6298
### Package dependencies
6399

0 commit comments

Comments
 (0)