diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-02-07 11:28:35 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-03-01 23:00:20 +0000 |
commit | 4ff3217bbd8747d2d44680a825ac29097faf9c4b (patch) | |
tree | 22b024bfa5738a0556a88f9a35fca8cbe619841a /runtime/lua/vim/lsp/_watchfiles.lua | |
parent | 816b56f878f0291c00a9018d5057b7b2b00f1891 (diff) | |
download | rneovim-4ff3217bbd8747d2d44680a825ac29097faf9c4b.tar.gz rneovim-4ff3217bbd8747d2d44680a825ac29097faf9c4b.tar.bz2 rneovim-4ff3217bbd8747d2d44680a825ac29097faf9c4b.zip |
feat(lsp): add fswatch watchfunc backend
Problem:
vim._watch.watchdirs has terrible performance.
Solution:
- On linux use fswatch as a watcher backend if available.
- Add File watcher section to health:vim.lsp. Warn if watchfunc is
libuv-poll.
Diffstat (limited to 'runtime/lua/vim/lsp/_watchfiles.lua')
-rw-r--r-- | runtime/lua/vim/lsp/_watchfiles.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/_watchfiles.lua b/runtime/lua/vim/lsp/_watchfiles.lua index c66a76feae..49328fbe9b 100644 --- a/runtime/lua/vim/lsp/_watchfiles.lua +++ b/runtime/lua/vim/lsp/_watchfiles.lua @@ -9,6 +9,8 @@ local M = {} if vim.fn.has('win32') == 1 or vim.fn.has('mac') == 1 then M._watchfunc = watch.watch +elseif vim.fn.executable('fswatch') == 1 then + M._watchfunc = watch.fswatch else M._watchfunc = watch.watchdirs end @@ -177,4 +179,3 @@ function M.cancel(client_id) end return M - |