diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs index 47ea662d7de5b5d367dc854ee03c07faf02f5fca..2e02f051d15fc8a20d3181b3a37cbad0b9745651 100644 --- a/crates/util/src/paths.rs +++ b/crates/util/src/paths.rs @@ -170,6 +170,12 @@ impl> From for SanitizedPath { pub const FILE_ROW_COLUMN_DELIMITER: char = ':'; const ROW_COL_CAPTURE_REGEX: &str = r"(?xs) + ([^\(]+)\:(?: + \((\d+)[,:](\d+)\) # filename:(row,column), filename:(row:column) + | + \((\d+)\)() # filename:(row) + ) + | ([^\(]+)(?: \((\d+)[,:](\d+)\) # filename(row,column), filename(row:column) | @@ -674,6 +680,15 @@ mod tests { column: None } ); + + assert_eq!( + PathWithPosition::parse_str("Types.hs:(617,9)-(670,28):"), + PathWithPosition { + path: PathBuf::from("Types.hs"), + row: Some(617), + column: Some(9), + } + ); } #[test]