@@ -20,7 +20,6 @@ public class DebugAdapter : DebugAdapterBase
20
20
{
21
21
private EditorSession editorSession ;
22
22
private OutputDebouncer outputDebouncer ;
23
- private object syncLock = new object ( ) ;
24
23
private bool isConfigurationDoneRequestComplete ;
25
24
private bool isLaunchRequestComplete ;
26
25
private string scriptPathToLaunch ;
@@ -105,16 +104,6 @@ protected async Task HandleConfigurationDoneRequest(
105
104
object args ,
106
105
RequestContext < object > requestContext )
107
106
{
108
- // Ensure that only the second message between launch and
109
- // configurationDone requests, actually launches the script.
110
- lock ( syncLock )
111
- {
112
- if ( ! this . isLaunchRequestComplete )
113
- {
114
- this . isConfigurationDoneRequestComplete = true ;
115
- }
116
- }
117
-
118
107
// The order of debug protocol messages apparently isn't as guaranteed as we might like.
119
108
// Need to be able to handle the case where we get the configurationDone request after the
120
109
// launch request.
@@ -123,6 +112,8 @@ protected async Task HandleConfigurationDoneRequest(
123
112
this . LaunchScript ( requestContext ) ;
124
113
}
125
114
115
+ this . isConfigurationDoneRequestComplete = true ;
116
+
126
117
await requestContext . SendResult ( null ) ;
127
118
}
128
119
@@ -167,16 +158,6 @@ protected async Task HandleLaunchRequest(
167
158
this . scriptPathToLaunch = launchParams . Program ;
168
159
this . arguments = arguments ;
169
160
170
- // Ensure that only the second message between launch and
171
- // configurationDone requests, actually launches the script.
172
- lock ( syncLock )
173
- {
174
- if ( ! this . isConfigurationDoneRequestComplete )
175
- {
176
- this . isLaunchRequestComplete = true ;
177
- }
178
- }
179
-
180
161
// The order of debug protocol messages apparently isn't as guaranteed as we might like.
181
162
// Need to be able to handle the case where we get the launch request after the
182
163
// configurationDone request.
@@ -185,6 +166,8 @@ protected async Task HandleLaunchRequest(
185
166
this . LaunchScript ( requestContext ) ;
186
167
}
187
168
169
+ this . isLaunchRequestComplete = true ;
170
+
188
171
await requestContext . SendResult ( null ) ;
189
172
}
190
173
0 commit comments