Add file watching in the server as a fallback for editors that don't support it #1456
Labels
enhancement
New feature or request
help-wanted
Extra attention is needed
pinned
This issue or pull request is pinned and won't be marked as stale
We ask editors to watch Ruby files for us here, which we use to update the codebase index upon modifications.
However, the registration may fail in two ways: some editors don't support dynamic feature registration and some don't support file watching. In those cases, only the declarations from the original indexing will be available since we will never receive the modification events.
We can use the listen gem to provide a fallback and listen to modifications from the server when file watching is not available.
This is suboptimal from a performance standpoint since having the editor watch files means that it can broadcast the modification events to all parties interested in handling those - as opposed to having each server watch files on their own. However, it's better than never updating the index.
Questions
File watching is available for VS Code. Is it also available for other popular editors such as NeoVim, Emacs, Sublime?
Implementation suggestion
My suggestion is adding an else statement where we register for file watching. In the else branch, we would:
We should evaluate if there's any way to share the current handler for modifications, with the one using listen.
The text was updated successfully, but these errors were encountered: