debugging watcher
This commit is contained in:
parent
e11a8036d6
commit
ec295c9438
|
@ -95,13 +95,28 @@ function M.watch_compile_commands(dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
watcher:start(watch_path, { recursive = true }, function(err, fname, status)
|
watcher:start(watch_path, { recursive = true }, function(err, fname, status)
|
||||||
|
vim.schedule(function()
|
||||||
print('[clangd] Watcher triggered: ', fname, vim.inspect(status))
|
print('[clangd] Watcher triggered: ', fname, vim.inspect(status))
|
||||||
|
end)
|
||||||
if err then
|
if err then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.notify('[clangd] Watcher error: ' .. err, vim.log.levels.ERROR)
|
vim.notify('[clangd] Watcher error: ' .. err, vim.log.levels.ERROR)
|
||||||
end)
|
end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if fname then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.notify('[clangd] File triggered: ' .. fname)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if fname and fname:match 'compile_commands%.json$' and status.change then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.notify '[clangd] Matched pattern for compile_commands.json'
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
if fname and fname:match 'compile_commands%.json$' and status.change then
|
if fname and fname:match 'compile_commands%.json$' and status.change then
|
||||||
if debounce_timer then
|
if debounce_timer then
|
||||||
debounce_timer.stop()
|
debounce_timer.stop()
|
||||||
|
|
Loading…
Reference in New Issue