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(
122
122
{
123
123
if ( ! string . IsNullOrEmpty ( this . scriptPathToLaunch ) )
124
124
{
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
+ }
129
138
}
130
139
131
140
await requestContext . SendResult ( null ) ;
Original file line number Diff line number Diff line change @@ -122,7 +122,6 @@ public async Task DebugAdapterReceivesOutputEvents()
122
122
private async Task LaunchScript ( string scriptPath )
123
123
{
124
124
await this . debugAdapterClient . LaunchScript ( scriptPath ) ;
125
- await this . SendRequest ( ConfigurationDoneRequest . Type , null ) ;
126
125
}
127
126
}
128
127
}
You can’t perform that action at this time.
0 commit comments