Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 674f82b

Browse files
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 <[email protected]>
2 parents 26f6d90 + 140a34f commit 674f82b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

rust-analyzer/editors/code/src/commands.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,15 @@ export function ssr(ctx: Ctx): Cmd {
171171
const request = await vscode.window.showInputBox(options);
172172
if (!request) return;
173173

174-
const edit = await client.sendRequest(ra.ssr, { query: request, parseOnly: false });
175-
176-
await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
174+
vscode.window.withProgress({
175+
location: vscode.ProgressLocation.Notification,
176+
title: "Structured search replace in progress...",
177+
cancellable: false,
178+
}, async (_progress, _token) => {
179+
const edit = await client.sendRequest(ra.ssr, { query: request, parseOnly: false });
180+
181+
await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
182+
});
177183
};
178184
}
179185

0 commit comments

Comments
 (0)