From e26071d96e1ff56289213dbe78415f836de8a70e Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Mon, 8 Oct 2018 22:38:33 +0100 Subject: Run prettier on all files --- editors/code/src/commands/runnables.ts | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'editors/code/src/commands/runnables.ts') diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 40f590dce..c234bfaec 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -41,39 +41,56 @@ function createTask(spec: Runnable): vscode.Task { label: 'cargo', command: spec.bin, args: spec.args, - env: spec.env, + env: spec.env }; const execCmd = `${definition.command} ${definition.args.join(' ')}`; const execOption: vscode.ShellExecutionOptions = { cwd: '.', - env: definition.env, + env: definition.env }; const exec = new vscode.ShellExecution(`clear; ${execCmd}`, execOption); const f = vscode.workspace.workspaceFolders![0]; - const t = new vscode.Task(definition, f, definition.label, TASK_SOURCE, exec, ['$rustc']); + const t = new vscode.Task( + definition, + f, + definition.label, + TASK_SOURCE, + exec, + ['$rustc'] + ); return t; } let prevRunnable: RunnableQuickPick | undefined; export async function handle() { const editor = vscode.window.activeTextEditor; - if (editor == null || editor.document.languageId !== 'rust') { return; } + if (editor == null || editor.document.languageId !== 'rust') { + return; + } const textDocument: lc.TextDocumentIdentifier = { - uri: editor.document.uri.toString(), + uri: editor.document.uri.toString() }; const params: RunnablesParams = { textDocument, - position: Server.client.code2ProtocolConverter.asPosition(editor.selection.active), + position: Server.client.code2ProtocolConverter.asPosition( + editor.selection.active + ) }; - const runnables = await Server.client.sendRequest('m/runnables', params); + const runnables = await Server.client.sendRequest( + 'm/runnables', + params + ); const items: RunnableQuickPick[] = []; if (prevRunnable) { items.push(prevRunnable); } for (const r of runnables) { - if (prevRunnable && JSON.stringify(prevRunnable.runnable) === JSON.stringify(r)) { + if ( + prevRunnable && + JSON.stringify(prevRunnable.runnable) === JSON.stringify(r) + ) { continue; } items.push(new RunnableQuickPick(r)); -- cgit v1.2.3