From 29e86c0c726c20cf1add94a322b9c147b67ca1f6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Dec 2019 14:53:43 +0100 Subject: More second command to Ctx --- editors/code/src/ctx.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'editors/code/src/ctx.ts') diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 8581667b4..9dd2b7d4f 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -16,7 +16,7 @@ export class Ctx { registerCommand( name: string, - factory: (ctx: Ctx) => () => Promise, + factory: (ctx: Ctx) => Cmd, ) { const fullName = `rust-analyzer.${name}` const cmd = factory(this); @@ -28,3 +28,5 @@ export class Ctx { this.extCtx.subscriptions.push(d) } } + +export type Cmd = (...args: any[]) => any; -- cgit v1.2.3