aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-02-02 20:19:59 +0000
committerVeetaha <[email protected]>2020-02-02 20:19:59 +0000
commit12d0970f7e4c4d7f91cccb12525fceea3c4c0669 (patch)
tree60776beb4fa5564c17d528c088e484e14ffd06dd /editors/code
parent4bf5f595604c2c3fa0ca981a843d04a8732dabf9 (diff)
vscode extension: migrate from any to unknown where possible
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/client.ts2
-rw-r--r--editors/code/src/color_theme.ts2
-rw-r--r--editors/code/src/commands/syntax_tree.ts2
-rw-r--r--editors/code/src/ctx.ts12
4 files changed, 9 insertions, 9 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 15e1a0873..1778c4e9f 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -68,7 +68,7 @@ PATH=${process.env.PATH}
68 // This also requires considering our settings strategy, which is work which needs doing 68 // This also requires considering our settings strategy, which is work which needs doing
69 // @ts-ignore The tracer is private to vscode-languageclient, but we need access to it to not log publishDecorations requests 69 // @ts-ignore The tracer is private to vscode-languageclient, but we need access to it to not log publishDecorations requests
70 res._tracer = { 70 res._tracer = {
71 log: (messageOrDataObject: string | any, data?: string) => { 71 log: (messageOrDataObject: string | unknown, data?: string) => {
72 if (typeof messageOrDataObject === 'string') { 72 if (typeof messageOrDataObject === 'string') {
73 if ( 73 if (
74 messageOrDataObject.includes( 74 messageOrDataObject.includes(
diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts
index 71113d374..7e10c7f79 100644
--- a/editors/code/src/color_theme.ts
+++ b/editors/code/src/color_theme.ts
@@ -61,7 +61,7 @@ export class ColorTheme {
61} 61}
62 62
63function loadThemeNamed(themeName: string): ColorTheme { 63function loadThemeNamed(themeName: string): ColorTheme {
64 function isTheme(extension: vscode.Extension<any>): boolean { 64 function isTheme(extension: vscode.Extension<unknown>): boolean {
65 return ( 65 return (
66 extension.extensionKind === vscode.ExtensionKind.UI && 66 extension.extensionKind === vscode.ExtensionKind.UI &&
67 extension.packageJSON.contributes && 67 extension.packageJSON.contributes &&
diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts
index 02ea9f166..562df50cd 100644
--- a/editors/code/src/commands/syntax_tree.ts
+++ b/editors/code/src/commands/syntax_tree.ts
@@ -55,7 +55,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
55 55
56// We need to order this after LS updates, but there's no API for that. 56// We need to order this after LS updates, but there's no API for that.
57// Hence, good old setTimeout. 57// Hence, good old setTimeout.
58function afterLs(f: () => any) { 58function afterLs(f: () => unknown) {
59 setTimeout(f, 10); 59 setTimeout(f, 10);
60} 60}
61 61
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
89export type Cmd = (...args: any[]) => any; 89export type Cmd = (...args: unknown[]) => unknown;
90 90
91export async function sendRequestWithRetry<R>( 91export 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]) {