diff --git a/editors/code/package.json b/editors/code/package.json index 6662747f65b..46d55e32d0f 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -19,7 +19,7 @@ "vscode:prepublish": "rollup -c", "package": "vsce package", "watch": "tsc -watch -p ./", - "prettier": "prettier --write **/*.ts" + "prettier": "prettier --write '**/*.ts'" }, "dependencies": { "jsonc-parser": "^2.1.0", diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts index 849c2ec6c6f..830e40e8f9c 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 03ca582105b..a7f3bc4c10f 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 1a4b8a2d808..e906759c1cd 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 665b0c33cc4..a3febc5f425 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 4503e13f008..efc0dfe1d1a 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 2f986009e56..d641181fa88 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); - } + }; }