I'd appreciate if someone could share their IDE settings, namely files in .vscode/
directory. I'm now in trouble with telling rust-analyzer that cfg(compiler)
should be enabled.
My temporary workaround is to modify the file crates/wasmtime/build.rs
, moving
println!("cargo:rustc-cfg=compiler");
outside of the if cfg!(feature = "cranelift") { ... }
block.
You can set the rust-analyzer.cargo.features
config to include "cranelift" (or "wasmtime/cranelift", not sure which one works)
Not to hijack this topic but seems related, have anyone experiencing rust-analyzer not showing errors of wasmtime-cli or wasmtime? It seems like the add_to_linker
methods generated by define_wasi!
macro is not recognized by RA correctly.
I was seeking for a workaround long time but nothing worked well.
FYI I painted unresolved references into #ff0000
to better see what is going wrong:
"editor.semanticTokenColorCustomizations": {
"rules": {
"unresolvedReference": "#ff0000",
},
}
Anyway, @bjorn3 's suggestion, "wasmtime/cranelift"
, seems working well. Thanks.
Last updated: Nov 22 2024 at 16:03 UTC