Skip to content

Commit 61cfb71

Browse files
committed
Revert using universal debug adapter name.
The CodeLLDB extension expects the debug adapter to be called `lldb`. If we are using it and we don't call `registerDebugAdapterTrackerFactory` with `lldb` as the adapter name then we fail to get logs in the debugSessionCallback when running tests. This prevents XCTests results from being parsed, and hides the swift-testing outout. Revert a portion of swiftlang#1024 that always set the debug adapter name to `swift-lldb` and use `lldb` when we're using CodeLLDB as the debug adapter. Issue swiftlang#1100
1 parent 83fdec0 commit 61cfb71

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/debugger/debugAdapter.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ import { SwiftToolchain } from "../toolchain/toolchain";
2424
* Class managing which debug adapter we are using. Will only setup lldb-vscode/lldb-dap if it is available.
2525
*/
2626
export class DebugAdapter {
27+
private static debugAdapaterExists = false;
28+
2729
/** Debug adapter name */
2830
public static get adapterName(): string {
29-
return "swift-lldb";
31+
return configuration.debugger.useDebugAdapterFromToolchain && this.debugAdapaterExists
32+
? "swift-lldb"
33+
: "lldb";
3034
}
3135

3236
/** Return debug adapter for toolchain */
@@ -74,10 +78,12 @@ export class DebugAdapter {
7478
);
7579
}
7680
workspace.outputChannel.log(`Failed to find ${lldbDebugAdapterPath}`);
81+
this.debugAdapaterExists = false;
7782
contextKeys.lldbVSCodeAvailable = false;
7883
return false;
7984
}
8085

86+
this.debugAdapaterExists = true;
8187
contextKeys.lldbVSCodeAvailable = true;
8288
return true;
8389
}

0 commit comments

Comments
 (0)