swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
709 stars 47 forks source link

Use hierarchical `workspace/tests` LSP request to get Test list #761

Closed adam-fowler closed 2 months ago

adam-fowler commented 2 months ago

There is code is place to read the original flat representation format of workspace/tests but this has now been replaced by a hierarchical view that is closer in format to how tests are represented in VSCode.

The request should be called from TestExplorer. discoverTestsInWorkspace https://github.com/swift-server/vscode-swift/blob/dfba3243e6cb97faa45037d11478e2714d4d5e17/src/TestExplorer/TestExplorer.ts#L170-L180. This is called at initialisation and after every compile, where a test file has been changed. Currently the LSP request call is commented out.

LSPTestDiscovery.getWorkspaceTests returns an intermediary format. You can probably avoid this and merge the response directly into the test list. Anyway the intermediary format is too restrictive for swift-testing.

plemarquand commented 2 months ago

I can take a look at this.

plemarquand commented 2 months ago

Closed by #767