Open dcvz opened 1 year ago
std type referencing in IDE's happens by them referencing Rust's standard library definitions. In my research it seems that this can be defined by RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
This std definitions are separately installed via rustup using rustup component add rust-src
but this is something that tea's Rust is currently not providing. Some IDE's automatically will leverage rustup to find / install these.
Problem is if you use rustup, you first have to install a toolchain and these will be installed to .rustup/toolchains/XXX
which is in conflict with tea trying to provide you a rust toolchain that lives in .tea/rust-lang.org
The error on VSCode is: cannot find proc-macro server in sysroot
. An issue filed seems to ask that the user checks the contents of their $(rustc --print sysroot)/libexec
folder. This does not exist in the installation that .tea provides.
However installations done with rustup do include this folder, so https://github.com/teaxyz/pantry/pull/2796 should fix this as well.
This is a "megaticket" of sorts for Rust support in IDE's. The issues encountered so far are:
[ ] std definitions missing
Fix: https://github.com/teaxyz/pantry/pull/2796
[ ] on the fly checking fails in IntelliJ products with Rust plugin (runs cargo check) - Image
[ ] VSCode: proc macros can't be expanded and show as errors - Image, Image