diff --git a/Extension/.scripts/common.ts b/Extension/.scripts/common.ts index 29758c269..c40e94398 100644 --- a/Extension/.scripts/common.ts +++ b/Extension/.scripts/common.ts @@ -39,7 +39,7 @@ chdir($root); // dump unhandled async errors to the console and exit. process.on('unhandledRejection', (reason: any, _promise) => { - error(`${reason?.stack?.split(/\r?\n/).filter(l => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`); + error(`${reason?.stack?.split(/\r?\n/).filter((l: string) => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`); process.exit(1); }); diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 60a8ff72e..7bfda0ec8 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -14,12 +14,12 @@ import * as vscode from 'vscode'; import { DocumentFilter, Range } from 'vscode-languageclient'; import * as nls from 'vscode-nls'; import { TargetPopulation } from 'vscode-tas-client'; -import * as which from "which"; import { ManualPromise } from './Utility/Async/manualPromise'; import { isWindows } from './constants'; import { getOutputChannelLogger, showOutputChannel } from './logger'; import { PlatformInformation } from './platform'; import * as Telemetry from './telemetry'; +import which = require('which'); nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @@ -1528,7 +1528,7 @@ export interface ISshLocalForwardInfo { export function whichAsync(name: string, path?: string): Promise { return new Promise(resolve => { - which(name, path ? { path } : {}, (err, resolved) => { + which(name, path ? { path } : {}, (err: Error | null, resolved: string | undefined) => { if (err) { resolve(undefined); } else {