Hi! I was looking at this issue https://github.com/rust-analyzer/rust-analyzer/issues/2003 and was trying to figure out what it would take to fix it. I managed to keep the unstable macros out of the completion items list by checking whether they include the unstable attribute, but I have a couple of doubts.
- Should this be fixed only for macros? Or all kinds of completion items?
- I have mixed feelings about modifying
Completions::add_macro to check if the node has an
unstable attribute, mainly because the name of the function,
add_macro sounds like it should definitely add a macro completion item to the list. But doing that check before the call to
add_macro means having duplicated code. Am I being to pedantic and should just add that check there?
If I understand correctly, we could handle the
unstable attribute similar
cfg. If we don't collect them, it will not show in completion items.
But we do want to show unstable items like
Vec::partition_at_index, at least for nightly users
One heuristic could be to look for the issue number (
format_args_nl has 0)
there are two separate issues here I think:
I wonder if the best way to tackle 2 is to look for