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
Since the glue file is meant to be normal Rust code, editor autocomplete and inline-errors should work.
When trying this with rust-analyzer, it currently fails because the macros (foreign_*) can't be resolved. This is to be expected because they aren't actual macro's, rather markers for the flapigen parser.
I think we can solve this by adding stub macros, simply for the IDE to be happy. This just needs a definition for each macro with ($($tt:tt)*) => {};. These macros would have to be added to a separate crate, not the main flapigen crate so we don't pull in the binding generator in the resulting library.
We could go even further and try to make macros that actually resemble the virtual ones, in this case the editor can help out even more and check that you are writing the rules correctly. For example:
Since the glue file is meant to be normal Rust code, editor autocomplete and inline-errors should work.
When trying this with rust-analyzer, it currently fails because the macros (
foreign_*
) can't be resolved. This is to be expected because they aren't actual macro's, rather markers for the flapigen parser.I think we can solve this by adding stub macros, simply for the IDE to be happy. This just needs a definition for each macro with
($($tt:tt)*) => {};
. These macros would have to be added to a separate crate, not the mainflapigen
crate so we don't pull in the binding generator in the resulting library.We could go even further and try to make macros that actually resemble the virtual ones, in this case the editor can help out even more and check that you are writing the rules correctly. For example:
The text was updated successfully, but these errors were encountered: