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 /test/functional/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 'test/functional/lua')
-rw-r--r-- | test/functional/lua/watch_spec.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/functional/lua/watch_spec.lua b/test/functional/lua/watch_spec.lua index fa84459b67..115fee8091 100644 --- a/test/functional/lua/watch_spec.lua +++ b/test/functional/lua/watch_spec.lua @@ -21,6 +21,15 @@ describe('vim._watch', function() local function run(watchfunc) it('detects file changes (watchfunc=' .. watchfunc .. '())', function() + if watchfunc == 'fswatch' then + skip(is_os('mac'), 'flaky test on mac') + skip( + not is_ci() and helpers.fn.executable('fswatch') == 0, + 'fswatch not installed and not on CI' + ) + skip(is_os('win'), 'not supported on windows') + end + if watchfunc == 'watch' then skip(is_os('bsd'), 'Stopped working on bsd after 3ca967387c49c754561c3b11a574797504d40f38') else @@ -95,6 +104,7 @@ describe('vim._watch', function() vim.uv.sleep(100) touch(watched_path) + vim.uv.sleep(100) os.remove(watched_path) vim.uv.sleep(100) @@ -113,5 +123,5 @@ describe('vim._watch', function() run('watch') run('watchdirs') + run('fswatch') end) - |