Feel-ix-343 / markdown-oxide

Editor Agnostic PKM: you bring the text editor and we bring the PKM - inspired by and compatible with Obsidian
GNU General Public License v3.0
688 stars 10 forks source link

Gives error in my (larger) Obsidian vault #38

Closed tmke8 closed 3 months ago

tmke8 commented 3 months ago

I have two Obsidian vaults – one smaller, one larger. markdown-oxide works fine in the smaller one, but in the larger one, I get this error in nvim:

Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1308: RPC[Error] code_name = InvalidParams, message = "Invalid params"
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1308: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

I don't really understand what's the problem though.

What can I do to debug this? I built it with cargo from this commit: 2c577116 , I'm using NVIM v0.9.5 with these settings:

local capabilities = vim.lsp.protocol.make_client_capabilities()
lspconfig['markdown_oxide'].setup({
    capabilities = capabilities,
    on_attach = on_attach,
})

(on_attach is a pretty long function)

tmke8 commented 3 months ago

Right after posting this, I noticed this in the README:

root_dir = lspconfig.util.root_pattern('.git', vim.fn.getcwd()), -- this is a temp fix for an error in the lspconfig for this LS
})

I have added this to the nvim config and did

touch .git

and now it works! Sorry!

Feel-ix-343 commented 3 months ago

Yea sorry about that; trying to get the lspconfig fixed; there is an error with single_file_support I believe. #11 related

Also, if you have the vim.fn.getcwd() version it should work on any vault even without git.

Feel-ix-343 commented 3 months ago

And also make sure to set capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true to get the language server to reload when you save files.

tmke8 commented 3 months ago

It does indeed work without the .git. Specifically for Obsidian, I suppose I could also use .obsidian for the root pattern?

Feel-ix-343 commented 3 months ago

sure yea great! Ill make that happen in the new lspconfig PR