2
2
// Licensed under the MIT License.
3
3
4
4
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" ;
7
9
import { NotificationType , RequestType } from "vscode-languageclient" ;
8
10
import { LanguageClient } from "vscode-languageclient/node" ;
9
11
import { getPlatformDetails , OperatingSystem } from "../platform" ;
10
- import { PowerShellProcess } from "../process" ;
12
+ import { PowerShellProcess } from "../process" ;
11
13
import { IEditorServicesSessionDetails , SessionManager , SessionStatus } from "../session" ;
12
14
import Settings = require( "../settings" ) ;
13
15
import { Logger } from "../logging" ;
@@ -344,11 +346,7 @@ interface IPSHostProcessInfo {
344
346
}
345
347
346
348
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" ) ;
352
350
353
351
export class PickPSHostProcessFeature extends LanguageClientConsumer {
354
352
@@ -362,7 +360,7 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
362
360
this . command =
363
361
vscode . commands . registerCommand ( "PowerShell.PickPSHostProcess" , ( ) => {
364
362
return this . getLanguageClient ( )
365
- . then ( ( _ ) => this . pickPSHostProcess ( ) , ( _ ) => undefined ) ;
363
+ . then ( ( _ ) => this . pickPSHostProcess ( ) , ( _ ) => undefined ) ;
366
364
} ) ;
367
365
}
368
366
@@ -427,17 +425,17 @@ export class PickPSHostProcessFeature extends LanguageClientConsumer {
427
425
} ] ;
428
426
429
427
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
+ } ) ;
441
439
}
442
440
443
441
if ( items . length === 0 ) {
@@ -484,7 +482,7 @@ export class PickRunspaceFeature extends LanguageClientConsumer {
484
482
this . command =
485
483
vscode . commands . registerCommand ( "PowerShell.PickRunspace" , ( processId ) => {
486
484
return this . getLanguageClient ( )
487
- . then ( ( _ ) => this . pickRunspace ( processId ) , ( _ ) => undefined ) ;
485
+ . then ( ( _ ) => this . pickRunspace ( processId ) , ( _ ) => undefined ) ;
488
486
} , this ) ;
489
487
}
490
488
0 commit comments