Skip to content

test: end-to-end go-to-definition for wikilinks with periods in filenames - #2

Open
Feel-ix-343 wants to merge 1 commit into
mainfrom
devin/1781114645-period-wikilink-gd-regression
Open

test: end-to-end go-to-definition for wikilinks with periods in filenames#2
Feel-ix-343 wants to merge 1 commit into
mainfrom
devin/1781114645-period-wikilink-gd-regression

Conversation

@Feel-ix-343

Copy link
Copy Markdown

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 on main in 52aa8ac3 ("Fix go-to-definition for files with dots in names", issue Feel-ix-343#344), which dropped \. from the WIKI_LINK_RE filepath class. But every test that commit added asserts only parsing via Reference::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_RE pattern has been rewritten 5× in this file's history, and a parse-only test does not catch a regression in the parse → Referenceable matching → Location chain that gotodef::goto_definition actually walks.

The test builds a real Vault from a temp dir and asserts gd resolves to the dotted file:

// note.md: "- [[CandS Exa 3 v9.1 Repro Rerun|9.1]] reproduces results"
// + file:  "CandS Exa 3 v9.1 Repro Rerun.md"
let vault = Vault::construct_vault(&settings, &dir)?;
let locations = goto_definition(&vault, Position { line: 2, character: 10 }, &note)
    .expect("gd returned None for a period-containing wikilink");
assert!(locations.iter().any(|l| l.uri.to_file_path()? == target));

Verification: full suite cargo test passes; cargo fmt --check clean; cargo clippy --tests adds no new warnings.

Note: this is test-only — no production change. The underlying fix is on main but unreleased (latest tag v0.25.10 predates 52aa8ac3), so a release is what ships it to editors.

Link to Devin session: https://app.devin.ai/sessions/a634af9155e846ac82fa63a8f57f35ab
Requested by: @Feel-ix-343

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-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown

Runtime test: go-to-definition on period-containing wikilinks

Tested in Helix on a vault with the exact note scenario (- [[CandS Exa 3 v9.1 Repro Rerun|9.1]] + the target file CandS Exa 3 v9.1 Repro Rerun.md). Same file, same cursor (5:18, on the 9 in v9.1), same keypress (g d) — the only variable between phases is the markdown-oxide binary.

  • It should fail gd on a period wikilink (pre-fix 52aa8ac3~1): passed — status line shows No definition found.
  • It should resolve gd on a period wikilink (fixed main): passed — gd opens CandS Exa 3 v9.1 Repro Rerun.md.
Before / after (click images to enlarge)
🔴 Pre-fix binary (52aa8ac3~1) 🟢 Fixed binary (main / 52aa8ac3)
Pre-fix: No definition found Fixed: jumped to dotted file
g d → red "No definition found.", buffer stays on PeriodLinkTest.md g d → editor opens CandS Exa 3 v9.1 Repro Rerun.md
Recording (both phases)

period-link gd recording

Cross-checks
  • Bisect: 52aa8ac3~1 → gd resolves false; 52aa8ac3true. The commit is exactly the turning point.
  • Real agent-knowledge vault: on main, gd on both period links in 2026-06-10.md resolves; neither is flagged as an Unresolved Reference diagnostic.
  • Unit: cargo test 76/76 pass, cargo fmt --check clean, cargo clippy --tests no new warnings.
  • Note: the fix is on main but unreleased (latest tag v0.25.10 predates 52aa8ac3); a release ships it to editors. This PR is test-only.

Tested by Devin — session: https://app.devin.ai/sessions/a634af9155e846ac82fa63a8f57f35ab

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.

1 participant