Skip to content

Commit df58934

Browse files
authored
Fix TypeScript compilation errors in common.ts (#14551)
* Fix TypeScript errors.
1 parent 959a4d1 commit df58934

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Extension/.scripts/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ chdir($root);
3939

4040
// dump unhandled async errors to the console and exit.
4141
process.on('unhandledRejection', (reason: any, _promise) => {
42-
error(`${reason?.stack?.split(/\r?\n/).filter(l => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`);
42+
error(`${reason?.stack?.split(/\r?\n/).filter((l: string) => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`);
4343
process.exit(1);
4444
});
4545

Extension/src/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import * as vscode from 'vscode';
1414
import { DocumentFilter, Range } from 'vscode-languageclient';
1515
import * as nls from 'vscode-nls';
1616
import { TargetPopulation } from 'vscode-tas-client';
17-
import * as which from "which";
1817
import { ManualPromise } from './Utility/Async/manualPromise';
1918
import { isWindows } from './constants';
2019
import { getOutputChannelLogger, showOutputChannel } from './logger';
2120
import { PlatformInformation } from './platform';
2221
import * as Telemetry from './telemetry';
22+
import which = require('which');
2323

2424
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
2525
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -1528,7 +1528,7 @@ export interface ISshLocalForwardInfo {
15281528

15291529
export function whichAsync(name: string, path?: string): Promise<string | undefined> {
15301530
return new Promise<string | undefined>(resolve => {
1531-
which(name, path ? { path } : {}, (err, resolved) => {
1531+
which(name, path ? { path } : {}, (err: Error | null, resolved: string | undefined) => {
15321532
if (err) {
15331533
resolve(undefined);
15341534
} else {

0 commit comments

Comments
 (0)