Skip to content

Use lldb-dap by default when using Swift 6 #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
plemarquand opened this issue Aug 16, 2024 · 7 comments
Closed

Use lldb-dap by default when using Swift 6 #1013

plemarquand opened this issue Aug 16, 2024 · 7 comments
Labels
debugging enhancement New feature or request

Comments

@plemarquand
Copy link
Contributor

plemarquand commented Aug 16, 2024

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 (swift.debugger.useDebugAdapterFromToolchain). 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.

@dschaefer2
Copy link
Member

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.

@matthewbastien
Copy link
Member

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

@dschaefer2
Copy link
Member

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

@felixf4xu
Copy link

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.

@plemarquand
Copy link
Contributor Author

@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.

@award999 award999 moved this from Backlog to Todo in Swift Extension for Visual Studio Code Jan 16, 2025
@matthewbastien matthewbastien added the needs verification Issue has been fixed, but requires verification before closing label Feb 27, 2025
@matthewbastien matthewbastien moved this from Todo to Needs Verification in Swift Extension for Visual Studio Code Feb 27, 2025
@matthewbastien
Copy link
Member

Fixed by #1406

@plemarquand
Copy link
Contributor Author

Verified with cef4e6c

@plemarquand plemarquand removed the needs verification Issue has been fixed, but requires verification before closing label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugging enhancement New feature or request
Projects
Development

No branches or pull requests

5 participants