-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Auto-complete didn't work inside proc macro . #15122
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
Comments
With a function-like proc macro, rust-analyzer has no idea that the tokens inside are supposed to be code, so it can't do any error recovery. And syn will just fail to parse the incomplete code |
I think you misunderstood, The code is not incomplete, and the proc macro do return valid code, with code span preserved. |
When you're writing fn main() {
code!({
let num = 42;
num. // No code completion ☹️
});
} the code is incomplete and not a valid expression, so |
I re-implemented my proc-macro with a more IDE friendly, which solved this problem. |
See: dtolnay/syn#1472
The text was updated successfully, but these errors were encountered: