Add location information to TestItems to enable jump to code
It would be good to jump to the source code for a test when you double click on the test in the test explorer (In a similar manner to Xcode).
This requires we get more information about tests. Currently we are getting test list via swift test --list-tests which only gives you the list of tests and no more information. There is a possibility we could get test information from sourcekit-lsp along with extra information like the file they are in and where in that file they are.
We have this enabled once a file has been opened, unfortunately cannot get it working for all files at startup.
This adds an additional button for jumping to test source, instead of enabling double clicking. This is the standard in vscode
Would be good if SwiftPM was able to provide the location data in swift test --list-tests.
Question on forums: https://forums.swift.org/t/listing-tests-with-extended-information/56567
Looks like we are going to look at a SourceKit-LSP solution for this.
Shall we wait for https://github.com/apple/swift-package-manager/issues/5601 to be implemented?
Actually, this is most likely going to done via a custom LSP request. I just haven't got around to chasing it up.
SourceKit-LSP issue added https://github.com/apple/sourcekit-lsp/issues/611
SourceKit-LSP request workspace/tests is available in Swift 6
Code using it in VSCode can be found in #701