Open lukas-shawford opened 4 years ago
Thank you, this looks really useful!
@Nercury I'm using neovim with coc-rust-analyzer, so the above change doesn't work for me.
Could you specify where you would copy bindings.rs
to?
I'm relatively new to rust, so it would be helpful instead of the vague explanation currently in the tutorial
You could copy-paste the contents of the generated file to where the include!
macro is, this is what the include macro basically does.
You need to tick org.rust.cargo.evaluate.build.scripts
in newer versions of the plugin
Hey, I'm following your excellent tutorial series. Thank you for writing these!
Towards the end of lesson 6, there is a suggestion about how to get autocomplete to work, which involves copying the auto-generated
bindings.rs
from the output directory back into the project. That didn't actually work for me (maybe I wasn't copying it to the right place, not sure - I'm completely new to Rust).But regardless, it seems there is now a better way, at least for IntelliJ. I thought it might be worth updating the lesson with these instructions, since AutoComplete is so immensely helpful for someone who is learning Rust and OpenGL (the target audience of this blog series).
There is an experimental feature of the intellij-rust plugin which allows for auto-completion to work when using:
To enable it, open the Maintenance Menu using
Ctrl+Shift+Alt+/
, select "Experimental Features", then enable the following feature:org.rust.cargo.fetch.out.dir
Then restart the IDE.
Worked beautifully for me. There is some discussion here as to why the feature is designated as Experimental and disabled by default:
https://github.com/intellij-rust/intellij-rust/pull/4573
And the original issue from intellij-rust is here:
https://github.com/intellij-rust/intellij-rust/issues/1908