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.

Allow `zed filename.rs:` (#38677)

Conrad Irwine9fbcf5abf6d
diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs
index 72753b026e2..7d16ee0b5ec 100644
--- a/crates/util/src/paths.rs
+++ b/crates/util/src/paths.rs
@@ -379,6 +379,8 @@ const ROW_COL_CAPTURE_REGEX: &str = r"(?xs)
\:+(\d+)\:(\d+)\:*$ # filename:row:column
|
\:+(\d+)\:*()$ # filename:row
+ |
+ \:+()()$
)";
/// A representation of a path-like string with optional row and column numbers.
@@ -455,8 +457,8 @@ impl PathWithPosition {
/// row: None,
/// column: None,
/// });
- /// assert_eq!(PathWithPosition::parse_str("test_file.rs::"), PathWithPosition {
- /// path: PathBuf::from("test_file.rs::"),
+ /// assert_eq!(PathWithPosition::parse_str("test_file.rs"), PathWithPosition {
+ /// path: PathBuf::from("test_file.rs"),
/// row: None,
/// column: None,
/// });
@@ -998,7 +1000,7 @@ mod tests {
assert_eq!(
PathWithPosition::parse_str("test_file.rs:"),
PathWithPosition {
- path: PathBuf::from("test_file.rs:"),
+ path: PathBuf::from("test_file.rs"),
row: None,
column: None
}