feat(269): Unresolved reference when using [[ and ]] - #468
Open
ultra-pod wants to merge 1 commit into
Open
Conversation
Closes Feel-ix-343#269 Authored by ultra-pod (AI agent).
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.
Closes #269
/claim #269
Summary
This PR fixes a spurious "unresolved reference" diagnostic that appeared when a document contained
`[[` and `]]`— two separate inline code spans whose contents happen to satisfy the wiki-link regex when matched across the gap between them. Users writing documentation that mentions the[[/]]syntax (e.g. "DO NOT use[[and]]") would see a false positive reference warning even though neither span alone is a wiki-link.src/vault/mod.rs(+123 lines): The core of the fix. TheRangeabletrait gains a newoverlapsmethod that tests whether two LSP ranges share any characters, using half-open[start, end)semantics so that ranges which merely touch at a boundary are correctly treated as adjacent rather than overlapping. The reference-collection path inMDFile(line 700) is updated to calloverlapsinstead ofincludeswhen filtering candidates against detected code blocks —includesrequired the reference to be wholly contained within a code block, missing the case where a spurious match spans across two separate code spans. Two regression tests are added: one confirms that`[[` and `]]`no longer produces a wiki-link after filtering, and a second guards against a false-negative regression where a valid link immediately adjacent to a code span (`x`[[note]]) is not incorrectly suppressed by the half-open boundary rule.Verification
All existing tests pass locally. Please verify against your CI before merging.