Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

paths: Add support for clickable file paths in the Odin language format (#25842)

Devzethfa96e2259bfd
diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs
index c2d66b573e3..f333f285fd5 100644
--- a/crates/util/src/paths.rs
+++ b/crates/util/src/paths.rs
@@ -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]