Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(rome_lsp): fix the merge conflict of #4042 and #4044
  • Loading branch information
leops committed Dec 13, 2022
commit 7e03e56fe565bed4f038c4581e7f4e4c1552318d
12 changes: 5 additions & 7 deletions crates/rome_lsp/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,11 @@ impl Session {
.to_file_path()
.map_err(|()| anyhow!("failed to convert {url} to a filesystem path"))?;

let relative_path = {
let root_uri = self.root_uri.read().unwrap();
root_uri.as_ref().and_then(|root_uri| {
let root_path = root_uri.to_file_path().ok()?;
path_to_file.strip_prefix(&root_path).ok()
})
};
let relative_path = self.initialize_params.get().and_then(|initialize_params| {
let root_uri = initialize_params.root_uri.as_ref()?;
let root_path = root_uri.to_file_path().ok()?;
path_to_file.strip_prefix(&root_path).ok()
});

if let Some(relative_path) = relative_path {
path_to_file = relative_path.into();
Expand Down