Produces the argument passed to vscode.debug.startDebugging() — either a launch.json configuration name or a minimal DebugConfiguration stub.
Earlier versions of this class manually parsed launch.json, scored configurations, and assembled fully populated per-language config objects. That duplicated work VS Code and the language debug extensions already do better:
- VS Code resolves launch.json configurations by name when you pass a string to
startDebugging. - Language extensions (Python, JS/TS, Java, .NET, Go, …) each register a
DebugConfigurationProviderwhoseresolveDebugConfigurationhook fills incwd,console,env,stopOnEntry, and other sensible defaults for a minimal stub.
Delegating to those mechanisms keeps this class small and ensures defaults stay aligned with whatever the installed language extensions consider current.
- Return a launch.json configuration name when the caller provides one — VS Code looks it up itself.
- Otherwise, return a minimal launch stub (
type,request,name,program) for the file's language and let the language extension resolve the rest. - For
.NET(coreclr), locate the project's built DLL sinceprogramcannot be a.cssource file. - Detect the debugger
typefrom a file extension.
Test debugging is not handled here. It is routed through DebuggingExecutor.debugTestAtCursor, which uses VS Code's built-in testing.debugAtCursor command to dispatch to whichever TestController owns the test under the cursor. That path supports any language whose extension registers a Test Explorer integration and correctly handles parent/child process attach (e.g. dotnet test's testhost).
getDebugConfig() returns string | vscode.DebugConfiguration. Both forms are accepted by vscode.debug.startDebugging(folder, nameOrConfiguration).
Maps file extensions to debugger type values:
.py→python.js/.ts/.jsx/.tsx→pwa-node.java→java.cs/.csproj→coreclr.cpp/.cc/.c→cppdbg.go→go.rs→lldb.php→php.rb→ruby
Test launches are dispatched via DebuggingExecutor.debugTestAtCursor, not via this class. Any language with a registered TestController is supported (Python unittest/pytest, Jest, Mocha, JUnit, C# Dev Kit, Go, Rust, ...).
- If
configurationNameis provided and is not the sentinelDefault Configuration, return that name verbatim. - Otherwise, if the file is C# (
coreclr), walk up to find the.csproj, locate its built DLL underbin/{Debug,Release}/<tfm>/, and return a coreclr config pointing at that assembly. - Otherwise, return
{ type, request: 'launch', name: 'DebugMCP Launch', program: fileFullPath }.
- Class definition:
src/utils/debugConfigurationManager.ts - Interface:
IDebugConfigurationManager - .NET assembly lookup:
findNearestCsproj(),findBuiltAssembly(),createDotNetLaunchConfig() - Language detection:
detectLanguageFromFilePath() - Test launches: see
DebuggingExecutor.debugTestAtCursorinsrc/debuggingExecutor.ts
Python test name handling now lives in the Python extension's TestController; we no longer format module.ClassName.test_method ourselves.