Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with default root_dir setup #88

Open
clobrano opened this issue May 17, 2024 · 9 comments
Open

Problems with default root_dir setup #88

clobrano opened this issue May 17, 2024 · 9 comments

Comments

@clobrano
Copy link

clobrano commented May 17, 2024

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.

@Feel-ix-343
Copy link
Owner

Hey!

Could you share the result of lspinfo?

I think there is an issue with root_dir possibly

@clobrano
Copy link
Author

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 

@Feel-ix-343
Copy link
Owner

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?

@clobrano
Copy link
Author

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

@Feel-ix-343
Copy link
Owner

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

@clobrano
Copy link
Author

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',
    },
  },

@Feel-ix-343
Copy link
Owner

Ok thanks Ill investigate

@Feel-ix-343 Feel-ix-343 added this to the Refined Markdown Oxide milestone May 17, 2024
@Feel-ix-343 Feel-ix-343 changed the title Unresolved reference for any file that is not open in its own buffer Poor default root_dir setup May 17, 2024
@clobrano
Copy link
Author

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

@Feel-ix-343
Copy link
Owner

Awesome!

@clobrano clobrano changed the title Poor default root_dir setup Problems with default root_dir setup Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants