Skip to content

Commit

Permalink
Seems like gleam assumes file path is unix path. Should make a note
Browse files Browse the repository at this point in the history
that it needs to handle Windows as well.
  • Loading branch information
oneness committed Jan 22, 2025
1 parent d5b096a commit 75da896
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler-core/src/erlang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use im::HashSet;
use itertools::Itertools;
use pattern::pattern;
use regex::{Captures, Regex};
use std::path;
use std::sync::OnceLock;
use std::{collections::HashMap, ops::Deref, str::FromStr, sync::Arc};
use vec1::Vec1;
Expand Down Expand Up @@ -226,14 +225,13 @@ fn module_document<'a>(

let src_path_full = EcoString::from(module.type_info.src_path.as_str());
let root_str = root.to_string();
let separator = path::MAIN_SEPARATOR.to_string();
let src_path_relative = root_str
.is_empty()
.then(|| src_path_full.clone())
.unwrap_or_else(|| {
EcoString::from(
src_path_full
.strip_prefix(&(root_str + &separator))
.strip_prefix(&(root_str + "/"))
.unwrap_or(&src_path_full),
)
});
Expand Down

0 comments on commit 75da896

Please sign in to comment.