-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
Improve performance of project file watch setup #2752
Conversation
I'm having a hard time understanding these test failures, looks like something is wrong with Emacs 26.x in my thing but I can't quite figure out what |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I am still to perform manual testing.
@jcs090218 any idea why CI is red? Seems like we are fetching a package that depends on emacs 27.1 and all 26.x are failing?
lsp-mode.el
Outdated
(lsp-log "Creating watch for %s" dir) | ||
(when (or | ||
(not warn-big-repo?) | ||
(not lsp-file-watch-threshold) | ||
(let ((number-of-files (length (lsp--directory-files-recursively dir ".*" ignored-directories t)))) | ||
(let ((number-of-files (length dirs-to-watch))) | ||
(or | ||
(< number-of-files lsp-file-watch-threshold) | ||
(condition-case _err | ||
(lsp--ask-about-watching-big-repo number-of-files dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the wording in that method because we are no longer counting files.
lsp-mode.el
Outdated
(and (f-dir-p full-path) | ||
(not (equal path ".")) | ||
(not (equal path "..")) | ||
(not (lsp--string-match-any ignored-directories full-path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always close the brackets on the same line, here and on a few more places in the PR.
This improves performance through a couple of strategies: - Only check if a directory is an ignored directory once. Previously the filter was in multiple parts of the the chain. - When setting up watches, only generate a list of directories (as files end up getting filtered out later anyways) - Directly list directory contents when recursively fetching items, instead of relying on completion code
Sorry, forgot to comment but I went over the comments and tried to clean up the indentation and the naming (also updated the file warning to try and make it clearer that this is a directory count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing to lsp-mode
and sorry for the delay.
This improves performance through a couple of strategies:
(See related discussion here)