Instead of calling vim.loop.cwd() when the plugin is initialized, this pull request calls whatever function is stored in the config as get_root every time the LSP attaches to a buffer. I've set this to require("lspconfig.util").find_git_ancestor by default, which seems like a reasonable default.
I guess we might need to update the installation instructions, since we now depend on lspconfig, or perhaps it would be better just to set a different default (vim.loop.cwd(), but called every time the server is updated, maybe).
Fixes #212
Instead of calling
vim.loop.cwd()
when the plugin is initialized, this pull request calls whatever function is stored in the config asget_root
every time the LSP attaches to a buffer. I've set this torequire("lspconfig.util").find_git_ancestor
by default, which seems like a reasonable default.I guess we might need to update the installation instructions, since we now depend on
lspconfig
, or perhaps it would be better just to set a different default (vim.loop.cwd()
, but called every time the server is updated, maybe).