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

<img width="875" alt="image"
src="https://github.com/user-attachments/assets/967d2e03-e167-4055-9c8e-31531cca1471"
/>

while its being parsed correctly in vscode

<img width="934" alt="image"
src="https://github.com/user-attachments/assets/a881cf0e-f06e-4b44-8363-6295bcc825fd"
/>

Release Notes:

- Fixed path parsing paths in the format of the Haskell language server
This commit is contained in:
abhimanyu maurya 2025-07-05 05:24:43 +05:30 committed by GitHub
parent 4ad47fc9cc
commit 69fd23e947
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -170,6 +170,12 @@ impl<T: AsRef<Path>> From<T> 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]