diff options
author | kylo252 <[email protected]> | 2021-08-03 18:10:54 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-03 12:10:54 -0400 |
commit | 4c3c3f388557a182794bffdbf923129c66af885a (patch) | |
tree | 4138b428ccfbee42ffecdbc88bc7d2d42fa67195 /lua/lsp/init.lua | |
parent | b608b08ff3a5f28e7c57bc7bd7a30cfe2ab5c111 (diff) |
feat: add lvim.lsp.smart_cwd (#1218)
- Enable querying the language-server for the `root_dir`
- Use `root_dir` to set the current working-directory (CWD)
- Make vim-rooter configurable and add an option to disable it
Inspired by "ahmedkhalf/lsp-rooter.nvim"
Diffstat (limited to 'lua/lsp/init.lua')
-rw-r--r-- | lua/lsp/init.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index b85dfcd2..66efdafc 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -83,6 +83,10 @@ function M.common_on_attach(client, bufnr) end lsp_highlight_document(client) add_lsp_buffer_keybindings(bufnr) + if lvim.lsp.smart_cwd then + vim.api.nvim_set_current_dir(client.config.root_dir) + require("core.nvimtree").change_tree_dir(client.config.root_dir) + end require("lsp.null-ls").setup(vim.bo.filetype) end |