Add landing/faq walkthroughs and commands for quick access

This commit is contained in:
Joel Daniel Rico 2024-06-28 05:30:13 -07:00
parent 4e836c622a
commit 57497645f8
3 changed files with 128 additions and 0 deletions

View file

@ -1502,3 +1502,23 @@ export function toggleLSPLogs(ctx: Ctx): Cmd {
}
};
}
export function openWalkthrough(_: Ctx): Cmd {
return async () => {
await vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
"rust-lang.rust-analyzer#landing",
false,
);
};
}
export function openFAQ(_: Ctx): Cmd {
return async () => {
await vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
"rust-lang.rust-analyzer#faq",
true,
);
};
}

View file

@ -178,6 +178,8 @@ function createCommands(): Record<string, CommandFactory> {
viewMemoryLayout: { enabled: commands.viewMemoryLayout },
toggleCheckOnSave: { enabled: commands.toggleCheckOnSave },
toggleLSPLogs: { enabled: commands.toggleLSPLogs },
openWalkthrough: { enabled: commands.openWalkthrough },
openFAQ: { enabled: commands.openFAQ },
// Internal commands which are invoked by the server.
applyActionGroup: { enabled: commands.applyActionGroup },
applySnippetWorkspaceEdit: { enabled: commands.applySnippetWorkspaceEditCommand },