rust-analyzer/crates
bors fd276218ec Auto merge of #14549 - lowr:patch/no-unstable-item-compl-on-stable, r=Veykril
Don't suggest unstable items on stable toolchain

Closes #3020

This PR implements stability check in `ide-completion` so that unstable items are only suggested if you're on nightly toolchain.

It's a bit unfortunate `CompletionContext::check_stability()` is spammed all over the crate, but we should call it before building `CompletionItem` as you cannot get attributes on the item it's completing from that struct. I looked up every callsite of `Builder::add_to()`, `Completions::add[_opt]()`, and`Completions::add_all()` and inserted the check wherever necessary.

The tests are admittedly incomplete in that I didn't add tests for every kind of item as I thought that would be too big and not worthwhile. I copy-pasted some existing basic tests in every test module and adjusted them.
2023-04-11 14:34:47 +00:00
..
base-db Add toolchain meta for tests 2023-04-11 21:21:10 +09:00
cfg ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
flycheck Bump Cargo.lock 2023-03-25 15:12:39 +01:00
hir Compute closure captures 2023-04-10 23:04:34 +03:30
hir-def completion: check stability 2023-04-11 21:21:13 +09:00
hir-expand Add bounds for associated types in derive macro 2023-04-07 19:33:14 +03:30
hir-ty fix inference in nested closure 2023-04-11 17:02:00 +03:30
ide Add toolchain meta for tests 2023-04-11 21:21:10 +09:00
ide-assists Auto merge of #14547 - Veykril:extract_adjust, r=Veykril 2023-04-11 12:01:47 +00:00
ide-completion Add tests for stability check in completion 2023-04-11 21:21:15 +09:00
ide-db Auto merge of #14442 - DropDemBits:structured-snippet-api, r=Veykril 2023-04-05 14:33:30 +00:00
ide-diagnostics Compute closure captures 2023-04-10 23:04:34 +03:30
ide-ssr ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
intern ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
limit ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
mbe ⬆️ rust-analyzer 2023-02-20 10:14:12 +02:00
parser feat(syntax): RTN in bounds 2023-04-01 15:26:03 +02:00
paths Canonicalize rust-project.json manifest path 2023-03-27 21:55:02 +02:00
proc-macro-api Remove client side proc-macro version check 2023-03-25 15:43:58 +01:00
proc-macro-srv Thread global symbol interner through as if it was a local 2023-03-29 11:42:08 +02:00
proc-macro-srv-cli Drop support for non-syroot proc macro ABIs 2023-03-29 10:57:32 +02:00
proc-macro-test ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
profile Bump Cargo.lock 2023-03-25 15:12:39 +01:00
project-model fix: Fix receiver adjustments for extract_variable assist 2023-04-11 14:01:23 +02:00
rust-analyzer Add toolchain meta for tests 2023-04-11 21:21:10 +09:00
sourcegen Use retain_mut in CommentBlock::extract 2023-03-31 17:41:40 -04:00
stdx ⬆️ rust-analyzer 2023-02-20 10:14:12 +02:00
syntax feat(syntax): RTN in bounds 2023-04-01 15:26:03 +02:00
test-utils Add toolchain meta for tests 2023-04-11 21:21:10 +09:00
text-edit internal: Coalesce adjacent Indels 2023-03-21 11:48:32 -04:00
toolchain ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
tt ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
vfs internal: Refine CrateOrigin variants 2023-03-31 10:36:13 +02:00
vfs-notify ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00