Skip to content

[feature request] extend "Rust Analyzer: Run" to include test-mod when _outside_ mod tests #9589

@japaric

Description

@japaric

Current behavior:

// A

pub fn api() { /* .. */ }

fn helper() { /* .. */ }

#[cfg(test)]
mod tests {
    // B
    use super::*;

    #[test]
    fn api_works() { /* .. */ }
    // even more tests
}

invoking "Rust Analyzer: Run" from scope B includes a test-mod option to run the unit tests in mod tests
invoking "Rust Analyzer: Run" from scope A does not include a test-mod option to run the unit tests in mod tests

Desired behavior: I would like the test-mod option to be available when invoking "Rust Analyzer: Run" from scope A.

Use case: you may in the middle of editing helper and want to run tests that exercise api, which calls helper. "Peek/run related tests" won't get you there. This extension would help with that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-featureCategory: feature requestS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions