internal: add "Shuffle Crate Graph" command
This commit is contained in:
@@ -85,6 +85,15 @@ export function memoryUsage(ctx: Ctx): Cmd {
|
||||
};
|
||||
}
|
||||
|
||||
export function shuffleCrateGraph(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const client = ctx.client;
|
||||
if (!client) return;
|
||||
|
||||
await client.sendRequest(ra.shuffleCrateGraph);
|
||||
};
|
||||
}
|
||||
|
||||
export function matchingBrace(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const editor = ctx.activeRustEditor;
|
||||
|
||||
@@ -9,6 +9,7 @@ export interface AnalyzerStatusParams {
|
||||
}
|
||||
export const analyzerStatus = new lc.RequestType<AnalyzerStatusParams, string, void>("rust-analyzer/analyzerStatus");
|
||||
export const memoryUsage = new lc.RequestType0<string, void>("rust-analyzer/memoryUsage");
|
||||
export const shuffleCrateGraph = new lc.RequestType0<null, void>("rust-analyzer/shuffleCrateGraph");
|
||||
|
||||
export interface ServerStatusParams {
|
||||
health: "ok" | "warning" | "error";
|
||||
|
||||
@@ -117,6 +117,7 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
|
||||
|
||||
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
|
||||
ctx.registerCommand('memoryUsage', commands.memoryUsage);
|
||||
ctx.registerCommand('shuffleCrateGraph', commands.shuffleCrateGraph);
|
||||
ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace);
|
||||
ctx.registerCommand('matchingBrace', commands.matchingBrace);
|
||||
ctx.registerCommand('joinLines', commands.joinLines);
|
||||
|
||||
Reference in New Issue
Block a user