-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Macros not resolving #6847
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
You can enable proc-macro support using {
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
"rust-analyzer.procMacro.enable": true,
} |
I'm having the same issue, but enabling those two features did not resolve the errors. |
This is probably a duplicate of #6716. It should be fixed on nightly, or with the release tomorrow. |
I updated my VSCode settings to use nightly (VSCode now shows the version as |
@AngelOfSol do you have the settings mentioned above turned on? @erichgess Can you provide more information about which errors you're still seeing? These errors aren't all the same bug. |
@fannheyward Yes I do, this is my settings list: {
"editor.formatOnSave": true,
"workbench.colorTheme": "Monokai Pro (Filter Spectrum)",
"vim.useCtrlKeys": false,
"window.zoomLevel": 0,
"rust-analyzer.excludeGlobs": [
"resources/*",
],
"rust-analyzer.checkOnSave.overrideCommand": null,
"rust-analyzer.files.watcher": "notify",
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.files.exclude": [
"resources/*"
],
"editor.fontSize": 18,
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.cargo.allFeatures": true,
"rust-analyzer.updates.channel": "nightly"
} |
@rimutaka I can't reproduce this. Note that function-local imports don't work, but if the @MaxBeaud Is this still happening for you on the current version? |
Here's a git repo that is a minimal repro of my issue: https://github.com/AngelOfSol/strum-macro-not-resolve, it has a capture of what my VS-Code looks like at when looking at the src file. |
I experience the same behavior when using https://git.sr.ht/~yaymukund/crossterm-macro-not-resolve |
@AngelOfSol This might be caused by the way the strum proc macro is defined, since we don't support cfg_attr yet. Could you open a separate issue for your problem? @yaymukund The |
@wpbrown can you please provide a minimal reproduction, in a separate issue? |
I'm going to close this issue because I believe the original problem was fixed, and this is becoming a general dumping ground for macro error false positives. |
@flodiebold In my case, I just downloaded the rust-analyzer update on vsCode and my using statement errors are gone. Furthermore the update for some reason caught some oddities it didn't before and has fixed some UB I could not for the life of me find out what it's cause was. I realize this issue is closed however, thank you. |
At the beginning of my program: use statement and start of the main function, rust-analyzer tells me it has failed to import certain macros. However this is purely rust-analyzer as the program can compile with no problem and the compiler throws no error.
The text was updated successfully, but these errors were encountered: