Skip to content

feat(watcher): fs_poll -> fs_event, destroy nodes/watchers #1431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 17, 2022

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Jul 17, 2022

requires #1430

Back to fs_event, as we now have thread safe and queued debouncing.

Watchers are destroyed via node destruction.

I'd like to make nodes into a proper class, however I'll do that in a later PR. node_destroy will do for now.

Tested a variety of git projects; tmpfs events are now properly fired 🎩

@@ -46,12 +46,13 @@ function M.create_watcher(absolute_path)
end

log.line("watcher", "node start '%s'", absolute_path)
Watcher.new {
return Watcher.new {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

@@ -29,8 +29,8 @@ function M.reload_project(project_root, path)
return
end

if path and not path:match("^" .. project_root) then
path = nil
if path and path:find(project_root, 1, true) ~= 1 then
Copy link
Member Author

@alex-courtis alex-courtis Jul 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was pattern matching the file name 🤦

Resolves #1373 (comment)

stat = false,
-- recursive is not functional in neovim's libuv implementation
recursive = false,
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in for documentation purposes.

@alex-courtis alex-courtis requested a review from kyazdani42 July 17, 2022 06:09
@kyazdani42 kyazdani42 merged commit 386c6f7 into 1317-throttle-diagnostics Jul 17, 2022
@kyazdani42 kyazdani42 deleted the feat/watcher-fs-events branch July 17, 2022 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants