LSP-file-watcher-chokidar
Chokidar-based file watcher implementation for LSP
Details
Installs
- Total 7K
- Win 2K
- Mac 2K
- Linux 2K
Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | Jun 22 | Jun 21 | Jun 20 | Jun 19 | Jun 18 | Jun 17 | Jun 16 | Jun 15 | Jun 14 | Jun 13 | Jun 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 4 | 2 | 3 | 8 | 2 | 5 | 1 | 1 | 2 | 2 | 3 | 1 | 5 | 0 | 1 | 6 | 4 | 3 | 3 | 3 | 1 | 3 | 7 | 4 | 1 | 7 | 4 | 4 | 2 | 4 | 4 | 0 | 3 | 1 | 3 | 3 | 2 | 2 | 3 | 2 | 2 | 2 | 4 | 5 | 3 |
Mac | 0 | 2 | 5 | 2 | 3 | 2 | 2 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 4 | 4 | 4 | 2 | 1 | 2 | 3 | 2 | 7 | 0 | 4 | 7 | 1 | 3 | 0 | 2 | 5 | 4 | 2 | 2 | 1 | 3 | 1 | 2 | 2 | 2 | 0 | 0 | 1 | 3 | 1 | 1 |
Linux | 0 | 3 | 1 | 3 | 4 | 2 | 1 | 0 | 3 | 2 | 1 | 2 | 5 | 1 | 5 | 2 | 2 | 4 | 2 | 2 | 3 | 5 | 2 | 5 | 4 | 6 | 4 | 2 | 3 | 0 | 4 | 8 | 4 | 7 | 6 | 2 | 5 | 8 | 5 | 2 | 3 | 2 | 2 | 3 | 5 | 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.