Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Macros to Support Rust Analyzer Autocomplete #95

Open
jbuckmccready opened this issue Mar 23, 2023 · 2 comments
Open

Change Macros to Support Rust Analyzer Autocomplete #95

jbuckmccready opened this issue Mar 23, 2023 · 2 comments

Comments

@jbuckmccready
Copy link

When using the stream! or try_stream! macros autocomplete with rust analyzer works fine until a yield statement is written, this is due to the macro no longer expanding if there is any invalid rust (but only once a yield statement has been written). See the rust analyzer issue here explaining in more detail how autocomplete fails when macros fail to expand (specifically for this crate's macros): rust-lang/rust-analyzer#12759

I have no experience writing proc macros, I'm wondering is it possible to change the way the proc macros are written to always expand even if there is a yield statement and the Rust code is invalid? This would allow rust analyzer auto complete to function properly in all cases. I tested and noticed the tokio select! macro seems to consistently expand which allows autocomplete to function normally.

@taiki-e
Copy link
Member

taiki-e commented Jun 11, 2023

Does #68 's trick work?

In any case, #74 should solve this issue.

@jbuckmccready
Copy link
Author

Parentheses as mentioned in #68 unfortunately doesn't fix the autocomplete - but good to know for formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants