Skip to content

Commit 784b135

Browse files
committed
Fix language server content update handler
1 parent 71363e7 commit 784b135

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/language-server/src/functionality/handlers.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use async_lsp::{
1111
use common::InputDb;
1212
use driver::init_ingot;
1313
use rustc_hash::FxHashSet;
14+
use salsa::Setter;
1415
use url::Url;
1516

1617
use super::{capabilities::server_capabilities, hover::hover_helper};
@@ -294,10 +295,11 @@ pub async fn handle_file_change(
294295
}
295296
};
296297
if let Ok(url) = url::Url::from_file_path(&path) {
297-
backend
298+
let file = backend
298299
.db
299300
.workspace()
300-
.touch(&mut backend.db, url.clone(), Some(contents));
301+
.touch(&mut backend.db, url.clone(), None);
302+
file.set_text(&mut backend.db).to(contents);
301303

302304
// If fe.toml was modified, re-scan the ingot for any new files
303305
if is_fe_toml {

0 commit comments

Comments
 (0)