fix: exclude URI-scheme links (tel:, mailto:, etc.) from unresolved reference diagnostics - #415
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Conversation
…eference diagnostics Replaces the hardcoded http/https/data scheme checks with a general URI scheme detector (has_uri_scheme). Any link whose path starts with a valid RFC 3986 scheme (2+ chars before the colon) is now skipped during reference construction, preventing false 'Unresolved Reference' diagnostics for tel:, mailto:, ftp:, and other URI-scheme links. Closes #413 Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
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.
Summary
Fixes #413 —
tel:links (and other non-http URI schemes likemailto:,ftp:, etc.) were incorrectly flagged as "Unresolved Reference" by the diagnostics system.The root cause:
generic_link_constructoronly filtered outhttp://,https://, anddata:schemes. Any other URI scheme (e.g.tel:+12345678901) was treated as a file path reference, which then couldn't resolve to any file.This PR replaces the three hardcoded
starts_withchecks with a general-purposehas_uri_scheme()function that detects any valid RFC 3986 URI scheme (ALPHA *(ALPHA / DIGIT / "+" / "-" / ".") ":"). A minimum scheme length of 2 characters is enforced to avoid matching Windows drive letter paths likeC:\.Review & Testing Checklist for Human
XX+:...(2+ chars before colon) is skipped. Consider whether any legitimate vault file paths could contain colons that would be incorrectly filtered (e.g. on Linux, filenames with colons are technically valid).[+1 (234) 567 8901](tel:+12345678901)in an editor with markdown-oxide and confirm no "Unresolved Reference" diagnostic appears. Also verify that normal internal links (wikilinks and md-links) still produce diagnostics when unresolved.Notes
colon >= 2threshold was chosen to avoid Windows drive letters (C:\). No registered IANA URI scheme is a single character, so this should be safe in practice.has_uri_scheme_detection,tel_link_not_parsed_as_reference, andmailto_link_not_parsed_as_reference.has_uri_schemeandhas_non_markdown_extensionnow each have their own correctly attributed doc comments.Link to Devin session: https://app.devin.ai/sessions/3b678a7bfdd14b668c231efd4b8dc916
Requested by: @Feel-ix-343