Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## {{releaseVersion}} - {{releaseDate}}

### Fixed

- Suggest "Open Documentation" when toolchain not found ([#1939](https://github.com/swiftlang/vscode-swift/pull/1939))

## 2.14.0 - 2025-11-11

### Added
Expand Down
10 changes: 9 additions & 1 deletion src/ui/ToolchainSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function selectToolchainFolder() {
* @returns true if the user made a selection (and potentially updated toolchain settings), false if they dismissed the dialog
*/
export async function showToolchainError(folder?: vscode.Uri): Promise<boolean> {
let selected: "Remove From Settings" | "Select Toolchain" | undefined;
let selected: "Remove From Settings" | "Select Toolchain" | "Open Documentation" | undefined;
const folderName = folder ? `${FolderContext.uriName(folder)}: ` : "";
if (configuration.path) {
selected = await vscode.window.showErrorMessage(
Expand All @@ -90,6 +90,7 @@ export async function showToolchainError(folder?: vscode.Uri): Promise<boolean>
} else {
selected = await vscode.window.showErrorMessage(
`${folderName}Unable to automatically discover your Swift toolchain. Either install a toolchain from Swift.org or provide the path to an existing toolchain.`,
"Open Documentation",
"Select Toolchain"
);
}
Expand All @@ -100,6 +101,13 @@ export async function showToolchainError(folder?: vscode.Uri): Promise<boolean>
} else if (selected === "Select Toolchain") {
await selectToolchain();
return true;
} else if (selected === "Open Documentation") {
void vscode.env.openExternal(
vscode.Uri.parse(
"https://docs.swift.org/vscode/documentation/userdocs/supported-toolchains"
)
);
return false;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Debugging with `lldb-dap` | 6.0

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).

<div class="warning" markdown="1">
If you install a toolchain or Swiftly while VS Code is open, you likely will need to fully quit VS Code and then reopen it. This makes sure the extension host gets the updated PATH so that extension can find the toolchain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the ambiguity

Suggested change
If you install a toolchain or Swiftly while VS Code is open, you likely will need to fully quit VS Code and then reopen it. This makes sure the extension host gets the updated PATH so that extension can find the toolchain.
If you install a toolchain or Swiftly while VS Code is open, fully quit VS Code and then reopen it. This makes sure the extension host gets the updated PATH so that extension can find the toolchain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah shoot only saw suggestion after merge, I'll put it into another PR

</div>

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.

@Video(
Expand Down
Loading