You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a crate that generates a Rust src file in the build.rs and then include!'s it in the lib.rs file. This works great for cargo build, but the rust analyzer seems to not be able to get the auto-complete for it correctly:
It gets the Project, top level type which is hard-coded into the struct:
But it can't get any of it's fields figured out:
I'm guessing that using a proc macro to generate the code instead of include!-ing the source file would probably fix it, and I'm going to try that out, but I wanted to make sure you guys didn't have any pointers first. Thanks!
The text was updated successfully, but these errors were encountered:
Ah, that fixed it! Thanks for the quick response. I always wondered what that setting was actually for. Would you be open to me adding some more description such as "Needed for autocomplete for some crates that generate source files in the cargo OUT_DIR"?
Am I right in my understanding that it would work fine if I used a proc macro? I might just do that if it helps users not having to be aware of this edge case. Especially being that that option is off by default. Would it make sense to make that option enabled by default?
Proc macros are also off by default, so no. And a build script seems like the better solution here.
The plan is to enable both by default in #7328 and that will probably include cleaning up the config name and description. A PR for that would be appreciated, of course.
I have a crate that generates a Rust src file in the
build.rs
and theninclude!
's it in the lib.rs file. This works great forcargo build
, but the rust analyzer seems to not be able to get the auto-complete for it correctly:It gets the Project, top level type which is hard-coded into the struct:
But it can't get any of it's fields figured out:
I'm guessing that using a proc macro to generate the code instead of
include!
-ing the source file would probably fix it, and I'm going to try that out, but I wanted to make sure you guys didn't have any pointers first. Thanks!The text was updated successfully, but these errors were encountered: