Skip to content

Commit 5749764

Browse files
committed
Add landing/faq walkthroughs and commands for quick access
1 parent 4e836c6 commit 5749764

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed

editors/code/package.json

+106
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,16 @@
305305
"command": "rust-analyzer.toggleLSPLogs",
306306
"title": "Toggle LSP Logs",
307307
"category": "rust-analyzer"
308+
},
309+
{
310+
"command": "rust-analyzer.openWalkthrough",
311+
"title": "Open Walkthrough",
312+
"category": "rust-analyzer"
313+
},
314+
{
315+
"command": "rust-analyzer.openFAQ",
316+
"title": "Open FAQ",
317+
"category": "rust-analyzer"
308318
}
309319
],
310320
"keybindings": [
@@ -3132,6 +3142,14 @@
31323142
{
31333143
"command": "rust-analyzer.toggleLSPLogs",
31343144
"when": "inRustProject"
3145+
},
3146+
{
3147+
"command": "rust-analyzer.openWalkthrough",
3148+
"when": "inRustProject"
3149+
},
3150+
{
3151+
"command": "rust-analyzer.openFAQ",
3152+
"when": "inRustProject"
31353153
}
31363154
],
31373155
"editor/context": [
@@ -3161,6 +3179,94 @@
31613179
"fileMatch": "rust-project.json",
31623180
"url": "https://json.schemastore.org/rust-project.json"
31633181
}
3182+
],
3183+
"walkthroughs": [
3184+
{
3185+
"id": "landing",
3186+
"title": "Learn about rust-analyzer",
3187+
"description": "A brief introduction to get started with rust-analyzer. Learn about key features and resources to help you get the most out of the extension.",
3188+
"steps": [
3189+
{
3190+
"id": "docs",
3191+
"title": "Visit the docs!",
3192+
"description": "Confused about configurations? Want to learn more about rust-analyzer? Visit the [User Manual](https://rust-analyzer.github.io/manual.html)!",
3193+
"media": {
3194+
"image": "./icon.png",
3195+
"altText": "rust-analyzer logo"
3196+
},
3197+
"completionEvents": [
3198+
"onLink:https://rust-analyzer.github.io/manual.html"
3199+
]
3200+
},
3201+
{
3202+
"id": "faq",
3203+
"title": "FAQ",
3204+
"description": "Have questions about rust-analyzer? Check out the [FAQ Walkthrough](command:rust-analyzer.openFAQ)!",
3205+
"media": {
3206+
"image": "icon.png",
3207+
"altText": "rust-analyzer logo"
3208+
}
3209+
},
3210+
{
3211+
"id": "changelog",
3212+
"title": "Changelog",
3213+
"description": "Stay up-to-date with the latest changes in rust-analyzer. Check out the changelog [here](https://rust-analyzer.github.io/thisweek)!",
3214+
"media": {
3215+
"image": "icon.png",
3216+
"altText": "rust-analyzer logo"
3217+
},
3218+
"completionEvents": [
3219+
"onLink:https://rust-analyzer.github.io/thisweek"
3220+
]
3221+
},
3222+
{
3223+
"id": "revisit",
3224+
"title": "Want to revisit a walkthrough?",
3225+
"description": "Use the ``Welcome: Open Walkthrough`` command to revisit any walkthrough!",
3226+
"media": {
3227+
"image": "icon.png",
3228+
"altText": "rust-analyzer logo"
3229+
}
3230+
}
3231+
]
3232+
},
3233+
{
3234+
"id": "faq",
3235+
"title": "FAQ",
3236+
"description": "Here are some frequently asked questions about rust-analyzer.",
3237+
"steps": [
3238+
{
3239+
"id": "faq1",
3240+
"title": "What is rust-analyzer?",
3241+
"description": "rust-analyzer is a language server for Rust. It provides features like code completion, find references, and more.",
3242+
"media": {
3243+
"image": "icon.png",
3244+
"altText": "rust-analyzer logo"
3245+
}
3246+
},
3247+
{
3248+
"id": "faq2",
3249+
"title": "Why are all of these type hints showing up in my code?",
3250+
"description": "By default, rust-analyzer displays __inlay hints__ to help you understand your code better. You can disable them in your settings.json file with ``\"editor.inlayHints.enabled\": \"off\"``",
3251+
"media": {
3252+
"image": "icon.png",
3253+
"altText": "rust-analyzer logo"
3254+
}
3255+
},
3256+
{
3257+
"id": "faq3",
3258+
"title": "Where can I find more information about rust-analyzer?",
3259+
"description": "You can find more information about rust-analyzer in the [User Manual](https://rust-analyzer.github.io/manual.html).",
3260+
"media": {
3261+
"image": "icon.png",
3262+
"altText": "rust-analyzer logo"
3263+
},
3264+
"completionEvents": [
3265+
"onLink:https://rust-analyzer.github.io/manual.html"
3266+
]
3267+
}
3268+
]
3269+
}
31643270
]
31653271
}
31663272
}

editors/code/src/commands.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1502,3 +1502,23 @@ export function toggleLSPLogs(ctx: Ctx): Cmd {
15021502
}
15031503
};
15041504
}
1505+
1506+
export function openWalkthrough(_: Ctx): Cmd {
1507+
return async () => {
1508+
await vscode.commands.executeCommand(
1509+
"workbench.action.openWalkthrough",
1510+
"rust-lang.rust-analyzer#landing",
1511+
false,
1512+
);
1513+
};
1514+
}
1515+
1516+
export function openFAQ(_: Ctx): Cmd {
1517+
return async () => {
1518+
await vscode.commands.executeCommand(
1519+
"workbench.action.openWalkthrough",
1520+
"rust-lang.rust-analyzer#faq",
1521+
true,
1522+
);
1523+
};
1524+
}

editors/code/src/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ function createCommands(): Record<string, CommandFactory> {
178178
viewMemoryLayout: { enabled: commands.viewMemoryLayout },
179179
toggleCheckOnSave: { enabled: commands.toggleCheckOnSave },
180180
toggleLSPLogs: { enabled: commands.toggleLSPLogs },
181+
openWalkthrough: { enabled: commands.openWalkthrough },
182+
openFAQ: { enabled: commands.openFAQ },
181183
// Internal commands which are invoked by the server.
182184
applyActionGroup: { enabled: commands.applyActionGroup },
183185
applySnippetWorkspaceEdit: { enabled: commands.applySnippetWorkspaceEditCommand },

0 commit comments

Comments
 (0)