test: end-to-end go-to-definition for wikilinks with periods in filenames - #2
Open
Feel-ix-343 wants to merge 1 commit into
Open
test: end-to-end go-to-definition for wikilinks with periods in filenames#2Feel-ix-343 wants to merge 1 commit into
Feel-ix-343 wants to merge 1 commit into
Conversation
Adds an end-to-end go-to-definition test for the scenario in issue Feel-ix-343#344: a wikilink whose target contains a period (e.g. [[CandS Exa 3 v9.1 Repro Rerun|9.1]]) must resolve to the dotted file. Existing tests only cover parsing via Reference::new; this exercises the full resolution path (parse -> referenceable matching -> Location) that go-to-definition uses. Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
🤖 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:
|
Runtime test: go-to-definition on period-containing wikilinksTested in Helix on a vault with the exact note scenario (
Before / after (click images to enlarge)
Cross-checks
Tested by Devin — session: https://app.devin.ai/sessions/a634af9155e846ac82fa63a8f57f35ab |
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
Adds an end-to-end go-to-definition regression test for wikilinks whose target contains a period (e.g.
[[CandS Exa 3 v9.1 Repro Rerun|9.1]]). The fix for this already landed onmainin52aa8ac3("Fix go-to-definition for files with dots in names", issue Feel-ix-343#344), which dropped\.from theWIKI_LINK_REfilepath class. But every test that commit added asserts only parsing viaReference::new; none exercise the full LSP resolution path. This adds that missing coverage so a future regex/parser change can't silently re-break gd on dotted filenames.Why it matters: the
WIKI_LINK_REpattern has been rewritten 5× in this file's history, and a parse-only test does not catch a regression in the parse →Referenceablematching →Locationchain thatgotodef::goto_definitionactually walks.The test builds a real
Vaultfrom a temp dir and asserts gd resolves to the dotted file:Verification: full suite
cargo testpasses;cargo fmt --checkclean;cargo clippy --testsadds no new warnings.Note: this is test-only — no production change. The underlying fix is on
mainbut unreleased (latest tagv0.25.10predates52aa8ac3), so a release is what ships it to editors.Link to Devin session: https://app.devin.ai/sessions/a634af9155e846ac82fa63a8f57f35ab
Requested by: @Feel-ix-343