Skip to content

Commit 44437e4

Browse files
committed
Fix GetPSHostProcessesRequestType
1 parent 701a510 commit 44437e4

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

src/features/DebugSession.ts

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
// Licensed under the MIT License.
33

44
import vscode = require("vscode");
5-
import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
6-
ExtensionContext, WorkspaceFolder } from "vscode";
5+
import {
6+
CancellationToken, DebugConfiguration, DebugConfigurationProvider,
7+
ExtensionContext, WorkspaceFolder
8+
} from "vscode";
79
import { NotificationType, RequestType } from "vscode-languageclient";
810
import { LanguageClient } from "vscode-languageclient/node";
911
import { getPlatformDetails, OperatingSystem } from "../platform";
10-
import { PowerShellProcess} from "../process";
12+
import { PowerShellProcess } from "../process";
1113
import { IEditorServicesSessionDetails, SessionManager, SessionStatus } from "../session";
1214
import Settings = require("../settings");
1315
import { Logger } from "../logging";
@@ -344,11 +346,7 @@ interface IPSHostProcessInfo {
344346
}
345347

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

353351
export class PickPSHostProcessFeature extends LanguageClientConsumer {
354352

@@ -362,7 +360,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
362360
this.command =
363361
vscode.commands.registerCommand("PowerShell.PickPSHostProcess", () => {
364362
return this.getLanguageClient()
365-
.then((_) => this.pickPSHostProcess(), (_) => undefined);
363+
.then((_) => this.pickPSHostProcess(), (_) => undefined);
366364
});
367365
}
368366

@@ -427,17 +425,17 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
427425
}];
428426

429427
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-
});
428+
for (const process of response ?? []) {
429+
let windowTitle = "";
430+
if (process.mainWindowTitle) {
431+
windowTitle = `, Title: ${process.mainWindowTitle}`;
432+
}
433+
434+
items.push({
435+
label: process.processName,
436+
description: `PID: ${process.processId.toString()}${windowTitle}`,
437+
pid: process.processId,
438+
});
441439
}
442440

443441
if (items.length === 0) {
@@ -484,7 +482,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
484482
this.command =
485483
vscode.commands.registerCommand("PowerShell.PickRunspace", (processId) => {
486484
return this.getLanguageClient()
487-
.then((_) => this.pickRunspace(processId), (_) => undefined);
485+
.then((_) => this.pickRunspace(processId), (_) => undefined);
488486
}, this);
489487
}
490488

0 commit comments

Comments
 (0)