-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Please add find_equiv to TreeMap #14549
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It's not possible to use |
I came up with a working way to convert |
(not possible) |
…stable, r=Veykril Don't suggest unstable items on stable toolchain Closes rust-lang#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.
…stable, r=Veykril Fix faulty variable extraction Followup to rust-lang#14549 Fixes rust-lang/rust-analyzer#14549 (comment) and rust-lang/rust-analyzer#14549 (comment)
For accessing a key in a JSON object (which is represented in memory as
TreeMap<String, Json>
), I find myself writing code likemap.find(&key.to_string())
that really should be justmap.find(key)
.HashMap
has afind_equiv
method to do this. It’d be nice to have it inTreeMap
. (Other convenience method may apply to.)However, you may want to block this on a decision from #12135.
The text was updated successfully, but these errors were encountered: