You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is our factory entrypoint hook to when a debug session starts, and where we will lazy initialize everything needed to do the debugging such as a temporary console if required
// NOTE: Dotnet attach debugging is only currently supported if a temporary console is used, otherwise we get lots of lock conflicts from loading the assemblies
voidthis.logger.writeAndShowError("You specified attachDotnetDebugger in your PowerShell Launch configuration but the C# extension is not installed. Please install the C# extension and try again.");
136
+
returnundefined;
137
+
}
138
+
139
+
// Will wait until the process is started and available before attaching
140
+
constpid=awaitthis.tempDebugProcess.getPid();
141
+
if(pid===undefined){
142
+
voidthis.logger.writeAndShowError("Attach Dotnet Debugger was specified but the PowerShell temporary debug session failed to start. This is probably a bug.");
voidthis.logger.writeAndShowError(`You specified dotnetDebuggerConfigName in your PowerShell Launch configuration but a matching launch config was not found. Please ensure you have a coreclr attach config with the name ${session.configuration.dotnetDebuggerConfigName} in your launch.json file or remove dotnetDebuggerConfigName from your PowerShell Launch configuration to use the defaults`);
149
+
returnundefined;
150
+
}
151
+
152
+
// Start a child debug session to attach the dotnet debugger
153
+
// TODO: Accomodate multi-folder workspaces if the C# code is in a different workspace folder
this.logger.writeAndShowError("You specified attachDotnetDebugger in your PowerShell Launch configuration but the C# extension is not installed. Please install the C# extension and try again.");
186
-
returnundefined;
187
-
}
188
-
189
-
// Will wait until the process is started and available before attaching
this.logger.writeAndShowError(`You specified dotnetDebuggerConfigName in your PowerShell Launch configuration but a matching launch config was not found. Please ensure you have a coreclr attach config with the name ${config.dotnetDebuggerConfigName} in your launch.json file or remove dotnetDebuggerConfigName from your PowerShell Launch configuration to use the defaults`);
203
-
204
-
// Fail the debug session by returning undefined
205
-
returnundefined;
206
-
}
207
-
returnconfigMatch;
208
-
}
209
-
210
-
// Start a secondary debug session to attach the dotnet debugger
211
-
// TODO: Accomodate multi-folder workspaces if the C# code is in a different workspace folder
212
-
awaitvscode.debug.startDebugging(undefined,{
213
-
name: "Dotnet Debugger: PSIC Temporary Console",
214
-
type: "coreclr",
215
-
request: "attach",
216
-
processId: pid
217
-
});
218
-
this.logger.write(`Attached dotnet debugger to process ${pid}`);
219
-
}
220
-
}
221
-
222
227
if(!config.request){
223
228
// No launch.json, create the default configuration for both unsaved
224
229
// (Untitled) and saved documents.
@@ -227,9 +232,15 @@ export class DebugSessionFeature extends LanguageClientConsumer
0 commit comments