Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds support for Go-style doc links and Flow diagram for updated candidate matching with # separator supportflowchart TD
A[input_text_with_doc_link] --> B[apply_patterns]
B --> C{matches_pattern_with_separator}
C -->|uses : , @ parentheses or #| D[extract_filepath_line_column]
C -->|no_match| E[try_next_pattern]
E --> B
D --> F[open_file_at_position]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- You added
#as a separator in the mainpatternstable but not intrailing_patterns; if trailing patterns are used for the same kind of link detection, they likely need the same update to keep behavior consistent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You added `#` as a separator in the main `patterns` table but not in `trailing_patterns`; if trailing patterns are used for the same kind of link detection, they likely need the same update to keep behavior consistent.
## Individual Comments
### Comment 1
<location path="lua/pathfinder/candidates.lua" line_range="9-13" />
<code_context>
- { pattern = "(%S-)%s*[,:@%(]?%s*line%s*(%d+)" },
- { pattern = "(%S-)%s*[,:@%(]?%s*on%s*line%s*(%d+)[,:]?%s*column%s*(%d*)" },
- { pattern = "(%S-)%s*[,:@%(]?%s*on%s*line%s*(%d+)" },
+ { pattern = "([%w:/%.%-_]-)%s*[,:@%(#]%s*(%d+)%s*[,:]?%s*(%d*)" },
+ { pattern = "([%w:/%.%-_]-)%s*[,:@%(#]?%s*line%s*(%d+)[,:]?%s*column%s*(%d*)" },
+ { pattern = "([%w:/%.%-_]-)%s*[,:@%(#]?%s*line%s*(%d+)" },
+ { pattern = "([%w:/%.%-_]-)%s*[,:@%(#]?%s*on%s*line%s*(%d+)[,:]?%s*column%s*(%d*)" },
+ { pattern = "([%w:/%.%-_]-)%s*[,:@%(#]?%s*on%s*line%s*(%d+)" },
}
</code_context>
<issue_to_address>
**issue:** Restricting the filename capture to [%w:/%.%-_] may break matching of valid paths or identifiers.
The old `%S-` pattern matched any non-whitespace sequence, which safely covered most file paths and identifiers. The new `[%w:/%.%-_]` class omits characters like backslashes (Windows paths), tildes, Unicode, and other symbols commonly found in filenames and URLs, so diagnostics from some tools may no longer be parsed correctly. Consider reverting to a broader class (e.g. `%S-`) or explicitly broadening this character class to cover the full range of expected path/identifier characters.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This PR tries to address the issue #10 I've recently open, but also adds a
#as supported filename#line,col separator.I've been working on a Go project and notice that I can't jump to a file which a go doc is referencing to.
As an example take a look a the following code:
As you can see from the following image, after applying the fix from the previosly mentioned issue.
The file URI is now highlighted but it doesn't recognize the line and col after
<leader>gF.After adding the
#as a supported separator it works as expected:Also, here is how the example from the issue looks like after the fix using
<leader>gF:Summary by Sourcery
Extend file and position detection patterns to better support structured file references, including Go doc style links.
Enhancements:
#as a supported separator between filenames and line/column positions for link detection.