neovim/runtime/lua/vim
Justin M. Keyes 9e23b4e185 fix(watch): ignore nonexistent paths (ENOENT)
Problem:
The `_watch.watch()` strategy may fail if the given path does not exist:

    …/vim/_watch.lua:101: ENOENT: no such file or directory
    stack traceback:
        [C]: in function 'assert'
        …/vim/_watch.lua:101: in function <…/vim/_watch.lua:61>
        [string "<nvim>"]:5: in main chunk

- `_watch.watch()` actively asserts any error returned by `handle:start()`.
- whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`.

Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles"
item(s) (`baseUri`) which do not actually exist on the filesystem:
https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424

    {
      method = "client/registerCapability",
      params = {
        registrations = { {
            method = "workspace/didChangeWatchedFiles",
            registerOptions = {
              watchers = { {
                  globPattern = {
                    baseUri = "file:///Users/does/not/exist",
                    pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}"
                  }
                },
    ...
    }

Solution:
- Remove the assert in `_watch.watch()`.
- Show a once-only message for both cases.
- More detailed logging is blocked until we have `nvim_log` / `vim.log`.

fix #28058
2024-10-02 16:41:01 +02:00
..
_meta vim-patch:9.1.0752: can set 'cedit' to an invalid value (#30616) 2024-10-01 23:39:28 +00:00
deprecated refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
filetype vim-patch:9.1.0635: filetype: SuperHTML template files not recognized 2024-07-29 09:12:14 +02:00
func fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
health fix(health): check more "old" files #30421 2024-09-19 06:34:23 -07:00
lsp Merge #30435 refactor: rename "Dictionary" => "Dict" 2024-09-23 07:14:10 -07:00
provider fix(vim.fs): dirname() returns "." on mingw/msys2 #30480 2024-09-23 06:05:58 -07:00
treesitter fix(treesitter): indent size for inspect_tree #28727 2024-10-01 09:07:30 -07:00
ui/clipboard
_comment.lua fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00
_defaults.lua feat(defaults): add default unimpaired style mappings (#28525) 2024-10-01 07:24:43 -05:00
_editor.lua docs: misc (#30177) 2024-09-29 09:54:12 +00:00
_init_packages.lua
_inspector.lua refactor: use vim._with where possible 2024-06-28 19:58:31 +02:00
_meta.lua refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
_options.lua fix(vim.wo): never allow non-zero bufnr 2024-06-12 15:42:56 +01:00
_system.lua fix(vim.ui): open() may wait indefinitely #28325 2024-04-15 04:33:09 -07:00
_watch.lua fix(watch): ignore nonexistent paths (ENOENT) 2024-10-02 16:41:01 +02:00
diagnostic.lua fix(diagnostic): correct severity type on setqflist, setloclist (#30506) 2024-09-25 10:10:50 -05:00
F.lua
filetype.lua vim-patch:9.1.0749: filetype: http files not recognized 2024-10-01 07:33:08 +02:00
fs.lua fix(vim.fs): dirname() returns "." on mingw/msys2 #30480 2024-09-23 06:05:58 -07:00
func.lua fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
glob.lua fix(glob): avoid subcapture nesting too deep error (#29520) 2024-07-06 11:40:08 +02:00
health.lua feat(health): highlight headings #30525 2024-09-26 07:45:03 -07:00
highlight.lua refactor: use vim._with where possible 2024-06-28 19:58:31 +02:00
inspect.lua
iter.lua docs: misc #28970 2024-09-01 13:01:24 -07:00
keymap.lua refactor(lua): vim.keymap.set tests, docs #30511 2024-09-25 07:01:27 -07:00
loader.lua fix(vim.fs): dirname() returns "." on mingw/msys2 #30480 2024-09-23 06:05:58 -07:00
lsp.lua docs: misc (#29719) 2024-08-29 06:11:32 +08:00
provider.lua
re.lua
secure.lua
shared.lua fix(lua): revert vim.tbl_extend behavior change and document it 2024-09-08 21:06:13 +02:00
snippet.lua fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
termcap.lua docs: various fixes (#28208) 2024-04-30 07:04:42 +08:00
text.lua fix(vim.text): handle very long strings (#30075) 2024-08-17 22:28:03 -05:00
treesitter.lua feat(treesitter)!: add default fallback to ft_to_lang lookups 2024-09-29 15:27:16 +02:00
ui.lua feat(vim.ui): configurable "gx" / vim.ui.open() tool 2024-09-16 11:58:02 +02:00
uri.lua
version.lua fix(version): return nil with empty string 2024-07-27 14:06:31 +01:00
vimhelp.lua fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00