Skip to content

Commit

Permalink
tsparser: handle files in app root
Browse files Browse the repository at this point in the history
  • Loading branch information
eandre committed Dec 22, 2024
1 parent 60cf7bf commit 8d5c1c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsparser/src/legacymeta/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,12 @@ pub(super) fn loc_from_range(
let pkg_name = rel_path
.parent()
.and_then(|p| p.file_name())
.or_else(|| app_root.file_name())
.map(|s| s.to_string_lossy().to_string())
.ok_or(range.parse_err("missing package name"))?;
let pkg_path = rel_path
.parent()
.map(|s| s.to_string_lossy().to_string())
.ok_or(range.parse_err("missing package path"))?;
.map_or(".".to_string(), |s| s.to_string_lossy().to_string());
(pkg_path, pkg_name, file_name)
}
Err(_) => {
Expand Down

0 comments on commit 8d5c1c1

Please sign in to comment.