diff options
author | Veetaha <[email protected]> | 2020-02-02 20:19:59 +0000 |
---|---|---|
committer | Veetaha <[email protected]> | 2020-02-02 20:19:59 +0000 |
commit | 12d0970f7e4c4d7f91cccb12525fceea3c4c0669 (patch) | |
tree | 60776beb4fa5564c17d528c088e484e14ffd06dd /editors/code/src/ctx.ts | |
parent | 4bf5f595604c2c3fa0ca981a843d04a8732dabf9 (diff) |
vscode extension: migrate from any to unknown where possible
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r-- | editors/code/src/ctx.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 094566d09..aae2c5f90 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts | |||
@@ -52,12 +52,12 @@ export class Ctx { | |||
52 | overrideCommand(name: string, factory: (ctx: Ctx) => Cmd) { | 52 | overrideCommand(name: string, factory: (ctx: Ctx) => Cmd) { |
53 | const defaultCmd = `default:${name}`; | 53 | const defaultCmd = `default:${name}`; |
54 | const override = factory(this); | 54 | const override = factory(this); |
55 | const original = (...args: any[]) => | 55 | const original = (...args: unknown[]) => |
56 | vscode.commands.executeCommand(defaultCmd, ...args); | 56 | vscode.commands.executeCommand(defaultCmd, ...args); |
57 | try { | 57 | try { |
58 | const d = vscode.commands.registerCommand( | 58 | const d = vscode.commands.registerCommand( |
59 | name, | 59 | name, |
60 | async (...args: any[]) => { | 60 | async (...args: unknown[]) => { |
61 | if (!(await override(...args))) { | 61 | if (!(await override(...args))) { |
62 | return await original(...args); | 62 | return await original(...args); |
63 | } | 63 | } |
@@ -73,11 +73,11 @@ export class Ctx { | |||
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | get subscriptions(): { dispose(): any }[] { | 76 | get subscriptions(): { dispose(): unknown }[] { |
77 | return this.extCtx.subscriptions; | 77 | return this.extCtx.subscriptions; |
78 | } | 78 | } |
79 | 79 | ||
80 | pushCleanup(d: { dispose(): any }) { | 80 | pushCleanup(d: { dispose(): unknown }) { |
81 | this.extCtx.subscriptions.push(d); | 81 | this.extCtx.subscriptions.push(d); |
82 | } | 82 | } |
83 | 83 | ||
@@ -86,12 +86,12 @@ export class Ctx { | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | export type Cmd = (...args: any[]) => any; | 89 | export type Cmd = (...args: unknown[]) => unknown; |
90 | 90 | ||
91 | export async function sendRequestWithRetry<R>( | 91 | export async function sendRequestWithRetry<R>( |
92 | client: lc.LanguageClient, | 92 | client: lc.LanguageClient, |
93 | method: string, | 93 | method: string, |
94 | param: any, | 94 | param: unknown, |
95 | token?: vscode.CancellationToken, | 95 | token?: vscode.CancellationToken, |
96 | ): Promise<R> { | 96 | ): Promise<R> { |
97 | for (const delay of [2, 4, 6, 8, 10, null]) { | 97 | for (const delay of [2, 4, 6, 8, 10, null]) { |