Closed NickeZ closed 1 month ago
Even in the bitbox02-rust crate, which depends on the C stuff?
I've been meaning to look into https://github.com/digitalbitbox/bitbox02-firmware/pull/819 again - if that one works, is this one still needed?
yeah, I tried the lsp hover
function on some stuff and it seems to work everywhere.
This has a different approach to the other PR. In the other PR I tried to make RA work on the developers machine. In this PR RA is run in the docker container. So this PR is much smaller and easier to maintain I would say. The drawback of this approach is that you need to configure your editor to call ra.sh
instead of rust-analyzer
for this specific project. In vim I can just have a local vimrc file in the project folder. So it isn't a problem. Not sure how you do in Emacs.
A bit confused, why does rust-analyzer need to run inside Docker, is there anything special inside the Docker container? Could it also run on the host?
Asking because adding it to the Dockerfile has at least these downsides:
rust-analyzer is technically a compiler, so it requires almost everything that you have in the docker container. The only way to make it work outside the container is to install most of those dependencies on your dev machine.
edit: It doesn't to the linking step. But it has to do all the other steps (e.g., macro expansion, type resolution, run build scripts) to create the autocompletions.
Most of the deps means just the Rust toolchain or more? Cause installing the Rust stuff is not a big barrier imo.
I tried getting this PR to work in my environment, no luck yet. Will try again.
I don't remember exactly, but you need to be able to generate C headers, rust bindings. If you look at the other PR you can see that there are some changes so that the build scripts can detect if they are run under cmake or not.
This setup works for me, unless I'm being confused. I configure vim to run
ra.sh
and I start vim in thesrc/rust
directory.