VC: Tmp fix

This commit is contained in:
2026-06-21 19:45:06 +02:00
parent fae231d481
commit cd7a62dc34
+9 -19
View File
@@ -374,25 +374,14 @@ impl LanguageServer for Backend {
eprintln!("Loaded {} mist files", files.len()); eprintln!("Loaded {} mist files", files.len());
// Compute mod_decls before any transpile so the root file gets its let mapping_c = mapping.clone();
// child module declarations from the very first didOpen. let documents_c = documents.clone();
let package_mist = read_mist_package(root); let ra_c = ra.clone();
let src_root = root.join("src");
let mod_decls = {
let docs = documents.lock().await;
compute_mod_decls(&docs, &src_root, &package_mist)
};
for file in &files { for file in &files {
let decl = mod_decls.get(file).map(String::as_str).unwrap_or(""); if let Some(source) = documents_c.lock().await.get(file).map(|r| r.to_string())
let source = match documents.lock().await.get(file) { {
Some(r) => r.to_string(), let transpiled = match transpile_mist(file, &source, "") {
None => {
eprintln!("missing document for {:?}", file);
continue;
}
};
let transpiled = match transpile_mist(file, &source, decl) {
Ok(t) => t, Ok(t) => t,
Err(e) => { Err(e) => {
eprintln!("transpile error for {:?}: {e}", file); eprintln!("transpile error for {:?}: {e}", file);
@@ -401,17 +390,18 @@ impl LanguageServer for Backend {
}; };
if let Some(rust_uri) = clean_lsp_url(&transpiled.rust_path) { if let Some(rust_uri) = clean_lsp_url(&transpiled.rust_path) {
let _ = ra let _ = ra_c
.lock() .lock()
.await .await
.did_open(rust_uri, &transpiled.rust_content) .did_open(rust_uri, &transpiled.rust_content)
.await; .await;
mapping mapping_c
.lock() .lock()
.await .await
.insert(transpiled.rust_path, transpiled.mapping); .insert(transpiled.rust_path, transpiled.mapping);
} }
} }
}
if let Some(rx) = notification_rx.lock().await.take() { if let Some(rx) = notification_rx.lock().await.take() {
tokio::spawn(handle_ra_notifications( tokio::spawn(handle_ra_notifications(