diff --git a/waycast-macros/Cargo.toml b/waycast-macros/Cargo.toml index ecf87e0..11719c9 100644 --- a/waycast-macros/Cargo.toml +++ b/waycast-macros/Cargo.toml @@ -9,4 +9,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0" syn = { version = "2.0", features = ["full"] } -quote = "1.0" \ No newline at end of file +quote = "1.0" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rust_analyzer)'] } \ No newline at end of file diff --git a/waycast-macros/src/lib.rs b/waycast-macros/src/lib.rs index 3ef7dbb..e1c062e 100644 --- a/waycast-macros/src/lib.rs +++ b/waycast-macros/src/lib.rs @@ -213,6 +213,25 @@ impl PluginConfig { #default_list_method #filter_method + + // Stub implementations to satisfy rust-analyzer + // These are only compiled when rust-analyzer is checking the code + #[cfg(rust_analyzer)] + fn init(&self) { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn name(&self) -> String { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn priority(&self) -> i32 { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn description(&self) -> Option { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn prefix(&self) -> Option { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn by_prefix_only(&self) -> bool { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn default_list(&self) -> Vec> { unimplemented!("Generated by plugin! macro") } + #[cfg(rust_analyzer)] + fn filter(&self, _query: &str) -> Vec> { unimplemented!("Generated by plugin! macro") } } } } diff --git a/waycast-plugins/Cargo.toml b/waycast-plugins/Cargo.toml index 3e17af6..4cd6d3d 100644 --- a/waycast-plugins/Cargo.toml +++ b/waycast-plugins/Cargo.toml @@ -10,4 +10,7 @@ directories = "6.0.0" gio = "0.21.1" glib = "0.21.1" tokio = { version = "1.0", features = ["rt", "rt-multi-thread", "time", "macros", "sync"] } -walkdir = "2.5.0" \ No newline at end of file +walkdir = "2.5.0" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rust_analyzer)'] } \ No newline at end of file