vim-lsp icon indicating copy to clipboard operation
vim-lsp copied to clipboard

Add support for workspace/didChangeWatchedFiles

Open dradtke opened this issue 4 years ago • 10 comments

This PR adds basic support for workspace/didChangeWatchedFiles. When the server registers watchers, those watchers are saved to the server's configuration, and a modification to any file matching one of the glob patterns will trigger a notification to the server.

My primary use-case for this change was to support the modification of SQL resource files within a Java project. Without this, any modifications to a SQL file requires restarting Vim in order to force the language server to see the changes. With this, those changes are picked up seamlessly as if they were regular Java source files.

The design of this feature is very rough, and primarily intended to get it working as a proof-of-concept. I fully expect there to be suggestions on how to improve it, so feedback is welcome!

dradtke avatar Jan 15 '21 17:01 dradtke

One option would be to do something like this so we get full watch support. https://github.com/mattn/vim-filewatcher. wondering if we should have that extra dep the exe and fallback to your method?

neovim might have full watch support.

prabirshrestha avatar Jan 15 '21 18:01 prabirshrestha

//cc @mattn in case he has any thoughts.

prabirshrestha avatar Jan 15 '21 18:01 prabirshrestha

Nice, I didn't realize there was an existing plugin for that. I think preferring that makes sense if it's installed.

dradtke avatar Jan 19 '21 14:01 dradtke

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 21 '21 16:03 stale[bot]

Sorry, I had lost the ping to me. Which the server can I test this PR?

mattn avatar Mar 21 '21 17:03 mattn

I was using this with eclipse.jdt.ls.

dradtke avatar Mar 24 '21 14:03 dradtke

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 02 '21 14:06 stale[bot]

gopls support didChangeWatchedFiles.

https://github.com/search?q=repo%3Agolang%2Ftools%20didChangeWatchedFiles%20&type=code

mattn avatar Jun 27 '23 10:06 mattn

@dradtke Can you please fix conflicts?

mattn avatar Jun 27 '23 10:06 mattn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 17 '23 03:09 stale[bot]