Skip to content

Conversation

@subtleGradient
Copy link

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).

Copilot AI review requested due to automatic review settings December 20, 2025 17:43
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 20, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves jump-to-definition reliability for file paths embedded in prose text (comments, markdown, documentation) by implementing smarter punctuation stripping. The changes enable cmd/ctrl-click navigation on file paths wrapped in common punctuation patterns like markdown backticks, parentheses, brackets, and sentence-ending punctuation.

Key Changes:

  • Enhanced link_pattern_file_candidates to iteratively strip leading and trailing punctuation characters from file path candidates
  • Introduced ordered candidate generation (trimmed → regex-extracted → raw) with deduplication
  • Refactored test_hover_filenames to use a DRY approach with a base document and targeted line replacements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@subtleGradient subtleGradient marked this pull request as draft December 20, 2025 17:54
@subtleGradient subtleGradient force-pushed the markdown-jump-to-def-improved-candidates branch 2 times, most recently from 207b9bb to d026e11 Compare December 20, 2025 18:06
Handles markdown and prose patterns like [title](path), `path`, (path),
and partial wrappers. Returns candidate file paths ordered from most-
specific (trimmed) to least-specific (raw). Expands and updates tests
for various edge cases.
@subtleGradient subtleGradient force-pushed the markdown-jump-to-def-improved-candidates branch from d026e11 to 921a08d Compare December 20, 2025 18:12
@subtleGradient subtleGradient marked this pull request as ready for review December 20, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant