Stream: t-compiler/rust-analyzer

Topic: unstable completion items

Martin Asquino (Nov 02 2019 at 22:50, on Zulip):

Hi! I was looking at this issue 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?

Edwin Cheng (Nov 03 2019 at 01:56, on Zulip):

If I understand correctly, we could handle the unstable attribute similar to cfg. If we don't collect them, it will not show in completion items.

Laurențiu (Nov 03 2019 at 07:16, on Zulip):

But we do want to show unstable items like Vec::partition_at_index, at least for nightly users

Laurențiu (Nov 03 2019 at 07:18, on Zulip):

One heuristic could be to look for the issue number (format_args_nl has 0)

matklad (Nov 03 2019 at 09:25, on Zulip):

there are two separate issues here I think:

I wonder if the best way to tackle 2 is to look for #[doc(hidden)] attribute?

Last update: Jul 29 2021 at 21:30UTC