mirror of
https://github.com/neovim/neovim.git
synced 2026-01-05 10:57:11 +10:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user