vscode: use void where possible
This commit is contained in:
@@ -55,7 +55,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
|
|||||||
|
|
||||||
// We need to order this after LS updates, but there's no API for that.
|
// We need to order this after LS updates, but there's no API for that.
|
||||||
// Hence, good old setTimeout.
|
// Hence, good old setTimeout.
|
||||||
function afterLs(f: () => unknown) {
|
function afterLs(f: () => void) {
|
||||||
setTimeout(f, 10);
|
setTimeout(f, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as lc from 'vscode-languageclient';
|
import * as lc from 'vscode-languageclient';
|
||||||
|
|
||||||
import { Config } from './config';
|
import { Config } from './config';
|
||||||
import { createClient } from './client';
|
import { createClient } from './client';
|
||||||
|
|
||||||
@@ -73,11 +74,11 @@ export class Ctx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscriptions(): { dispose(): unknown }[] {
|
get subscriptions(): Disposable[] {
|
||||||
return this.extCtx.subscriptions;
|
return this.extCtx.subscriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
pushCleanup(d: { dispose(): unknown }) {
|
pushCleanup(d: Disposable) {
|
||||||
this.extCtx.subscriptions.push(d);
|
this.extCtx.subscriptions.push(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +87,9 @@ export class Ctx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Disposable {
|
||||||
|
dispose(): void;
|
||||||
|
}
|
||||||
export type Cmd = (...args: any[]) => unknown;
|
export type Cmd = (...args: any[]) => unknown;
|
||||||
|
|
||||||
export async function sendRequestWithRetry<R>(
|
export async function sendRequestWithRetry<R>(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
import { WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd } from 'vscode-languageclient';
|
import { WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd, Disposable } from 'vscode-languageclient';
|
||||||
|
|
||||||
import { Ctx } from './ctx';
|
import { Ctx } from './ctx';
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ export function activateStatusDisplay(ctx: Ctx) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class StatusDisplay implements vscode.Disposable {
|
class StatusDisplay implements vscode.Disposable, Disposable {
|
||||||
packageName?: string;
|
packageName?: string;
|
||||||
|
|
||||||
private i: number = 0;
|
private i: number = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user