rust-analyzer/crates
Dorian Scheidt 85b9568e2d feat: Run test mod from anywhere in parent file
The "Run" feature of rust-analyzer is super useful, especially for running
individual tests or test-modules during development.

One common pattern in rust development is to develop tests in the same file as
production code, inside a module (usually called `test` or `tests`) marked with
`#[cfg(test)]`.  Unforunately, this pattern is not well supported by r-a today,
as a test module won't show up as a runnable unless the cursor is inside it.

In my experience, it is quite common to want to run the tests associated with
some production code immediately after editing it, not only after editing the
tests themselves. As such it would be better if test modules were available
from the "Run" menu even when the cursor is outside the test module.

This change updates the filtration logic for runnables in
`handlers::handle_runnables` to special case `RunnableKind::TestMod`, making
test modules available regardless of the cursor location. Other `RunnableKind`s
are unnaffected.

Fixes #9589
2022-08-17 12:26:07 -05:00
..
base-db remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
cfg Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
flycheck Auto merge of #12808 - Veykril:check-workspace, r=Veykril 2022-08-04 12:57:04 +00:00
hir Add an HIR pretty-printer 2022-08-15 13:51:45 +02:00
hir-def Auto merge of #13027 - jonas-schievink:fix-mismatch-with-trailing-empty-macro, r=jonas-schievink 2022-08-15 16:06:59 +00:00
hir-expand Simplify 2022-08-15 16:40:10 +02:00
hir-ty Fix lowering of empty macro expressions in trailing position 2022-08-15 18:01:58 +02:00
ide Add a setting for keyword hover popups 2022-08-16 16:51:40 +02:00
ide-assists Fixes tests 2022-08-10 16:29:23 +08:00
ide-completion fix: format literal lookup 2022-08-16 01:24:21 +09:00
ide-db remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
ide-diagnostics Fix panic in no_such_field when using tuple fields on record structs 2022-08-11 10:41:30 +02:00
ide-ssr Fix r-a spelling in some places 2022-08-01 13:47:09 +02:00
limit Properly cfg the max field of Limit 2022-07-31 19:27:20 +02:00
mbe Improve insert whitespace in mbe 2022-08-10 16:28:56 +08:00
parser Recover from missing ellipsis in record literals for path expressions 2022-08-09 18:23:25 +02:00
paths Auto merge of #12808 - Veykril:check-workspace, r=Veykril 2022-08-04 12:57:04 +00:00
proc-macro-api remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
proc-macro-srv Auto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril 2022-08-10 14:53:21 +00:00
proc-macro-srv-cli Gate and rename binary, use it if it's in the sysroot 2022-07-25 16:22:39 +02:00
proc-macro-test revert nightly rustfmt formatting that accidentally slipped in 2022-07-25 14:18:30 +02:00
profile Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
project-model Re-try build script building with --keep-going 2022-08-10 10:23:46 +02:00
rust-analyzer feat: Run test mod from anywhere in parent file 2022-08-17 12:26:07 -05:00
sourcegen run stable fmt through rustup 2022-08-06 17:25:02 +03:00
stdx Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
syntax remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
test-utils Don't run slow tests in Rust CI, only RA CI 2022-07-24 10:38:19 +02:00
text-edit Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
toolchain Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
tt Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
vfs Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
vfs-notify Don't switch workspace on vfs file changes from libraries 2022-08-05 12:06:42 +02:00