Add support for the "..." entry in terminal.path_hyperlink_regexes (#64552)
## Objective Allow custom terminal path regexes to extend inherited entries without copying them. This PR also corrects the existing mismatch between the documented and shipped default regexes. This is the last submission in the #64399 series, following #62769, #64222, #64440, #64484, and #64540. ## Solution The `"..."` entry is intentionally supported at the top level only. A `"..."` line inside a multiline entry remains regex text. Existing configurations that use bare `...` as a three-character regex can preserve that behavior by writing `["..."]` as an entry instead. The shipped regexes and hyperlink matching behavior are unchanged. ## Testing All focused tests and all hyperlink tests pass on macOS. The documented default expressions were checked against the shipped values. ## Self-Review Checklist: - [x] I’ve reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed’s UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Added support for `"..."` in `terminal.path_hyperlink_regexes` to extend inherited regexes without repeating them.
This commit is contained in:
1 parent
a596e1b294
commit
b015cdf8be
5 files changed
+395
-55
No files matched your search
@@ -2207,14 +2207,23 @@
|
||||
//
|
||||
// [
|
||||
// "\\s+(-->|:::|at) (?<link>(?<path>.+?))(:$|$)",
|
||||
// "\\s+(Compiling|Checking|Documenting) [^(]+\\((?<link>(?<path>.+))\\)"
|
||||
// "\\s+(Compiling|Checking|Documenting) [^(]+\\((?<link>(?<path>.+))\\)",
|
||||
// "..."
|
||||
// ],
|
||||
//
|
||||
// could be used. Processing stops at the first regex with a match, even if no link is
|
||||
// could be used. The `"..."` entry inserts inherited regexes at that position. In project
|
||||
// settings, it extends the user or parent configuration value. Omit `"..."` to replace the
|
||||
// inherited list, or set `[]` to clear it. Duplicates keep their first occurrence, comparing
|
||||
// regex text after joining multiline entries with newlines. The marker is recognized only
|
||||
// as a top-level string. Write `["..."]` as an entry to keep the three-character regex instead.
|
||||
// A `"..."` line inside a multiline entry is always regex text. Invalid regexes are logged
|
||||
// and ignored.
|
||||
//
|
||||
// Processing stops at the first regex with a match, even if no link is
|
||||
// produced which is the case when the cursor is not over the hyperlinked text. For best
|
||||
// performance it is recommended to order regexes from most common to least common. For
|
||||
// readability and documentation, each regex may be an array of strings which are collected
|
||||
// into one multi-line regex string for use in terminal path hyperlink detection.
|
||||
// readability and documentation, each regex may be an array of strings which are joined
|
||||
// with newlines into one regex string for use in terminal path hyperlink detection.
|
||||
"path_hyperlink_regexes": [
|
||||
// Python-style diagnostics
|
||||
"File \"(?<path>[^\"]+)\", line (?<line>[0-9]+)",
|
||||
|
||||
Reference in new issue
Block a user