nvim-lspconfig
nvim-lspconfig copied to clipboard
generate root_dir docs from source code
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
- Restore code generation removed in https://github.com/neovim/nvim-lspconfig/commit/9dc02492c4a457479f8a0ec7a65aac1852ff59c0 and...
- 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)) - or just fix the parsing.
- make it link to the source instead of trying to parse it (e.g.
- Use treesitter to parse the file?
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