Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Periodic reindexing was added as a fallback for when changes occur outside of the editor environment that could cause the index to get stale. However, this has a few drawbacks:
After further testing, I found that the editor does a good job of tracking files across the project and issuing
didChangeWatchedFilesevents. So I believe we can safely get rid of this periodic reindexing without issue. We still do a full scan on startup to look for stale files, so we shouldn't have any edge cases from editors not being open.If users start reporting stale index issues, we can revisit, but the potential solutions if the editor is missing changed files are either re-adding periodic indexing or tracking the files ourselves directly with fsevent, which work the editor should be handling. (Maybe there's another approach I'm missing though.)
Note
Medium Risk
Removes the 30s full-project reindex fallback, which reduces CPU/IO but may allow the index to become stale if editors fail to emit file-watcher events in some environments.
Overview
Removes the LSP server’s periodic 30-second
backgroundReindexticker and stops starting it duringInitialize, relying on startup indexing plus event-driven updates (e.g., watched file changes andwatchGitHead) to keep the index current.This eliminates recurring full filesystem crawls to reduce CPU and IO overhead, especially when multiple editors are running.
Reviewed by Cursor Bugbot for commit 475fc67. Bugbot is set up for automated code reviews on this repo. Configure here.