From 5c3cc8c95f392c523bb638d78e0217780d6e8476 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Mon, 18 Mar 2019 22:15:03 +0100 Subject: Reformat using Prettier --- editors/code/src/commands/runnables.ts | 10 ++++---- editors/code/src/extension.ts | 42 ++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 17 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index c6d23a185..23fd280b4 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -128,7 +128,7 @@ export const autoCargoWatchTask: vscode.Task = { name: 'cargo watch', source: 'rust-analyzer', definition: { - type: "dupa", + type: 'watch' }, execution: new vscode.ShellExecution('cargo', ['watch'], { cwd: '.' }), @@ -138,8 +138,8 @@ export const autoCargoWatchTask: vscode.Task = { clear: true }, // Not yet exposed in the vscode.d.ts - runOptions: { - runOn: 2 // RunOnOptions.folderOpen, https://github.com/Microsoft/vscode/blob/ea7c31d770e04b51d586b0d3944f3a7feb03afb9/src/vs/workbench/contrib/tasks/common/tasks.ts#L444-L456 - } as unknown as vscode.RunOptions, - + // https://github.com/Microsoft/vscode/blob/ea7c31d770e04b51d586b0d3944f3a7feb03afb9/src/vs/workbench/contrib/tasks/common/tasks.ts#L444-L456 + runOptions: ({ + runOn: 2 // RunOnOptions.folderOpen + } as unknown) as vscode.RunOptions }; diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 442c9cd0d..f915a5023 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -92,11 +92,11 @@ export function activate(context: vscode.ExtensionContext) { const allNotifications: Iterable< [string, lc.GenericNotificationHandler] > = [ - [ - 'rust-analyzer/publishDecorations', - notifications.publishDecorations.handle - ] - ]; + [ + 'rust-analyzer/publishDecorations', + notifications.publishDecorations.handle + ] + ]; const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); // The events below are plain old javascript events, triggered and handled by vscode @@ -146,10 +146,17 @@ async function askToCargoWatch() { return; } - const { stderr } = await util.promisify(exec)('cargo watch --version').catch(e => e); + const { stderr } = await util + .promisify(exec)('cargo watch --version') + .catch(e => e); if (stderr.includes('no such subcommand: `watch`')) { - const msg = 'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)'; - const install = await vscode.window.showInformationMessage(msg, 'yes', 'no'); + const msg = + 'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)'; + const install = await vscode.window.showInformationMessage( + msg, + 'yes', + 'no' + ); if (install === 'no') { return; } @@ -160,15 +167,26 @@ async function askToCargoWatch() { if (execution.task.name === label) { disposable.dispose(); resolve(); - }; + } }); }); - vscode.tasks.executeTask(createTask({ label, bin: 'cargo', args: ['install', 'cargo-watch'], env: {} })); + vscode.tasks.executeTask( + createTask({ + label, + bin: 'cargo', + args: ['install', 'cargo-watch'], + env: {} + }) + ); await taskFinished; - const { stderr } = await util.promisify(exec)('cargo watch --version').catch(e => e); + const { stderr } = await util + .promisify(exec)('cargo watch --version') + .catch(e => e); if (stderr !== '') { - vscode.window.showErrorMessage(`Couldn't install \`cargo-\`watch: ${stderr}`); + vscode.window.showErrorMessage( + `Couldn't install \`cargo-\`watch: ${stderr}` + ); return; } } -- cgit v1.2.3