LSP-file-watcher-chokidar
Chokidar-based file watcher implementation for LSP
Details
Installs
- Total 9K
- Win 3K
- Mac 3K
- Linux 3K
Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 0 | 1 | 4 | 5 | 1 | 3 | 0 | 4 | 8 | 4 | 2 | 4 | 5 | 1 | 2 | 3 | 1 | 2 | 7 | 4 | 5 | 5 | 2 | 3 | 3 | 2 | 3 | 3 | 1 | 1 | 5 | 7 | 4 | 6 | 5 | 7 | 2 | 3 | 1 | 1 | 4 | 6 | 6 | 3 | 6 |
Mac | 3 | 5 | 2 | 2 | 6 | 1 | 1 | 1 | 2 | 5 | 1 | 2 | 3 | 2 | 1 | 4 | 2 | 3 | 3 | 5 | 1 | 4 | 3 | 4 | 2 | 2 | 2 | 1 | 0 | 0 | 3 | 1 | 0 | 3 | 5 | 0 | 1 | 2 | 3 | 7 | 5 | 3 | 1 | 1 | 1 | 2 |
Linux | 1 | 2 | 4 | 5 | 0 | 1 | 2 | 9 | 3 | 4 | 1 | 1 | 1 | 3 | 4 | 1 | 0 | 4 | 1 | 3 | 1 | 4 | 5 | 2 | 4 | 2 | 0 | 5 | 2 | 3 | 3 | 6 | 4 | 6 | 3 | 3 | 3 | 2 | 5 | 3 | 2 | 5 | 4 | 3 | 1 | 4 |
Readme
- Source
- raw.githubusercontent.com
LSP-file-watcher-chokidar
A non-native file watcher implementation for LSP that enables support for the workspace/didChangeWatchedFiles
LSP notification.
Installation
- Install
LSP-file-watcher-chokidar
from Package Control - Restart Sublime.
Usage
Having this package installed alongside LSP enables the workspace.didChangeWatchedFiles
capability and support for the workspace/didChangeWatchedFiles
notification. The servers can also dynamically register file watchers.
For LSP-*
packages that are within the sublimelsp
organization it should be enough to just install this package and file watching should work without any extra configuration.
In other cases, it might “just work” (if the server registers watchers dynamically) or it might require manual configuration using the the file_watcher
object on the Client configuration object.
file_watcher
object properties:
Name | Optional | Description |
---|---|---|
patterns | No | An array of glob patterns defining which files within the workspace should be watched. The patterns are relative to the workspace root. Example: ["{**/*.js,**/*.ts,**/*.json}"] . See also supported pattern syntax. |
events | Yes | An array with the type of events to watch. Default: ["create", "change", "delete"] (all supported types). |
ignores | Yes | An array of glob exclude patterns. By default this includes patterns from Sublime Text's folder_exclude_patterns and file_exclude_patterns settings and additionally the '**/node_modules/**' pattern. When overriding this option the defaults are not included anymore. |
Implementation
Registering a watcher creates a new Node process behind the scenes. The current implementation creates at most one process for any number of registrations (even through different language servers).
The reason that this is implemented as a separate package, and not natively within the LSP package, is that this relies on a separate process that does the file watching and for the built-in implementation we would like to use a native API provided by Sublime Text that it doesn't provide at the moment. See the LSP issue #892 for supporting it natively within the LSP package.