Skip to content

Support VS Code testing API #9798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matklad opened this issue Aug 6, 2021 · 1 comment
Closed

Support VS Code testing API #9798

matklad opened this issue Aug 6, 2021 · 1 comment
Labels
A-vscode vscode plugin issues S-actionable Someone could pick this issue up and work on it right now

Comments

@matklad
Copy link
Member

matklad commented Aug 6, 2021

https://code.visualstudio.com/api/extension-guides/testing

We might want to support that.

The way I understand it, what VS Code wants is a global view of a hierarchy of all the tests in a project. There are two potential sources for such view:

  • statically discovered tests (eg, re-run cargo test -- --list on every change, or use symbol index to list every #[test] function)
  • external sources -- display a result of a test run

I don't think we can support the first case correctly: in the limit, it is a global view of all the tests, and to maintain that we'd have to do O(N) work on every change worst-case. Displaying a hierarchy of tests also feels like it duplicates other navigation functionality.

So I think we should do the following:

  • on the server side, provide the API to fetch project model, such that the vscode can draw one node per cargo package/target
  • on the client side, change our test runners to optionally pass in the --message-format json flag, and to populate nodes bellow cargo target with test results.
@matklad matklad added S-actionable Someone could pick this issue up and work on it right now A-vscode vscode plugin issues labels Aug 6, 2021
@matklad
Copy link
Member Author

matklad commented Aug 6, 2021

better to track this in #3601

@matklad matklad closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

1 participant