@plemarquand @adam-fowler
I installed the new VSCode Swift extension and restarted it. I think we're making progress but it's still not working. When I right click in the gutter for an XCTestCase class and chose to debug it, a Windows dialog opens that says unknown error and offers to open launch.json (which didn't previously exist but it will create one if I say to open it).
This shows up in the Debug Console:
Console is in 'commands' mode, prefix expressions with '?'.
Launching: c:\Users\roger\Desktop\Version3\.build\debug\Version3PackageTests.xctest Version3Tests.Version3Tests
If I go to the Output Console and choose Swift in the right filter, this is what appears:
08:31:10: Exec Task: swift build --build-tests -Xlinker -debug:dwarf -Xswiftc -diagnostic-style=llvm
08:31:13: Version3: XCTest Debug Config: {"type":"lldb","request":"launch","sourceLanguages":["swift"],"name":"XCTest: Test Version3","cwd":"c:\\Users\\roger\\Desktop\\Version3","args":["Version3Tests.Version3Tests"],"preLaunchTask":null,"terminal":"console","program":"c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest","env":{},"testType":"XCTest"}
08:31:17: Error: "Debugger not started"
If I change the filter for the Output console to LLDB, this is what appears:
Initial debug configuration: {
type: 'lldb',
request: 'launch',
sourceLanguages: [ 'swift' ],
name: 'XCTest: Test Version3',
cwd: 'c:\\Users\\roger\\Desktop\\Version3',
args: [ 'Version3Tests.Version3Tests' ],
preLaunchTask: null,
terminal: 'console',
program: 'c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest',
env: {},
testType: 'XCTest'
}
Resolved debug configuration: {
type: 'lldb',
request: 'launch',
sourceLanguages: [ 'swift' ],
name: 'XCTest: Test Version3',
cwd: 'c:\\Users\\roger\\Desktop\\Version3',
args: [ 'Version3Tests.Version3Tests' ],
preLaunchTask: null,
terminal: 'console',
program: 'c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest',
env: {},
testType: 'XCTest',
expressions: 'native',
relativePathBase: 'c:\\Users\\roger\\Desktop\\Version3',
_adapterSettings: {
displayFormat: 'auto',
showDisassembly: 'auto',
dereferencePointers: true,
suppressMissingSourceFiles: true,
evaluationTimeout: 5,
consoleMode: 'commands',
sourceLanguages: null,
terminalPromptClear: null,
evaluateForHovers: true,
commandCompletions: true,
reproducer: false
}
}
[ERROR codelldb::debug_session] unknown error
[ERROR codelldb::debug_session] Internal debugger error: error: process 0 in state = exited, but cannot detach it in this state.
==== LLDB swift-healthcheck log. ===
This file contains the configuration of LLDB's embedded Swift compiler to help diagnosing module import and search path issues. The swift-healthcheck command is meant to be run *after* an error has occurred.
lldb version 17.0.6
Swift version 6.0-dev (LLVM 3602748d4ec9947, Swift 09b8b0861a69528)
Debug adapter exit code=0 (0x0), signal=null.
The Version3Tests.swift file is just:
import XCTest
@testable import Version3
final class Version3Tests: XCTestCase {
func testSqr() {
let x = 3.0
let y = sqr(x)
XCTAssertEqual(y, 9.0)
}
}
And the Verstion3.swift file contains:
func sqr(_ x: Double) -> Double {
x * x
}
All the other files in the directory are just the result of swift package init
(no other files were modified).
Any other thoughts on what is wrong? Again, I'm happy to run any other diagnostics if you explain what you want me to do.
Thanks,
Dave