Skip to content

Commit 2fd7af2

Browse files
author
Veetaha
committed
vscode: use void where possible
1 parent 5411d65 commit 2fd7af2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

editors/code/src/commands/syntax_tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
5555

5656
// We need to order this after LS updates, but there's no API for that.
5757
// Hence, good old setTimeout.
58-
function afterLs(f: () => unknown) {
58+
function afterLs(f: () => void) {
5959
setTimeout(f, 10);
6060
}
6161

editors/code/src/ctx.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as vscode from 'vscode';
22
import * as lc from 'vscode-languageclient';
3+
34
import { Config } from './config';
45
import { createClient } from './client';
56

@@ -73,11 +74,11 @@ export class Ctx {
7374
}
7475
}
7576

76-
get subscriptions(): { dispose(): unknown }[] {
77+
get subscriptions(): Disposable[] {
7778
return this.extCtx.subscriptions;
7879
}
7980

80-
pushCleanup(d: { dispose(): unknown }) {
81+
pushCleanup(d: Disposable) {
8182
this.extCtx.subscriptions.push(d);
8283
}
8384

@@ -86,6 +87,9 @@ export class Ctx {
8687
}
8788
}
8889

90+
export interface Disposable {
91+
dispose(): void;
92+
}
8993
export type Cmd = (...args: any[]) => unknown;
9094

9195
export async function sendRequestWithRetry<R>(

editors/code/src/status_display.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode';
22

3-
import { WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd } from 'vscode-languageclient';
3+
import { WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd, Disposable } from 'vscode-languageclient';
44

55
import { Ctx } from './ctx';
66

@@ -14,7 +14,7 @@ export function activateStatusDisplay(ctx: Ctx) {
1414
});
1515
}
1616

17-
class StatusDisplay implements vscode.Disposable {
17+
class StatusDisplay implements vscode.Disposable, Disposable {
1818
packageName?: string;
1919

2020
private i: number = 0;

0 commit comments

Comments
 (0)