Skip to content

fix: resolve subfolder wiki links on Windows - #493

Open
zacharywomack8-source wants to merge 1 commit into
Feel-ix-343:mainfrom
zacharywomack8-source:fix-subfolder-link-resolution
Open

fix: resolve subfolder wiki links on Windows#493
zacharywomack8-source wants to merge 1 commit into
Feel-ix-343:mainfrom
zacharywomack8-source:fix-subfolder-link-resolution

Conversation

@zacharywomack8-source

Copy link
Copy Markdown

Fixes #274

On Windows, \diff_paths\ produces native backslash separators, so a file at \�ault/subfolder/file.md\ got the refname path \subfolder\file. Link text always uses forward slashes ([[subfolder/file]]), so \matches_path_or_file\ compared \subfolder/file\ against \subfolder\file\ and never matched -- causing false "Unresolved Reference" diagnostics and broken go-to-definition for any link into a subfolder. Linux/macOS were unaffected, which matches the reports: reproducible on Windows (see comments) but not on NixOS.

This normalizes refname paths to forward slashes in \get_obsidian_ref_path\ (the single source of refnames for diagnostics, go-to-definition, completions, backlinks), makes \link_file_key\ separator-agnostic, and defensively normalizes in \matches_path_or_file.

Verified:

  • \cargo build\ clean
  • \cargo test: 78 passed, 0 failed
  • \cargo fmt --check\ clean
  • new regression test: \subfolder_link_resolves_on_windows_separators\

/claim #274
Generated by Agent Core

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" on .md files in subfolders

1 participant