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
2 changes: 1 addition & 1 deletion assets/walkthrough/previewDocs.md
Original file line number Diff line number Diff line change
@@ -1,6 +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 by using the Preview Swift Documentation button at the top right of an editor, or by invoking `Swift: Preview Documentation` in the command palette in a `.docc` bundle.
You can preview [documentation written using DocC](https://www.swift.org/documentation/docc/) directly in VS Code by using the Preview Swift Documentation button at the top right of an editor, or by invoking `Swift: Preview Documentation` in the command palette in a `.docc` bundle. The preview window will update as you open different Markdown files or Swift source files that contains documentation comments.

Note: This feature requires Swift 6.2 or later.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@
{
"id": "documentation",
"title": "Preview DocC documentation",
"description": "Preview documentation written in DocC.",
"description": "Preview documentation written in [DocC](https://www.swift.org/documentation/docc/).",
"media": {
"markdown": "assets/walkthrough/previewDocs.md"
}
},
{
"id": "swift-commands",
"title": "Swift commands",
"description": "Explore commands available in the Command Palette prefixed with ``> Swift:``\n See documentation for [available commands](https://docs.swift.org/vscode/documentation/userdocs/commands/). \n[Open Command Palette](command:workbench.action.showCommands)",
"description": "Explore commands available in the Command Palette prefixed with ``> Swift:``\n See documentation for [available commands](https://docs.swift.org/vscode/documentation/userdocs/commands/). \n[Show Swift Commands](command:swift.showCommands)",
"media": {
"markdown": "assets/walkthrough/swiftCommands.md"
}
Expand All @@ -119,7 +119,7 @@
{
"id": "customize",
"title": "Customize settings",
"description": "Customize language and extension settings. \n[Open Settings](command:workbench.action.openSettings)",
"description": "The Swift extensions contributes numerous settings that you can configure to customize how your project builds and how the extension operates.\n[Configure Swift Settings](command:swift.configureSettings)",
"media": {
"markdown": "assets/walkthrough/customizeSettings.md"
}
Expand Down Expand Up @@ -194,6 +194,16 @@
}
],
"commands": [
{
"command": "swift.showCommands",
"title": "Show Commands",
"category": "Swift"
},
{
"command": "swift.configureSettings",
"title": "Configure Settings",
"category": "Swift"
},
{
"command": "swift.generateLaunchConfigurations",
"title": "Generate Launch Configurations",
Expand Down
13 changes: 13 additions & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,19 @@ export function register(ctx: WorkspaceContext): vscode.Disposable[] {
Commands.GENERATE_SOURCEKIT_CONFIG,
async () => await generateSourcekitConfiguration(ctx)
),
vscode.commands.registerCommand(
"swift.showCommands",
async () =>
await vscode.commands.executeCommand("workbench.action.quickOpen", ">Swift: ")
),
vscode.commands.registerCommand(
"swift.configureSettings",
async () =>
await vscode.commands.executeCommand(
"workbench.action.openSettings",
"@ext:swiftlang.swift-vscode "
)
),
];
}

Expand Down