"Unresolved Reference" on .md files in subfolders
Summary
Links to md files in subdirectories from the root are not found by the LSP I have a strange feeling that I'm missing something obvious in my setup
My setup code using Mason:
--setting up replace using Blink rather than cmp, seems to work fine
local capabilities = require('blink.cmp').get_lsp_capabilities()
local servers = {
lua_ls = {
settings = {
Lua = {
completion = {
callSnippet = 'Replace',
},
},
},
},
markdown_oxide = {
capabilities = vim.tbl_deep_extend('force', capabilities, {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
}),
},
}
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'biome',
'lua_ls',
'stylua',
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
I am also experiencing the same thing
π Feel-ix-343 is offering a $5 bounty for this issue. View and reward the bounty at algora.io/Feel-ix-343/markdown-oxide/issues/274
π Got a pull request resolving this? Claim the bounty by commenting /claim #274 in your PR and joining algora.io
Hello @yaboibigjohn β I tried to reproduce the issue but couldnβt.
Test layout
issue_274/
βββ outer1.md
βββ outer2.md
βββ subdir/
βββ inner.md
References from inner.md to outer1.md and outer2.md work as expected, and the reverse (outer to inner) also works.
From from what I've read of the codebase, markdown-oxide takes the workspace root from the LSP client (editor/IDE) and indexes all Markdown files under that root for reference resolution.
If you open your editor at the project root (issue_274/), cross-file references in subdirectories should resolve. If you instead open a single file directly, like this:
cd issue_274/subdir
$EDITOR inner.md
then the workspace root becomes subdir/, so only that subtree is indexed.
Iβm using Helix on NixOS. From your screenshot it looks like Neovim on WSL. There could be editor/platform differences. If the issue stems from how the project is opened, you might try setting the working directory to the desired root (:cd {desired_root_dir}, according to the docs).
If itβs not a workspace-root issue, could you share how youβre opening the project and confirm your editor/OS? Thanks!
Hi, This is not an issue in markdown-oxide. It is job of the client(neovim, helix, etc) to determine the workspace root and send it to the server(markdown-oxide lsp) when it is first initialized.
Please update the root marker in your respective editor.
For @yaboibigjohn, I assume its neovim. Based on docs it should look something like this:
vim.lsp.config['markdown_oxide'] = {
cmd = { 'markdown-oxide' },
filetypes = { 'markdown' },
-- important, add .obsidian as a root marker
root_markers = { '.obsidian', '.git' },
}
I think Mason is just a lsp manager, so it probably won't have options to configure this. I don't personally use neovim, so you might have to check a little.
Im having the same issue, i can not "Go to the definition" in Helix when i have a file (.md) in a subfolder inside the root folder. Im using w11 and helix 25.07, i tried everything, i attach the error in log in helix:
2025-10-31T00:15:09.145 helix_term::application [ERROR] Language Server: Method workspace/semanticTokens/refresh not found in request 1 2025-10-31T00:16:14.125 helix_lsp::util [ERROR] Invalid LSP range start Position { line: 3, character: 2 } > end Position { line: 3, character: 1 }, using an empty range at the end instead 2025-10-31T00:16:15.776 helix_lsp::util [ERROR] Invalid LSP range start Position { line: 3, character: 2 } > end Position { line: 3, character: 1 }, using an empty range at the end instead 2025-10-31T00:18:04.524 helix_term::application [ERROR] Language Server: Method workspace/semanticTokens/refresh not found in request 2 2025-10-31T00:21:09.383 helix_term::application [ERROR] Language Server: Method workspace/semanticTokens/refresh not found in request 3 2025-10-31T00:22:33.084 helix_term::application [ERROR] Language Server: Method workspace/semanticTokens/refresh not found in request 4
I found that in Helix, links are resolved relative to the project root, rather than relative to the current file's directory.
So, ./sub_dir/file doesn't work, but ./current_dir/sub_dir/file does.
Hi @Huliiiiii
Thanks for pointing that out. I resolved the issue by installing Helix on WSL2 (Ubuntu in Windows) along with the IWE extension, and all problems were solved.