Stream: general

Topic: Can you share your IDE settings for wasmtime?


view this post on Zulip Fuu (Nov 18 2022 at 05:50):

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.

view this post on Zulip Fuu (Nov 18 2022 at 06:34):

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.

view this post on Zulip bjorn3 (Nov 18 2022 at 13:52):

You can set the rust-analyzer.cargo.features config to include "cranelift" (or "wasmtime/cranelift", not sure which one works)

view this post on Zulip Nam Junghyun (Nov 19 2022 at 01:00):

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",
    },
  }

image.png

Anyway, @bjorn3 's suggestion, "wasmtime/cranelift", seems working well. Thanks.


Last updated: Dec 23 2024 at 12:05 UTC