Skip to content

Commit 02a9529

Browse files
authored
Add new commands for walkthrough (#1788)
1 parent 12ab9cf commit 02a9529

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

assets/walkthrough/previewDocs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Preview Documentation
22
![Preview documentation](./images/previewDocumentation.gif)
33

4-
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.
4+
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.
55

66
Note: This feature requires Swift 6.2 or later.

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@
9494
{
9595
"id": "documentation",
9696
"title": "Preview DocC documentation",
97-
"description": "Preview documentation written in DocC.",
97+
"description": "Preview documentation written in [DocC](https://www.swift.org/documentation/docc/).",
9898
"media": {
9999
"markdown": "assets/walkthrough/previewDocs.md"
100100
}
101101
},
102102
{
103103
"id": "swift-commands",
104104
"title": "Swift commands",
105-
"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)",
105+
"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)",
106106
"media": {
107107
"markdown": "assets/walkthrough/swiftCommands.md"
108108
}
@@ -119,7 +119,7 @@
119119
{
120120
"id": "customize",
121121
"title": "Customize settings",
122-
"description": "Customize language and extension settings. \n[Open Settings](command:workbench.action.openSettings)",
122+
"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)",
123123
"media": {
124124
"markdown": "assets/walkthrough/customizeSettings.md"
125125
}
@@ -194,6 +194,16 @@
194194
}
195195
],
196196
"commands": [
197+
{
198+
"command": "swift.showCommands",
199+
"title": "Show Commands",
200+
"category": "Swift"
201+
},
202+
{
203+
"command": "swift.configureSettings",
204+
"title": "Configure Settings",
205+
"category": "Swift"
206+
},
197207
{
198208
"command": "swift.generateLaunchConfigurations",
199209
"title": "Generate Launch Configurations",

src/commands.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,19 @@ export function register(ctx: WorkspaceContext): vscode.Disposable[] {
335335
Commands.GENERATE_SOURCEKIT_CONFIG,
336336
async () => await generateSourcekitConfiguration(ctx)
337337
),
338+
vscode.commands.registerCommand(
339+
"swift.showCommands",
340+
async () =>
341+
await vscode.commands.executeCommand("workbench.action.quickOpen", ">Swift: ")
342+
),
343+
vscode.commands.registerCommand(
344+
"swift.configureSettings",
345+
async () =>
346+
await vscode.commands.executeCommand(
347+
"workbench.action.openSettings",
348+
"@ext:swiftlang.swift-vscode "
349+
)
350+
),
338351
];
339352
}
340353

0 commit comments

Comments
 (0)