File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import fetch from "node-fetch";
22import * as fs from "fs" ;
33import * as stream from "stream" ;
44import * as util from "util" ;
5- import { strict as assert } from "assert" ;
6- import { log } from "../util" ;
5+ import { log , assert } from "../util" ;
76
87const pipeline = util . promisify ( stream . pipeline ) ;
98
Original file line number Diff line number Diff line change 11import * as vscode from "vscode" ;
22import * as path from "path" ;
3- import { strict as assert } from "assert" ;
43import { promises as dns } from "dns" ;
54import { spawnSync } from "child_process" ;
65
76import { BinarySource } from "./interfaces" ;
87import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info" ;
98import { downloadArtifact } from "./download_artifact" ;
10- import { log } from "../util" ;
9+ import { log , assert } from "../util" ;
1110
1211export async function ensureServerBinary ( source : null | BinarySource ) : Promise < null | string > {
1312 if ( ! source ) {
Original file line number Diff line number Diff line change 11import * as lc from "vscode-languageclient" ;
22import * as vscode from "vscode" ;
3+ import { strict as nodeAssert } from "assert" ;
34
4- let enabled : boolean = false ;
5+ export function assert ( condition : unknown , explanation : string ) : asserts condition {
6+ nodeAssert ( condition , explanation ) ;
7+ }
58
69export const log = {
10+ enabled : true ,
711 debug ( message ?: any , ...optionalParams : any [ ] ) : void {
8- if ( ! enabled ) return ;
12+ if ( ! log . enabled ) return ;
913 // eslint-disable-next-line no-console
1014 console . log ( message , ...optionalParams ) ;
1115 } ,
1216 error ( message ?: any , ...optionalParams : any [ ] ) : void {
13- if ( ! enabled ) return ;
17+ if ( ! log . enabled ) return ;
1418 debugger ;
1519 // eslint-disable-next-line no-console
1620 console . error ( message , ...optionalParams ) ;
1721 } ,
1822 setEnabled ( yes : boolean ) : void {
19- enabled = yes ;
23+ log . enabled = yes ;
2024 }
2125} ;
2226
You can’t perform that action at this time.
0 commit comments