From ac3d0e83403be22ec31d62a1501d726f6e6f81e1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Dec 2019 18:31:08 +0100 Subject: Run prettier on all files --- editors/code/src/commands/analyzer_status.ts | 10 +++------- editors/code/src/commands/index.ts | 8 +++++--- editors/code/src/commands/join_lines.ts | 6 ++---- editors/code/src/commands/matching_brace.ts | 6 ++++-- editors/code/src/commands/on_enter.ts | 7 ++----- editors/code/src/commands/parent_module.ts | 2 +- 6 files changed, 17 insertions(+), 22 deletions(-) (limited to 'editors/code/src') diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts index 849c2ec6c..830e40e8f 100644 --- a/editors/code/src/commands/analyzer_status.ts +++ b/editors/code/src/commands/analyzer_status.ts @@ -23,10 +23,7 @@ export function analyzerStatus(ctx: Ctx): Cmd { return async function handle() { if (poller == null) { - poller = setInterval( - () => tdcp.eventEmitter.fire(tdcp.uri), - 1000, - ); + poller = setInterval(() => tdcp.eventEmitter.fire(tdcp.uri), 1000); } const document = await vscode.workspace.openTextDocument(tdcp.uri); return vscode.window.showTextDocument( @@ -39,13 +36,12 @@ export function analyzerStatus(ctx: Ctx): Cmd { class TextDocumentContentProvider implements vscode.TextDocumentContentProvider { - - ctx: Ctx + ctx: Ctx; uri = vscode.Uri.parse('rust-analyzer-status://status'); eventEmitter = new vscode.EventEmitter(); constructor(ctx: Ctx) { - this.ctx = ctx + this.ctx = ctx; } provideTextDocumentContent( diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index 03ca58210..a7f3bc4c1 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts @@ -1,4 +1,4 @@ -import { Ctx, Cmd } from '../ctx' +import { Ctx, Cmd } from '../ctx'; import { analyzerStatus } from './analyzer_status'; import { matchingBrace } from './matching_brace'; @@ -11,7 +11,9 @@ import * as runnables from './runnables'; import * as syntaxTree from './syntaxTree'; function collectGarbage(ctx: Ctx): Cmd { - return async () => { ctx.client.sendRequest('rust-analyzer/collectGarbage', null) } + return async () => { + ctx.client.sendRequest('rust-analyzer/collectGarbage', null); + }; } export { @@ -24,5 +26,5 @@ export { syntaxTree, onEnter, inlayHints, - collectGarbage + collectGarbage, }; diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts index 1a4b8a2d8..e906759c1 100644 --- a/editors/code/src/commands/join_lines.ts +++ b/editors/code/src/commands/join_lines.ts @@ -1,8 +1,6 @@ import { Range, TextDocumentIdentifier } from 'vscode-languageclient'; import { Ctx, Cmd } from '../ctx'; -import { - applySourceChange, SourceChange -} from '../source_change'; +import { applySourceChange, SourceChange } from '../source_change'; export function joinLines(ctx: Ctx): Cmd { return async () => { @@ -18,7 +16,7 @@ export function joinLines(ctx: Ctx): Cmd { request, ); await applySourceChange(ctx, change); - } + }; } interface JoinLinesParams { diff --git a/editors/code/src/commands/matching_brace.ts b/editors/code/src/commands/matching_brace.ts index 665b0c33c..a3febc5f4 100644 --- a/editors/code/src/commands/matching_brace.ts +++ b/editors/code/src/commands/matching_brace.ts @@ -10,7 +10,9 @@ export function matchingBrace(ctx: Ctx): Cmd { } const request: FindMatchingBraceParams = { textDocument: { uri: editor.document.uri.toString() }, - offsets: editor.selections.map(s => ctx.client.code2ProtocolConverter.asPosition(s.active)), + offsets: editor.selections.map(s => + ctx.client.code2ProtocolConverter.asPosition(s.active), + ), }; const response = await ctx.client.sendRequest( 'rust-analyzer/findMatchingBrace', @@ -24,7 +26,7 @@ export function matchingBrace(ctx: Ctx): Cmd { return new vscode.Selection(anchor, active); }); editor.revealRange(editor.selection); - } + }; } interface FindMatchingBraceParams { diff --git a/editors/code/src/commands/on_enter.ts b/editors/code/src/commands/on_enter.ts index 4503e13f0..efc0dfe1d 100644 --- a/editors/code/src/commands/on_enter.ts +++ b/editors/code/src/commands/on_enter.ts @@ -1,8 +1,5 @@ import * as lc from 'vscode-languageclient'; -import { - applySourceChange, - SourceChange, -} from '../source_change'; +import { applySourceChange, SourceChange } from '../source_change'; import { Cmd, Ctx } from '../ctx'; export function onEnter(ctx: Ctx): Cmd { @@ -24,5 +21,5 @@ export function onEnter(ctx: Ctx): Cmd { await applySourceChange(ctx, change); return true; - } + }; } diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts index 2f986009e..d641181fa 100644 --- a/editors/code/src/commands/parent_module.ts +++ b/editors/code/src/commands/parent_module.ts @@ -28,5 +28,5 @@ export function parentModule(ctx: Ctx): Cmd { const e = await vscode.window.showTextDocument(doc); e.selection = new vscode.Selection(range.start, range.start); e.revealRange(range, vscode.TextEditorRevealType.InCenter); - } + }; } -- cgit v1.2.3