nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

generate root_dir docs from source code

Open justinmk opened this issue 3 years ago • 1 comments

Problem

https://github.com/neovim/nvim-lspconfig/issues/1742 reported that the generated docs for root_dir are sometimes invalid. The response was https://github.com/neovim/nvim-lspconfig/commit/9dc02492c4a457479f8a0ec7a65aac1852ff59c0 which just removed the generation: https://github.com/neovim/nvim-lspconfig/commit/733fe92baafb23cb413300571e31cb1fec962b1a

Besides being cumbersome, the manual documentation leads to problems like: https://github.com/neovim/nvim-lspconfig/pull/2006

Solution

  1. Restore code generation removed in https://github.com/neovim/nvim-lspconfig/commit/9dc02492c4a457479f8a0ec7a65aac1852ff59c0 and...
    1. make it link to the source instead of trying to parse it (e.g. [path/to/foo.lua](https://github.com/neovim/nvim-lspconfig/blob/…/foo.lua#L132-L149))
    2. or just fix the parsing.
  2. Use treesitter to parse the file?

justinmk avatar Jul 17 '22 20:07 justinmk

this would also fix e.g. rnix's docs saying that root_dir defaults to "vim's starting directory" when in fact it's util.find_git_ancestor(fname) or vim.loop.os_homedir(), which is very much not the same thing

keysmashes avatar Nov 06 '22 14:11 keysmashes