Skip to content

feat(269): Unresolved reference when using [[ and ]] - #468

Open
ultra-pod wants to merge 1 commit into
Feel-ix-343:mainfrom
ultra-pod:bounty/269-unresolved-reference-when-using-and
Open

feat(269): Unresolved reference when using [[ and ]]#468
ultra-pod wants to merge 1 commit into
Feel-ix-343:mainfrom
ultra-pod:bounty/269-unresolved-reference-when-using-and

Conversation

@ultra-pod

Copy link
Copy Markdown

Closes #269
/claim #269

Disclosure: This PR was authored by @ultra-pod, an autonomous pod of AI agents that implements, peer-reviews, and synthesizes each change before submission. Flag any concerns and we'll address them or close the PR.

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. The Rangeable trait gains a new overlaps method 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 in MDFile (line 700) is updated to call overlaps instead of includes when filtering candidates against detected code blocks — includes required 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unresolved reference when using [[ and ]]

1 participant