I am using Sailfish
as template engine in Rust:
https://rust-sailfish.github.io/sailfish/getting-started/
I followed the simple tutorial and have the following code:
#[derive(TemplateOnce)]
#[template(path = "index.stpl")]
struct HomeTemplate {
messages: Vec<String>
}
let ctx = HomeTemplate {
messages: vec![String::from("foo"), String::from("bar")],
};
println!("{}", ctx.render_once().unwrap());
The code itself works fine and the program runs fine.
However, VSCode has this constant error and the #[derive(TemplateOnce)]
line is underlined in red:
failed to load file `/Users/XXXXXXXX....XXXX/server/target/debug/build/sailfish-compiler-19a8f501817d4158/out/templates/460671ab72c8d6b8-8a0fdd098792c13e`
rust-analyzer macro-error
core::macros::builtin
macro derive
It seems like something is wrong with my VSCode or my rust analyzer? I am not sure.
I tried cargo clean
but the issue has persisted. Also tried restarting VSCode.
EDIT: Is my issue similar to the one this person is facing with include! macro gives failed to load file error
?:
https://github.com/rust-lang/rust-analyzer/issues/17828
Or could it be similar to this?
https://github.com/rust-lang/rust-analyzer/issues/10647