I figured out how to make Diesel work with my project, but when I try to use a functionality from the schema module, I get no code completion suggestions from VS Code with the RLS extension installed.
I also tried to get suggestions with the IntelliJ Rust plugin without any success; maybe I'm missing something. The problem seems to come from macro usage.
#[macro_use]
extern crate diesel;
use diesel::prelude::*;
mod db;
mod models;
mod schema;
use models::post::Post;
#[get("/")]
fn main() {
use schema::posts::dsl::*;
let connection = db::establish_connection();
let results = posts.load::<Post>(&connection).unwrap();
for post in results {
println!("{}", post.content);
}
}
The code works but I get nothing from VS Code after I write posts
. or schema::
.
This seems to me to be a big feature from Diesel and I can't believe code completion is impossible with it.