File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
src/PowerShellEditorServices.Protocol/Server
test/PowerShellEditorServices.Test.Host Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,19 @@ protected async Task HandleConfigurationDoneRequest(
122122 {
123123 if ( ! string . IsNullOrEmpty ( this . scriptPathToLaunch ) )
124124 {
125- // Configuration is done, launch the script
126- var nonAwaitedTask =
127- this . LaunchScript ( requestContext )
128- . ConfigureAwait ( false ) ;
125+ if ( this . editorSession . PowerShellContext . SessionState == PowerShellContextState . Ready )
126+ {
127+ // Configuration is done, launch the script
128+ var nonAwaitedTask =
129+ this . LaunchScript ( requestContext )
130+ . ConfigureAwait ( false ) ;
131+ }
132+ else
133+ {
134+ Logger . Write (
135+ LogLevel . Verbose ,
136+ "configurationDone request called after script was already launched, skipping it." ) ;
137+ }
129138 }
130139
131140 await requestContext . SendResult ( null ) ;
Original file line number Diff line number Diff line change @@ -122,7 +122,6 @@ public async Task DebugAdapterReceivesOutputEvents()
122122 private async Task LaunchScript ( string scriptPath )
123123 {
124124 await this . debugAdapterClient . LaunchScript ( scriptPath ) ;
125- await this . SendRequest ( ConfigurationDoneRequest . Type , null ) ;
126125 }
127126 }
128127}
You can’t perform that action at this time.
0 commit comments