Skip to content

Walkthrough #1709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!images/**
!snippets/**
!assets/icons/**
!assets/walkthrough/**
!assets/documentation-webview/**
!assets/swift-docc-render/**
!node_modules/@vscode/codicons/**
21 changes: 21 additions & 0 deletions assets/walkthrough/createNewProject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Create a New Swift Project
![Create new project](./images/createNewProject.gif)

There are several project templates to choose from:
- `Library`: A package with a library. Use this to publish code for other packages to consume.
- `Executable`: A package with an executable. Use this for command line utilities.
- `Tool`: A package with an executable that uses Swift Argument Parser. Use this if you plan to have a rich set of command line arguments.
- `Build Tool Plugin`: A package that vents a Swift build tool plugin.
- `Command Plugin`: A package that vends a Swift command plugin.
- `Macro`: A package that vends a Swift macro.
- `Empty`: An empty package with just a `Package.swift` manifest.

Once you select a template, you'll be prompted to enter a name for your new project. This will be the name of the folder created in your workspace.

Finally, you'll be prompted to select a location for your new project. You can choose any location in your workspace, or create a new folder.

![Open existing project](./images/openProject.gif)

When you open an existing project with a ``Package.swift`` file the extension will start automatically.

Tip: You can view more information about the toolchain and other configurations being used for the project by hovering over the `{}` icon in the status bar.
23 changes: 23 additions & 0 deletions assets/walkthrough/customizeSettings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swift Extension Settings

![Swift Extension Settings](./images/settings.gif)

The Swift Extension contains several settings you can customize.

## Workspace Settings

**Add details about custom workspace settings and environment variable here.**

## Inlay Hints

Some language settings such as those for inlay hints for inferred variable types are turned on by default in VS Code.

![Disable Inlay Hints](./images/disableInlayHints.gif)

You can turn off inlay hints for Swift by adding `[swift]` specific settings to your `settings.json` file:

```
"[swift]": {
"editor.inlayHints.enabled": "off"
},
```
Binary file added assets/walkthrough/images/createNewProject.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions assets/walkthrough/images/createNewProject.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/debugExecutable.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/openProject.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/projectTypes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/runExecutable.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/runTests.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/settings.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions assets/walkthrough/images/swiftCommands.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions assets/walkthrough/images/swiftLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/walkthrough/images/testing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/walkthrough/previewDocs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Preview Documentation
![Preview documentation](./images/previewDocumentation.gif)

You can preview [documentation written using DocC](https://www.swift.org/documentation/docc/) directly in VS Code.

Note: This feature requires Swift 6.2 or later.
11 changes: 11 additions & 0 deletions assets/walkthrough/runExecutable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Run Swift Executable
![Run swift executable](./images/runExecutable.gif)

You can run a Swift binary target via the:
1. Code lens that appears in the `.swift` file
2. Project Panel in the bottom left hand corner of the sidebar
3. Tasks command: You can configure the build tasks through the `launch.json` file in the `.vscode` folder for the project

![Debug Swift Executable](./images/debugExecutable.gif)

You can debug a target by setting a breakpoint and clicking the the ``Debug Swift Executable`` button on the tab bar or through the ``Run and Debug panel`` in the sidebar.
4 changes: 4 additions & 0 deletions assets/walkthrough/runTests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Run Swift Testing and XCTest Tests
![Run a test](./images/runTests.gif)

XCTests and Swift Testing tests are detected automatically. You can run them by clicking the ▶ button, with the `Run Test` code lens or through the `Test Explorer` in the sidebar.
1 change: 1 addition & 0 deletions assets/walkthrough/runningTests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![Testing](./images/testing.png)
7 changes: 7 additions & 0 deletions assets/walkthrough/swiftCommands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Swift Commands

![Swift Commands](./images/swiftCommands.svg)

Documentation for commands supported by this extension is available on [swift.org](https://docs.swift.org/vscode/documentation/userdocs).

If you don't find the command you're looking for you can [open a new issue](https://github.com/swiftlang/vscode-swift/issues) or [pull request](https://github.com/swiftlang/vscode-swift/pulls).
10 changes: 10 additions & 0 deletions assets/walkthrough/swiftToolchains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The Swift extension automatically detects your installed Swift toolchain. However, it also provides a command called `Swift: Select Toolchain...` which can be used to select between toolchains if you have multiple installed.

You may be prompted to select where to configure this new path. Your options are to:

- `Save it in User Settings`
- `Save it in Workspace Settings`

Keep in mind that Workspace Settings take precedence over `User Settings`.

The Swift extension will then prompt you to reload the extension in order to pick up the new toolchain. The extension will not use the new toolchain until the extension is restarted.
3 changes: 3 additions & 0 deletions assets/walkthrough/welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p align="center">
<img src="./images/swiftLogo.svg" width="300" height="300" alt="Welcome" />
</p>
Loading