Handle proc macro fetching via OpQueue

This commit is contained in:
Lukas Wirth 2023-03-26 08:39:28 +02:00
parent 27c076a367
commit ee02213e65
17 changed files with 121 additions and 92 deletions

View file

@ -200,8 +200,8 @@
"category": "rust-analyzer"
},
{
"command": "rust-analyzer.reloadProcMacros",
"title": "Reload proc macros and build scripts",
"command": "rust-analyzer.rebuildProcMacros",
"title": "Rebuild proc macros and build scripts",
"category": "rust-analyzer"
},
{

View file

@ -749,8 +749,8 @@ export function reloadWorkspace(ctx: CtxInit): Cmd {
return async () => ctx.client.sendRequest(ra.reloadWorkspace);
}
export function reloadProcMacros(ctx: CtxInit): Cmd {
return async () => ctx.client.sendRequest(ra.reloadProcMacros);
export function rebuildProcMacros(ctx: CtxInit): Cmd {
return async () => ctx.client.sendRequest(ra.rebuildProcMacros);
}
export function addProject(ctx: CtxInit): Cmd {

View file

@ -383,7 +383,7 @@ export class Ctx {
"\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)"
);
statusBar.tooltip.appendMarkdown(
"\n\n[Rebuild Proc Macros](command:rust-analyzer.reloadProcMacros)"
"\n\n[Rebuild Proc Macros](command:rust-analyzer.rebuildProcMacros)"
);
statusBar.tooltip.appendMarkdown("\n\n[Restart server](command:rust-analyzer.startServer)");
statusBar.tooltip.appendMarkdown("\n\n[Stop server](command:rust-analyzer.stopServer)");

View file

@ -43,7 +43,7 @@ export const relatedTests = new lc.RequestType<lc.TextDocumentPositionParams, Te
"rust-analyzer/relatedTests"
);
export const reloadWorkspace = new lc.RequestType0<null, void>("rust-analyzer/reloadWorkspace");
export const reloadProcMacros = new lc.RequestType0<null, void>("rust-analyzer/reloadProcMacros");
export const rebuildProcMacros = new lc.RequestType0<null, void>("rust-analyzer/reloadProcMacros");
export const runFlycheck = new lc.NotificationType<{
textDocument: lc.TextDocumentIdentifier | null;

View file

@ -153,7 +153,7 @@ function createCommands(): Record<string, CommandFactory> {
memoryUsage: { enabled: commands.memoryUsage },
shuffleCrateGraph: { enabled: commands.shuffleCrateGraph },
reloadWorkspace: { enabled: commands.reloadWorkspace },
reloadProcMacros: { enabled: commands.reloadProcMacros },
rebuildProcMacros: { enabled: commands.rebuildProcMacros },
addProject: { enabled: commands.addProject },
matchingBrace: { enabled: commands.matchingBrace },
joinLines: { enabled: commands.joinLines },