@@ -14,18 +14,21 @@ import Settings = require("../settings");
14
14
import utils = require( "../utils" ) ;
15
15
import { NamedPipeDebugAdapter } from "../debugAdapter" ;
16
16
import { Logger } from "../logging" ;
17
+ import { LanguageClientConsumer } from "../languageClientConsumer" ;
17
18
18
19
export const StartDebuggerNotificationType =
19
20
new NotificationType < void , void > ( "powerShell/startDebugger" ) ;
20
21
21
- export class DebugSessionFeature implements IFeature , DebugConfigurationProvider , vscode . DebugAdapterDescriptorFactory {
22
+ export class DebugSessionFeature extends LanguageClientConsumer
23
+ implements IFeature , DebugConfigurationProvider , vscode . DebugAdapterDescriptorFactory {
22
24
23
25
private sessionCount : number = 1 ;
24
26
private command : vscode . Disposable ;
25
27
private tempDebugProcess : PowerShellProcess ;
26
28
private tempSessionDetails : utils . IEditorServicesSessionDetails ;
27
29
28
30
constructor ( context : ExtensionContext , private sessionManager : SessionManager , private logger : Logger ) {
31
+ super ( ) ;
29
32
// Register a debug configuration provider
30
33
context . subscriptions . push ( vscode . debug . registerDebugConfigurationProvider ( "PowerShell" , this ) ) ;
31
34
context . subscriptions . push ( vscode . debug . registerDebugAdapterDescriptorFactory ( "PowerShell" , this ) )
@@ -386,14 +389,14 @@ interface IGetPSHostProcessesResponseBody {
386
389
hostProcesses : IPSHostProcessInfo [ ] ;
387
390
}
388
391
389
- export class PickPSHostProcessFeature implements IFeature {
392
+ export class PickPSHostProcessFeature extends LanguageClientConsumer implements IFeature {
390
393
391
394
private command : vscode . Disposable ;
392
- private languageClient : LanguageClient ;
393
395
private waitingForClientToken : vscode . CancellationTokenSource ;
394
396
private getLanguageClientResolve : ( value ?: LanguageClient | Thenable < LanguageClient > ) => void ;
395
397
396
398
constructor ( ) {
399
+ super ( ) ;
397
400
398
401
this . command =
399
402
vscode . commands . registerCommand ( "PowerShell.PickPSHostProcess" , ( ) => {
@@ -517,14 +520,14 @@ interface IRunspace {
517
520
export const GetRunspaceRequestType =
518
521
new RequestType < any , IRunspace [ ] , string , void > ( "powerShell/getRunspace" ) ;
519
522
520
- export class PickRunspaceFeature implements IFeature {
523
+ export class PickRunspaceFeature extends LanguageClientConsumer implements IFeature {
521
524
522
525
private command : vscode . Disposable ;
523
- private languageClient : LanguageClient ;
524
526
private waitingForClientToken : vscode . CancellationTokenSource ;
525
527
private getLanguageClientResolve : ( value ?: LanguageClient | Thenable < LanguageClient > ) => void ;
526
528
527
529
constructor ( ) {
530
+ super ( ) ;
528
531
this . command =
529
532
vscode . commands . registerCommand ( "PowerShell.PickRunspace" , ( processId ) => {
530
533
return this . getLanguageClient ( )
0 commit comments