cargo-mode icon indicating copy to clipboard operation
cargo-mode copied to clipboard

Use fully qualified module name when running cargo-mode-test-current-buffer

Open sunng87 opened this issue 1 year ago • 2 comments

In my situation, I have a test module in my module

// abc.rs

#[cfg(test)]
mod tests {

  ...
}

If I call cargo-mde-test-current-buffer with cursor inside tests module, the generated command is cargo test tests, instead of cargo test abc or cargo test abc::tests

sunng87 avatar Dec 03 '24 07:12 sunng87

@sunng87 hello. sorry for a late reply. I think it shouldn't be hard to implement this feature. since we already have cargo-mode--current-mod function which returns the current module

ayrat555 avatar Jan 06 '25 07:01 ayrat555

I think the problem is cargo-mode--current-mode function always returns tests for these test module, and returns nil when the cursor is in a normal code module.

sunng87 avatar Jan 06 '25 08:01 sunng87