swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
713 stars 47 forks source link

The extension doesn't find the `lldb-dap.exe` DAP in the toolchain (its new name) #737

Closed tristanlabelle closed 3 months ago

tristanlabelle commented 3 months ago

Describe the bug The debug adapter is not found in more recent toolchains because the DAP executable has been renamed.

https://github.com/swift-server/vscode-swift/blob/05aec075052dc007164bd6b012c1ab2931a9a324/src/debugger/debugAdapter.ts#L47

To Reproduce Steps to reproduce the behavior:

  1. Install a main branch Swift toolchain from the past few months
  2. Set "swift.debugger.useDebugAdapterFromToolchain": true,
  3. Unset "swift.debugger.path"
  4. Start debugging a test
  5. Notice that codelldb is silently used as the debugger

Expected behavior The extension should support both names, favoring lldb-dap.exe when present.

Environment

adam-fowler commented 3 months ago

As I remember @compnerd was going to fix this but I can do this. What are your thoughts on using lldb-dap.exe for swift version >= 6? I know that will mean earlier Swift 6 nightlies will fail, but I don't really want to have to base the decision on whether swift-dap.exe or swift-vscode.exe exists.

tristanlabelle commented 3 months ago

My take is that testing for features is generally preferable to testing for version numbers because it makes the dependency more obvious. We can also pick this up, let me know. (fyi @z2oh)

adam-fowler commented 3 months ago

This is now released in v1.9