artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
1.94k stars 35 forks source link

Support configurable `root_dir` for nvim_lspconfig #205

Open mnddm opened 1 year ago

mnddm commented 1 year ago

Hello there!

Looks like for now Marksman recognize the root_dir by these set of files and directories:

  1. ".marksman.toml"
  2. ".git"
  3. ".hg"
  4. ".svn"

See here for code.

I faced with issue when I try to configure Marksman for nvim-lspconfig with root_dir for Obsidian vault like this:

local util = lspconfig.util
…
root_dir = uti.root_pattern(".git", ".marksman.toml", ".obsidian")
…

and unfortunately it didn't work.

artempyanykh commented 1 year ago

Thanks for raising this @mnddm! Due to some other editors supplying bogus workspace roots I had to hard-code a set of recognisable markers. I'm fine to extend it to cover ".obsidian" too, however.

mnddm commented 1 year ago

Hi, @artempyanykh! It would be great if you can support .obsidian as a root_dir anchor. Thank you.

reorx commented 1 year ago

@mnddm why not adding .marksman.toml in your obsidian vault, I tried and it works fine. IMHO there shouldn't be too many special cases to hard-code, .marksman.toml looks great as a standard option, just like .editorconfig or .eslintrc for other project based tools.