Skip to content

Commit 78d5f05

Browse files
committed
Auto merge of #17508 - jjoeldaniel:landing-page, r=Veykril
feat: Add landing/faq walkthrough pages This is a basic implementation of a landing and FAQ page; I've included the bare-bones information as well as a [recommended section on inlay hints](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Landing.20Page/near/446135321). I've also added `rust-analyzer: Open Walkthrough` and `rust-analyzer: Open FAQ` commands for ease of access. I am hoping to create a small list of FAQ to include that might be useful as well as any other information I may have missed in the landing page. Feel free to share any suggestions! ![landing/faq page demo](https://github.com/rust-lang/rust-analyzer/assets/100006388/4644e4f0-4555-4b29-83c1-b048084ad63d) cc #13351
2 parents 39d7962 + 5749764 commit 78d5f05

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": [
@@ -3142,6 +3152,14 @@
31423152
{
31433153
"command": "rust-analyzer.toggleLSPLogs",
31443154
"when": "inRustProject"
3155+
},
3156+
{
3157+
"command": "rust-analyzer.openWalkthrough",
3158+
"when": "inRustProject"
3159+
},
3160+
{
3161+
"command": "rust-analyzer.openFAQ",
3162+
"when": "inRustProject"
31453163
}
31463164
],
31473165
"editor/context": [
@@ -3171,6 +3189,94 @@
31713189
"fileMatch": "rust-project.json",
31723190
"url": "https://json.schemastore.org/rust-project.json"
31733191
}
3192+
],
3193+
"walkthroughs": [
3194+
{
3195+
"id": "landing",
3196+
"title": "Learn about rust-analyzer",
3197+
"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.",
3198+
"steps": [
3199+
{
3200+
"id": "docs",
3201+
"title": "Visit the docs!",
3202+
"description": "Confused about configurations? Want to learn more about rust-analyzer? Visit the [User Manual](https://rust-analyzer.github.io/manual.html)!",
3203+
"media": {
3204+
"image": "./icon.png",
3205+
"altText": "rust-analyzer logo"
3206+
},
3207+
"completionEvents": [
3208+
"onLink:https://rust-analyzer.github.io/manual.html"
3209+
]
3210+
},
3211+
{
3212+
"id": "faq",
3213+
"title": "FAQ",
3214+
"description": "Have questions about rust-analyzer? Check out the [FAQ Walkthrough](command:rust-analyzer.openFAQ)!",
3215+
"media": {
3216+
"image": "icon.png",
3217+
"altText": "rust-analyzer logo"
3218+
}
3219+
},
3220+
{
3221+
"id": "changelog",
3222+
"title": "Changelog",
3223+
"description": "Stay up-to-date with the latest changes in rust-analyzer. Check out the changelog [here](https://rust-analyzer.github.io/thisweek)!",
3224+
"media": {
3225+
"image": "icon.png",
3226+
"altText": "rust-analyzer logo"
3227+
},
3228+
"completionEvents": [
3229+
"onLink:https://rust-analyzer.github.io/thisweek"
3230+
]
3231+
},
3232+
{
3233+
"id": "revisit",
3234+
"title": "Want to revisit a walkthrough?",
3235+
"description": "Use the ``Welcome: Open Walkthrough`` command to revisit any walkthrough!",
3236+
"media": {
3237+
"image": "icon.png",
3238+
"altText": "rust-analyzer logo"
3239+
}
3240+
}
3241+
]
3242+
},
3243+
{
3244+
"id": "faq",
3245+
"title": "FAQ",
3246+
"description": "Here are some frequently asked questions about rust-analyzer.",
3247+
"steps": [
3248+
{
3249+
"id": "faq1",
3250+
"title": "What is rust-analyzer?",
3251+
"description": "rust-analyzer is a language server for Rust. It provides features like code completion, find references, and more.",
3252+
"media": {
3253+
"image": "icon.png",
3254+
"altText": "rust-analyzer logo"
3255+
}
3256+
},
3257+
{
3258+
"id": "faq2",
3259+
"title": "Why are all of these type hints showing up in my code?",
3260+
"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\"``",
3261+
"media": {
3262+
"image": "icon.png",
3263+
"altText": "rust-analyzer logo"
3264+
}
3265+
},
3266+
{
3267+
"id": "faq3",
3268+
"title": "Where can I find more information about rust-analyzer?",
3269+
"description": "You can find more information about rust-analyzer in the [User Manual](https://rust-analyzer.github.io/manual.html).",
3270+
"media": {
3271+
"image": "icon.png",
3272+
"altText": "rust-analyzer logo"
3273+
},
3274+
"completionEvents": [
3275+
"onLink:https://rust-analyzer.github.io/manual.html"
3276+
]
3277+
}
3278+
]
3279+
}
31743280
]
31753281
}
31763282
}

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)