vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

swift-testing: If LSP is disabled, swift-testing tests do not work

Open adam-fowler opened this issue 1 year ago • 2 comments

It appears swift-testing tests are not flagged as swift-testing until they are found via the workspace/tests or textDocument/tests LSP requests. We need another way to catch this. While disabling SourceKit-LSP is a special situation, it could occur in situations where LSP is particularly slow in large projects.

adam-fowler avatar Jun 13 '24 13:06 adam-fowler

Swift-testing is more complex than XCTests so Paul said he would be hesitant to parse this. Some ideas:

  1. Update setting description, warning if they disable sourcekit-lsp, they lose this functionality
  2. Update warning notification message that shows up to kill the LSP
  3. Provide warning in testing view (if we can still show XCTests at same time)

award999 avatar Jun 13 '24 14:06 award999

I can take a look at this. Agree that there should at least be some indication that things won't work as expected if sourcekit-lsp is disabled. Thinking of using a combination of the options mentioned by @award999 above.

For the setting description, perhaps a message like:

Disabling SourceKit-LSP will turn off features like code completion, error diagnostics and jump-to-definition. Certain features like swift-testing tests may not work correctly.

And something similar for the message that comes up to turn off the language server.

You have disabled the Swift language server (SourceKit-LSP), but it is still running. Would you like to stop it now? This will turn off code completion, error diagnostics and jump-to-definition. Certain features like swift-testing tests may not work correctly.

And a warning in the testing view along the lines of:

The Swift language server (SourceKit-LSP) is disabled, swift-testing tests may not be detected correctly.

rbenegal avatar Jan 10 '25 14:01 rbenegal

Looks like the extra warnings are done, marking as Done

award999 avatar Aug 19 '25 17:08 award999