From 43b7d505dad2b6c4a8fd3b6ebb97c287ce06ce56 Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Mon, 29 Jun 2020 19:17:35 +1000 Subject: 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. --- editors/code/src/commands.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 8c9d7802f..5606b6e9e 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -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 }); - - await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit)); + 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)); + }); }; } -- cgit v1.2.3