From 69fd23e947edebfaa5704eee800d935645755759 Mon Sep 17 00:00:00 2001
From: abhimanyu maurya <47671638+Aerma7309@users.noreply.github.com>
Date: Sat, 5 Jul 2025 05:24:43 +0530
Subject: [PATCH] Fix path parsing for goto syntax provided by Haskell language
server (#33697)
path parsing for multiline errors provided by haskell language server
where not working correctly
while its being parsed correctly in vscode
Release Notes:
- Fixed path parsing paths in the format of the Haskell language server
---
crates/util/src/paths.rs | 15 +++++++++++++++
1 file changed, 15 insertions(+)
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]