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
Complete exported macros in #[macro_use($0)]
#16137
Conversation
if let Some(tt) = ast::TokenTree::cast(parent.clone()) { | ||
if let Some(x) = try_lookup_include_path(sema, tt, token.clone(), file_id) { | ||
return Some(vec![x]); | ||
} | ||
|
||
if let Some(x) = try_lookup_macro_def_in_macro_use(sema, token.clone()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine to do now, but ideally this would be done the same way we handle derives, by giving macro_use
a dummy expansion we can map into. #11929
Thanks! |
There is not much we can do there, since a token tree ends at its closing delimiter. |
☀️ Test successful - checks-actions |
Closes #15657.
Originally added a test case for incomplete input:
but couldn't make it pass and removed it 😅 Our current recovering logic doesn't work for token trees and for this code:
we ended up with this syntax tree:
Maybe we can try to parse the token tree in
crates/ide-completion/src/context/analysis.rs
but I'm not sure what's the best way forward.