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:
parent
4ad47fc9cc
commit
69fd23e947
1 changed files with 15 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue