Closed tristanlabelle closed 6 months ago
Would it not be preferable to recognise when we have a CMake project and disable it at that point.
Recognizing a CMake project could be useful, but I think we still need this escape hatch. For example, our project uses SPM on macOS and CMake on Windows, so the extension's heuristic for behavior could be incorrect. And what if we had a Bazel project?
I think this is a more general problem where the Swift extension provides functionality orthogonal(ish) areas, and projects should be able to turn them off piecemeal if they do not apply (in our case, because the functionality is provided by a different extension):
Do you still need to disable the test explorer after this? ie you have a SwiftPM project with test targets which you don't want the test explorer for.
@adam-fowler This is a good change but we still need the ability to configure the Swift extension to disable the test explorer, and actually to disable all SPM-related logic. Our project has both CMake build definitions (used on Windows) and SPM build definitions (used on macOS). When working on Windows, no SPM-specific functionality should be enabled.
It sounds like you want a prefer CMake over SwiftPM toggle.
It sounds like you want a prefer CMake over SwiftPM toggle.
Or maybe a disable SwiftPM integration flag.
Or maybe a disable SwiftPM integration flag.
That sounds right!
I updated the issue title and description accordingly.
Is your feature request related to a problem? Please describe. The Swift extension attempts to integrates SPM builds and discovers tests for the test explorer even in a repo that uses CMake (which the Swift extension doesn't know how to discover tests for). This results in a visible error in the test explorer:
The repo in question has both SPM and CMake build definitions. SPM is used for macOS and CMake for Windows, so there isn't an easy way for the extension to figure out automatically which one it should prefer.
Describe the solution you'd like A new
swift.spmIntegration
boolean setting that can be set to false (for example in a repo'ssettings.json
) to completely disable all SPM-related features of the Swift extension (build and testing).Describe alternatives you've considered We can ignore the error.
Additional context May be related to https://github.com/swift-server/vscode-swift/pull/638