Ironically, we have the same issue here as in https://github.com/aya-rs/aya-template/pull/13/. This patch fixes this by explicitly defining the project layout for both vscode and neovim.
@@ -1,4 +1,3 @@
Cargo.lock
target/
-.vscode
-libbpf/
+libbpf/
@@ -0,0 +1,3 @@
+{
+ "rust-analyzer.linkedProjects": ["Cargo.toml", "bpf/Cargo.toml"]
+}