-
Notifications
You must be signed in to change notification settings - Fork 184
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
didChangeWatchedFiles using watchman #1674
Conversation
Haven't had a proper look at your changes yet but would just say that I have a "competing" solution that I've been using privately and is based on chokidar node package. It's not really finished though and there is likely no agreement whether we'd want that, even if finished. Also, you seem to be reimplementing glob handling which we should already have support for through the wcmatch dependency |
Hi @rchl! Saw your work also, but I may have misunderstood that you wanted to solve it through a few LSP-* language packages only? Thanks for the hint about wcmatch - there is no wish to implement glob matching on the LSP side, but watchman did not understand the |
The glob patterns are described here: https://microsoft.github.io/language-server-protocol/specification.html#documentFilter If watchman understands a subset we would need some kind of translation layer |
Hello :) You are right. I forgot that it's not LSP that has to support it but the watcher itself... Using chokidar at least guarantees that the LSP spec requirements are supported. For example It's true that currently my solution only works within the LSP-* packages that use |
I agree the chokidar solution makes sense for the (majority?) of users who are already using node-based servers as it's likely much more complete. What would it take for your solution to become something like a LSP-watcher-chokidar package that works for all language servers? Could we leave LSP interface watcher so that I could contribute an LSP-watcher-watchman package in the future? |
We should first agree on what everyone wants so that we don't work on something that won't be accepted later. Do we want to extend LSP with some interface to allow packages like LSP-watcher-* to enable the watching functionality for LSP? That would require supporting registering capability dynamically and also supporting the watcher configuration in the client configuration since some servers (LSP-vue, LSP-eslint) don't use dynamic capabilities for that and require client to define the watchers. |
I think that could go in lsp_utils, right?
There are these two callbacks for plugins:
|
It could but would we then make LSP depend on
I think we want to support that functionality on the ClientConfig level, even without having a plugin. |
For simplicity's sake I suggest a
This is not protocol based, right? Would it suffice to expose a |
But to use the API one needs to create an LSP-* plugin right? In that case I already have solution that does that. But that means that clients defined within the It might be OK of course but I wanted to have a complete solution that we could just plug-in the ST API into in the future, once its ready.
The notifications ( |
Created something like that at #1764 |
superseded by #1764 |
Now also released implementation through an additional package https://packagecontrol.io/packages/LSP-file-watcher-chokidar |
This is a proposal for an (interim?) solution for users who want file change notifications to their servers using facebook watchman before a potential API for this arrives in Sublime (so, issue #892)
I know Raoul commented that having a "hard" dependency (or a python package or a binary) would introduce a fair bit of maintenance pain - my thought would be to enable the support if the user opts-in and has watchman on their path for that reason.
It uses a named socket, so it is otherwise similar to TCP communication to language servers.
This was only partially tested using Metals which has a pretty nice set of globs it requests.
It would need quite a bit more testing: