mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 21:53:56 +00:00
Show notification while SSR is in progress
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.
This commit is contained in:
parent
ca31b1d63a
commit
43b7d505da
@ -171,9 +171,15 @@ export function ssr(ctx: Ctx): Cmd {
|
||||
const request = await vscode.window.showInputBox(options);
|
||||
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…
Reference in New Issue
Block a user