Skip to content

Commit 1cdb27c

Browse files
committed
Fix GetPSHostProcessesRequestType
1 parent 701a510 commit 1cdb27c

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/features/DebugSession.ts

+12-16
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,7 @@ interface IPSHostProcessInfo {
344344
}
345345

346346
export const GetPSHostProcessesRequestType =
347-
new RequestType<any, IGetPSHostProcessesResponseBody, string>("powerShell/getPSHostProcesses");
348-
349-
interface IGetPSHostProcessesResponseBody {
350-
hostProcesses: IPSHostProcessInfo[];
351-
}
347+
new RequestType<any, IPSHostProcessInfo[], string>("powerShell/getPSHostProcesses");
352348

353349
export class PickPSHostProcessFeature extends LanguageClientConsumer {
354350

@@ -427,17 +423,17 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
427423
}];
428424

429425
const response = await this.languageClient?.sendRequest(GetPSHostProcessesRequestType, {});
430-
for (const process of response?.hostProcesses ?? []) {
431-
let windowTitle = "";
432-
if (process.mainWindowTitle) {
433-
windowTitle = `, Title: ${process.mainWindowTitle}`;
434-
}
435-
436-
items.push({
437-
label: process.processName,
438-
description: `PID: ${process.processId.toString()}${windowTitle}`,
439-
pid: process.processId,
440-
});
426+
for (const process of response ?? []) {
427+
let windowTitle = "";
428+
if (process.mainWindowTitle) {
429+
windowTitle = `, Title: ${process.mainWindowTitle}`;
430+
}
431+
432+
items.push({
433+
label: process.processName,
434+
description: `PID: ${process.processId.toString()}${windowTitle}`,
435+
pid: process.processId,
436+
});
441437
}
442438

443439
if (items.length === 0) {

0 commit comments

Comments
 (0)