Skip to content

Commit

Permalink
Fix LSP not compiling when format feat is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Mar 12, 2024
1 parent 57cb6c5 commit 98a9677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lsp/nls/src/requests/formatting_external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pub fn handle_format_document(
server: &mut Server,
) -> Result<(), ResponseError> {
let path = uri_to_path(&params.text_document.uri)?;
let file_id = server.cache.id_of(&SourcePath::Path(path)).unwrap();
let text = server.cache.files().source(file_id).clone();
let file_id = server.world.cache.id_of(&SourcePath::Path(path)).unwrap();
let text = server.world.cache.files().source(file_id).clone();
let document_length = text.lines().count() as u32;

let Ok(mut topiary) = process::Command::new(FORMATTING_COMMAND[0])
Expand Down

0 comments on commit 98a9677

Please sign in to comment.