paths: Add support for clickable file paths in the Odin language format (#25842)
This PR adds support for clickable file paths in the Odin language format. The odin compiler errors use the format `/path/to/file.odin(1:1)`. We didn't recognize this format, making these paths non-clickable in the terminal. Also added tests for this. Release Notes: - Added support for clickable file paths in the Odin language format. --------- Co-authored-by: Peter Tripp <peter@zed.dev>
This commit is contained in:
parent
a8a05f208b
commit
fa96e2259b
1 changed files with 9 additions and 1 deletions
|
@ -165,7 +165,7 @@ pub const FILE_ROW_COLUMN_DELIMITER: char = ':';
|
|||
|
||||
const ROW_COL_CAPTURE_REGEX: &str = r"(?x)
|
||||
([^\(]+)(?:
|
||||
\((\d+),(\d+)\) # filename(row,column)
|
||||
\((\d+)[,:](\d+)\) # filename(row,column), filename(row:column)
|
||||
|
|
||||
\((\d+)\)() # filename(row)
|
||||
)
|
||||
|
@ -649,6 +649,14 @@ mod tests {
|
|||
column: None,
|
||||
}
|
||||
);
|
||||
assert_eq!(
|
||||
PathWithPosition::parse_str("/testing/out/src/file_finder.odin(7:15)"),
|
||||
PathWithPosition {
|
||||
path: PathBuf::from("/testing/out/src/file_finder.odin"),
|
||||
row: Some(7),
|
||||
column: Some(15),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue