Feel-ix-343/markdown-oxide

Problems with cwd root-dir detection

clobrano opened this issue · 11 comments

I assume this might be some error in my configuration, but I see that any file that isn't already opened returns an "Unresolved reference" error. Even if the count of the references is working fine.

I created a test vault with this structure

tree
.
├── journal
│   ├── 2024-05-16.md
│   └── 2024-05-17.md
├── resources
│   └── some-data.md
└── tasks
    └── projectA.md

The current directory is the root of the vault (so above journal, resources and tasks) and only some-data is correctly referenced.

image

It seems to work better for files under the same folder though. I moved into journal and restarted the server and this made 2024-05-16 file correctly referenced.

Hey!

Could you share the result of lspinfo?

I think there is an issue with root_dir possibly

You might be right. That running in single file mode is suspect :)

Client: markdown_oxide (id: 3, bufnr: [5, 53])                                                                                                                                                                     
~                        filetypes:       markdown                                                                                                                                                                                         
~                        autostart:       true                                                                                                                                                                                             
~                        root directory:  Running in single file mode.                                                                                                                                                                     
~                        cmd:             /home/clobrano/.local/share/nvim/mason/bin/markdown-oxide 

Definitely.

In single file mode, root directory is the directory of the first opened file.

However, single file mode is unexpected on neovim; could you post your lspconfig for this?

Does it need a .obsidian file to detect the root folder? :)

That is one way; there is also .git, .moxide.toml and if not those, the cwd of neovim

It seems that the cwd option is not working well (at least in this configuration). I do use it with code, so it works with .git and as soon as I added .obsidian it worked in the test vault too.

my lsp config is a bit scattered through my files, not sure this is all

{ -- LSP Configuration & Plugins
    'neovim/nvim-lspconfig',
    dependencies = {
      -- Automatically install LSPs to stdpath for neovim
      { 'williamboman/mason.nvim', config = true },
      'williamboman/mason-lspconfig.nvim',

`require('fidget').setup({})`
      { 'j-hui/fidget.nvim',       tag = 'legacy', opts = {} },

      'folke/neodev.nvim',
    },
  },

Ok thanks Ill investigate

thank you! I was using [another markdown lsp] before, but this one is just awesome

Awesome!

Hey sorry for the delay -- was on vacation.

I think I will look more into this when I am making the #95

in v1 I will be rewriting all of this code, so I will fix this then.