-
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
ST API: Missing support for workspace/didChangeWatchedFiles #892
Comments
I'll create test project and investigate more when I have time. Just wanted to log this as it bothered me for a while now. |
My first instinct, without having used vue-lsp, is that we don't support workspace/didChangeWatchedFiles. |
Yes, you are most likely right. I've set-up a project with instructions at https://github.com/rchl/test-sublime-lsp-type-bug When checking VSCode, I can see it triggering
right after I make a change in The fact that the pure JS or TS file sees the changes immediately is probably because for that file LSP-vue is actually not used. Just a pure typescript server is, instead. |
See: #516, and sublimehq/sublime_text#2669. |
Extra note: Instead, its VSCode extension part (since vetur is composed of server and vscode extension) registers watcher at https://github.com/vuejs/vetur/blob/8b82c92a232086167af2969b42a6cc0218cf5c2e/client/client.ts#L53 . So which files are to be watched is server-specific and so that would have to be decided per-server (in this case in |
Does it make sense to have LSP provide a watcher API that language handlers can hook into ? |
I don't think there is any good existing python library that we could use. I've implemented this feature using one of them but it was missing support for glob patterns which is required for LSP and wasn't using the most efficient file watching technique (on mac at least) so it introduced a significant overhead. So if it'd be for me, I would probably go for node-based file watcher and a thin layer on top to provide an API. Of course with node there is a problem that it's not always available on the system. |
The alternative would be to embed a small binary with LSP ? |
Not sure about the |
no I wasn't talking about node but a dedicated binary utility that does only the file watching part |
I fear that a dependency on a compiled binary would be a major pain to maintain. The package is pure-python now, so it automatically works on Apple Silicon (whether emulated darwin-x86_64 or native darwin-arm64), Nintendo Switch (linux-arm64, confirmed working), you name it. |
Not only that, but Sublime Text already allocates a ton of file descriptors for its file watchers. So we would be halving the available file descriptors if we were to also track files. EDIT: Well, maybe plugin_host gets a new set of file descriptors allocated because it's a separate process. |
IMO I only see two options:
|
For the record, I've created https://packagecontrol.io/packages/LSP-file-watcher-chokidar which provides support for this notification in LSP until we'll get an API from ST that we could switch to. |
Vue project with TS configuration in
tsconfig.json
and custom types intypes/index.d.ts
.Editing types in
types/index.d.ts
doesn't get reflected in *.vue file if I'm referring to those types there.It works in plain *.js files (those pick up changes to types immediately).
My workaround is to trigger "LSP: Restart servers" command every time I change types.
No problem in VSCode.
The text was updated successfully, but these errors were encountered: