rust-lang / rust-lang/rust-analyzer
Vscode and Zed Sqlx PgPool in state struct not auto completing suddenly
Open
Nobody has claimed this yet.
A-completion
C-bug
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer version: 0.3.2981-standalone (cac0779549 2026-07-18)
rustc version: rustc 1.97.0 (2d8144b78 2026-07-07)
editor or extension: ( VSCode, Zed)
code snippet to reproduce:
use sqlx::{PgPool, Pool, Postgres, postgres::PgPoolOptions};
use tauri::{AppHandle, Manager, State};
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(state: State<'_, Arc<AppState>>) {
let a = state.;
}
use std::sync::Arc;
#[derive(Clone)]
pub struct Database {
pub pool: Arc<PgPool>,
}
#[derive(Clone)]
pub struct AppState {
pub database: Database,
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
tauri::async_runtime::block_on(async {
let pool = PgPoolOptions::new()
.max_connections(5)
.connect("postgresql://postgres@localhost:5432/public-procurement-v2")
.await
.unwrap();
let app_state: AppState = AppState { database: Database { pool: Arc::new(pool) } };
app.manage(app_state);
});
Ok(())
})
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the provided Tauri command example in VSCode and Zed using the listed rust-analyzer and rustc versions. Check completion around State, database, and the sqlx PgPool field; done means isolating why completion differs from RustRover and recording a confirmed diagnosis or fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100