Some users were seeing the extension fail to activate due to lldb-dap not being found in the toolchain. I've tracked this down to three underlying issues with the extension:
The DebugAdapter.verifyDebugAdapterExists() function was awaited on extension startup
The SwiftToolchain.getLLDB() and SwiftToolchain.getLLDBDebugAdapter() functions can throw errors when the executables are not found. This was not being caught properly by DebugAdapter.verifyDebugAdapterExists().
There are inconsistencies between DebugAdapter.adapterName and DebugAdapter.getAdapterType() that can cause them to return different debug adapters under certain circumstances.
The DebugAdapter.verifyDebugAdapterExists() will now catch errors thrown by the SwiftToolchain when finding executables and the extension activation now properly runs this check in the background. I've also updated the docstrings for getLLDB() and getLLDBDebugAdapter() to make it more obvious that they can throw and added some tests in the hopes that this won't happen again.
I've replaced the DebugAdapter.adapterName property and DebugAdapter.getAdapterType() function with a single DebugAdapter.getLaunchConfigType() function. This will hopefully reduce any further issues with adapter mismatches from happening in the future.
I've added mock-fs as a dependency now since these new tests rely on a lot of file system checks and it's easier to mock the fs module this way. The documentation for writing tests has been updated to reflect this.
Some users were seeing the extension fail to activate due to
lldb-dap
not being found in the toolchain. I've tracked this down to three underlying issues with the extension:DebugAdapter.verifyDebugAdapterExists()
function was awaited on extension startupSwiftToolchain.getLLDB()
andSwiftToolchain.getLLDBDebugAdapter()
functions can throw errors when the executables are not found. This was not being caught properly byDebugAdapter.verifyDebugAdapterExists()
.DebugAdapter.adapterName
andDebugAdapter.getAdapterType()
that can cause them to return different debug adapters under certain circumstances.The
DebugAdapter.verifyDebugAdapterExists()
will now catch errors thrown by the SwiftToolchain when finding executables and the extension activation now properly runs this check in the background. I've also updated the docstrings forgetLLDB()
andgetLLDBDebugAdapter()
to make it more obvious that they can throw and added some tests in the hopes that this won't happen again.I've replaced the
DebugAdapter.adapterName
property andDebugAdapter.getAdapterType()
function with a singleDebugAdapter.getLaunchConfigType()
function. This will hopefully reduce any further issues with adapter mismatches from happening in the future.I've added
mock-fs
as a dependency now since these new tests rely on a lot of file system checks and it's easier to mock thefs
module this way. The documentation for writing tests has been updated to reflect this.Related issues: #1069 #1077