mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 19:34:16 +00:00
Merge #5119
5119: Show notification while SSR is in progress r=matklad a=davidlattimore Ideally we would (a) show progress and (b) allow cancellation, but at least now there's some indication to the user that something is happening. Co-authored-by: David Lattimore <dml@google.com>
This commit is contained in:
commit
9f12903bb1
1 changed files with 8 additions and 2 deletions
|
@ -171,9 +171,15 @@ export function ssr(ctx: Ctx): Cmd {
|
||||||
const request = await vscode.window.showInputBox(options);
|
const request = await vscode.window.showInputBox(options);
|
||||||
if (!request) return;
|
if (!request) return;
|
||||||
|
|
||||||
const edit = await client.sendRequest(ra.ssr, { query: request, parseOnly: false });
|
vscode.window.withProgress({
|
||||||
|
location: vscode.ProgressLocation.Notification,
|
||||||
|
title: "Structured search replace in progress...",
|
||||||
|
cancellable: false,
|
||||||
|
}, async (_progress, _token) => {
|
||||||
|
const edit = await client.sendRequest(ra.ssr, { query: request, parseOnly: false });
|
||||||
|
|
||||||
await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
|
await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue