zed/crates/editor
Tom Aylott ee5c7b6d45
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Improve link pattern parsing to trim punctuation wrappers (#45457)
Closes # (none)

## Summary

Improved the jump-to-definition reliability for file paths in prose
strings (comments, markdown, etc.) by smarter stripping of surrounding
punctuation.

This allows `cmd/ctrl-click` to work on file paths in contexts like:
- **Markdown backticks**: `` `path/to/file` ``
- **Markdown links**: `[link](path/to/file)`
- **Parentheses**: `(see path/to/file)`
- **Sentence endings**: `Check path/to/file.`
- **Code spans**: `` `cat path/to/file` ``

## Technical Details

- Updated `link_pattern_file_candidates` in `hover_links.rs` to
iteratively trim common leading and trailing punctuation characters.
- Candidate generation now produces multiple variations (trimmed, regex
match, raw) ordered by specificity (most trimmed first).
- Refactored `test_hover_filenames` to be DRY: it now uses a single base
document string and targeted replacements, making it easier to add new
prose test cases without duplication.

Release Notes:

- Improved jump-to-definition reliability for file paths wrapped in
punctuation (backticks, parens, sentence endings).

---------

Co-authored-by: Martin Ye <martin@zed.dev>
Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
2026-05-20 22:51:14 +00:00
..
benches theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
src Improve link pattern parsing to trim punctuation wrappers (#45457) 2026-05-20 22:51:14 +00:00
Cargo.toml editor: Add base64 encode/decode commands (#55361) 2026-05-05 04:36:18 +00:00
LICENSE-GPL