refactor(lsp): store test definitions in adjacency list #20330
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously:
Now:
Storing the test tree as a literal tree diminishes the value of IDs, even though vscode stores them that way. This makes all data easily accessible from
TestModule
. It unifies the interface between 'discovered' and 'injected' tests. This unblocks some enhancements wrt syncing tests between the LSP and extension, such as this TODO: https://github.com/denoland/vscode_deno/blob/61f08d5a71536a0a5f7dce965955b09e6bd957e1/client/src/testing.ts#L251-L259 and denoland/vscode_deno#900. We should also get more flexibility overall.TestCollector
is cleaned up, now stores a&mut TestModule
directly and registers tests as it comes across them withTestModule::register()
. This method ensures sanity in the redundant data from having both ofTestDefinition::{parent_id,step_ids}
.All of the messy conversions between
TestDescription
,LspTestDescription
,TestDefinition
,TestData
andTestIdentifier
are cleaned up. They shouldn't have been usingimpl From
and now the full list of tests is available to their implementations.