fix: correctly identify the target inside packages and match output #18956
+161
−40
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.
This is a PR to fix most of #18955
The two main changes:
update
request::handle_run_test
andtest_runner
to identify the target inside a package that matches a test request. This fixes RA failing to find the right package because the test uses the target name.extend
CargoActor
to take a parser object rather than just a generic type with static parsing functions. This allows context about the invocation of cargo to be used when interpreting the cargo output so it can be properly integrated with the GUI.In this case, it's information about the test that has been run which isn't contained in cargo output. The current behaviour is very flaky so that if you have tests with the same name in multiple crates or targets, the results are often assigned to the wrong target.
The
StatelessParser
wrapper ensures existing static parsers can be used without any changes.