-
Notifications
You must be signed in to change notification settings - Fork 1.7k
postgres-query proc macro not resolved #6740
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
Probably duplicate of #6716. |
I think we need more info here. How do you invoke |
Invoked as specified in documentation: let mut bindings = Vec::new();
// some code
let query: Query = query_dyn!(&sql, ..bindings)?; Macro defined here.
|
@yokujin Does this still occur with current rust-analyzer? |
The |
"rust-analyzer.procMacro.enable": true Cargo: Load Out Dirs From Check is unchecked |
You'll need to enable both for proc macros to work. |
I enabled all the required options and updated to nightly... /// Log a debug level message using current scope logger
#[macro_export]
macro_rules! debug( ($($args:tt)+) => {
$crate::with_logger(|logger| $crate::slog_debug![logger, $($args)+])
};); |
That's #6955, a different bug. |
OTOH, , |
I'm having the same issue with the |
9128: feat: expand procedural attribute macros r=jonas-schievink a=jonas-schievink This adds experimental support for attribute macros. They can be enabled by setting `rust-analyzer.experimental.procAttrMacros` to `true`. Known issues: * Tokens aren't remapped, presumably because we edit the input syntax tree (this causes IDE features to not work inside items with attribute macros on them) * Macro errors aren't reported correctly Closes #8971 Fixes #8964 / la10736/rstest#120 Fixes #2984 Fixes #5412 Fixes #6029 Fixes #6687 #6740 is still not fixed – we now expand `#[proc_macro_hack]`, but fail to expand the resulting `proc_macro_call!()` macro. Co-authored-by: Jonas Schievink <[email protected]>
9128: feat: expand procedural attribute macros r=jonas-schievink a=jonas-schievink This adds experimental support for attribute macros. They can be enabled by setting `rust-analyzer.experimental.procAttrMacros` to `true`. Known issues: * Tokens aren't remapped, presumably because we edit the input syntax tree (this causes IDE features to not work inside items with attribute macros on them) * Macro errors aren't reported correctly Closes #8971 Fixes #8964 / la10736/rstest#120 Fixes #2984 Fixes #5412 Fixes #6029 Fixes #6687 #6740 is still not fixed – we now expand `#[proc_macro_hack]`, but fail to expand the resulting `proc_macro_call!()` macro. Co-authored-by: Jonas Schievink <[email protected]>
It's hard to tell which macro issues are related, but I'm having problems with importing "parse_macro_input": Not sure if it's related, but I wish not open a new issue until I know. I have also this in my settings.json:
|
This now works |
Using the following macro:
error flagged in rust-analyzer:
could not resolve macro $crate::__query_dynamic rust-analyzer(macro-error)
.Rust compiler compiles that code without any error.
cargo check
/cargo clippy
find no errors/warnings.Latest release version of rust-analyzer (2020-11-30) does not flag this error either.
The text was updated successfully, but these errors were encountered: