-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Listen to file changes via watching #365
Comments
I have currently run into the edge case of To be honest though, isn't this something the core should handle? |
That is indeed currently a bug as there is no one listening to these removals and the core doesn't pick them up until the next project reindex, which automatically prunes existing files - to mitigate this a bit. At first I also thought this is something the core should handle, but the language server specification indicates the client should do the watching and send it to the server. This is now possible since a couple of Atom versions ago, hence this ticket. A couple of reasons for doing so are listed there as well. Another reason would be that the server and client don't necessarily have to share the same filesystem (i.e. in remote scenario's). The LSP doesn't officially mention it but there is an extension about it floating about somewhere. |
This is implemented in master as a part of #460. |
Atom 1.21 added functionality to watch files and folders in specific paths for changes. We should use this to send the appropriate reindex events.
The core currently provides no mechanism to remove files from the index, it automatically prunes the index on every folder index as compensation. This, however, results in weird edge cases where you remove a file from the workspace, but the class inside it remains available for a while (because the core did not pick it up yet).
In a language server scenario, the client has to do all the watching and send the appropriate events to the server anyway, so this is a step in the right direction in any case.
This will also obsolete the need for watching the Git repository for changes, though we'll have to test how this behaves with branch switching via Git.
The text was updated successfully, but these errors were encountered: