vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Use lldb-dap by default when using Swift 6

Open plemarquand opened this issue 1 year ago • 3 comments

Currently vscode-swift uses the CodeLLDB extension to facilitate debugging with all swift versions. In Swift 6 lldb-dap started shipping in the toolchain. lldb-dap can be used as a replacement, removing the need to use a separate extension to debug.

There is currently a setting to start using lldb-dap available in the settings. I propose we use lldb-dap by default if the user is using Swift 6, deprecate the existing setting, and add a new one to explicitly enable using CodeLLDB in Swift 6 if users want the current behaviour.

If the user is using a Swift 5.x version the setting would have no effect. Ideally we could hide it if the user is using Swift 5.x but I dont know of a VS Code API to dynamically hide settings.

plemarquand avatar Aug 16 '24 14:08 plemarquand

The defaults for these settings should just do the right thing: use lldb-dap if they have it or else rely on CodeLLDB.

Also note that CodeLLDB doesn't support Windows ARM so you have to use lldb-dap there.

dschaefer2 avatar Aug 16 '24 14:08 dschaefer2

This is going to have to wait until lldb-dap is close to feature parity with CodeLLDB.

matthewbastien avatar Sep 13 '24 18:09 matthewbastien

Yes, boo, but I get it. Need to get there first.

dschaefer2 avatar Sep 13 '24 20:09 dschaefer2

There is currently a setting to start using lldb-dap available in the settings

I would like to know which setting in vscode-swift we can set to enable lldb-dap?

I managed to use lldb-dap once, but in that case, I need to install another vscode addon named LLDB DAP from llvm.org, then changed the setting of the lldb-dap addon to point to swift's lldb-dap.exe. I also need to use "type": "lldb-dap" in launch.json. But in the whole process, it's like vscode -> lldb dap addon -> swift's lldb-dap, vscode-swift addon is not involved at all.

felixf4xu avatar Nov 11 '24 10:11 felixf4xu

@felixf4xu Its not the most clearly named, but its the VS Code setting "swift.debugger.useDebugAdapterFromToolchain": true.

With that setting you shouldn't need the CodeLLDB or LLDB DAP extensions to debug swift code; the extension will use the lldb-dap included in the Swift toolchain.

plemarquand avatar Nov 11 '24 13:11 plemarquand

Fixed by #1406

matthewbastien avatar Feb 27 '25 20:02 matthewbastien

Verified with cef4e6cae786dacd1d10a98a6062a50bf96ab112

plemarquand avatar Mar 26 '25 15:03 plemarquand