neovim/runtime/lua
Mitchell Hanberg a37d568082
fix(lsp): send empty "added" list when removing workspace folder #24440
When adding `workspace/didChangeWorkspaceFolders` support to my [language server](https://github.com/elixir-tools/next-ls), I noticed that when neovim removes a workspace, it sends an empty table (which is serialized to an empty JSON array) for the value in the `added` field.

This does not follow the spec; the `added` table should just be empty.

The following error led me to this discovery. Note the payload includes `"added" => [[]]`:

```
22:46:48.476 [error] LSP Exited.

Last message received: handle_notification %{"jsonrpc" => "2.0", "method" => "workspace/didChangeWorkspaceFolders", "params" => %{"event" => %{"added" => [[]], "removed" => [%{"name" => "/Users/mitchell/src/gen_lsp", "uri" => "file:///Users/mitchell/src/gen_lsp"}]}}}

** (MatchError) no match of right hand side value: {:error, %{"params" => %{"event" => %{"added" => [error: "expected a map"]}}}}
    (gen_lsp 0.4.0) lib/gen_lsp.ex:265: anonymous fn/4 in GenLSP.loop/3
    (gen_lsp 0.4.0) lib/gen_lsp.ex:292: GenLSP.attempt/3
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
```
2023-07-24 09:09:53 -07:00
..
nvim feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
provider feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
vim fix(lsp): send empty "added" list when removing workspace folder #24440 2023-07-24 09:09:53 -07:00
_vim9script.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
editorconfig.lua fix(editorconfig): check that buffer is valid (#23922) 2023-06-05 11:53:13 -05:00
man.lua feat(man): respect 'wrapmargin' when wrapping man pages (#24091) 2023-06-21 14:42:23 -05:00