<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/api/server_notifications_spec.lua, branch master</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>feat(api): nvim_chan_set()</title>
<updated>2026-10-09T11:16:00+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-10-09T00:58:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=d2d8188851430da8bfe8b489ae22f34de5942fff'/>
<id>d2d8188851430da8bfe8b489ae22f34de5942fff</id>
<content type='text'>
Problem:
Only the stdio channel can "own" a server (self-exit on close). After
:restart the TUI reconnects over a socket, so the restarted server does
not have "self-exit" behavior when the channel closes (e.g. by UI
disconnect, host-terminal close, etc.), which leaves a dangling server.

Solution:
- Introduce `nvim_chan_set`. (`nvim_set_client_info` doesn't fit:
  exposing it to Lua would require a `channel` param, which is not
  backwards-compatible, plus it's awkward because it doesn't merge info.)
- Broadcast per-channel properties in the "restart" UI event as an
  opaque dict (a potentially useful pattern for other UI-events in the
  future).
  - UIs are expected to restore the channel properties on restart.
- `nvim_get_chan_info()` reports "detach".
- Remove `nvim__chan_set_detach()`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Only the stdio channel can "own" a server (self-exit on close). After
:restart the TUI reconnects over a socket, so the restarted server does
not have "self-exit" behavior when the channel closes (e.g. by UI
disconnect, host-terminal close, etc.), which leaves a dangling server.

Solution:
- Introduce `nvim_chan_set`. (`nvim_set_client_info` doesn't fit:
  exposing it to Lua would require a `channel` param, which is not
  backwards-compatible, plus it's awkward because it doesn't merge info.)
- Broadcast per-channel properties in the "restart" UI event as an
  opaque dict (a potentially useful pattern for other UI-events in the
  future).
  - UIs are expected to restore the channel properties on restart.
- `nvim_get_chan_info()` reports "detach".
- Remove `nvim__chan_set_detach()`.
</pre>
</div>
</content>
</entry>
<entry>
<title>test(harness): migrate away from magic globals</title>
<updated>2026-07-21T11:22:39+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-07-20T15:16:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6d8c8b18d551d0be0490640c00fabb816727ec10'/>
<id>6d8c8b18d551d0be0490640c00fabb816727ec10</id>
<content type='text'>
Problem:
The magic globals `it`, `describe`, etc., are more trouble than they are
worth.

- Hooking into `after_each` requires `getfenv()` hacks.
- They confuse luals/emmylua, because the top-level `.luarc.json` isn't
  merged with `test/.luarc.json` (apparently a luals limitation?)
- They totally defeat discoverability because the user just has to
  "know" about the various magic symbols.

So they harm DX, which means they serve no purpose at all.

Solution:
- Expose the test API from `testutil`, so tests can call `t.it()`,
  `t.describe()`, etc., in the conventional way.
- Drop `getfenv()` hacks.
- Drop the `setfenv()` injection in `load_chunk`.
- Drop `test/_meta.lua`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
The magic globals `it`, `describe`, etc., are more trouble than they are
worth.

- Hooking into `after_each` requires `getfenv()` hacks.
- They confuse luals/emmylua, because the top-level `.luarc.json` isn't
  merged with `test/.luarc.json` (apparently a luals limitation?)
- They totally defeat discoverability because the user just has to
  "know" about the various magic symbols.

So they harm DX, which means they serve no purpose at all.

Solution:
- Expose the test API from `testutil`, so tests can call `t.it()`,
  `t.describe()`, etc., in the conventional way.
- Drop `getfenv()` hacks.
- Drop the `setfenv()` injection in `load_chunk`.
- Drop `test/_meta.lua`.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(path): exepath() should respect 'shellslash' #39541</title>
<updated>2026-05-04T16:18:13+00:00</updated>
<author>
<name>tao</name>
<email>2471314@gmail.com</email>
</author>
<published>2026-05-04T16:18:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7e813c65f7007d0e72d8ab894ba7999037a0add4'/>
<id>7e813c65f7007d0e72d8ab894ba7999037a0add4</id>
<content type='text'>
Problem:
`gx` relies on `exepath` to get the fullpath of `cmd.exe`,
and that path must use `\`; otherwise, luv's spawn will fail.

Solution:
Revert `slash_adjust` in `exepath`, so that it still respects 'shellslash'</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`gx` relies on `exepath` to get the fullpath of `cmd.exe`,
and that path must use `\`; otherwise, luv's spawn will fail.

Solution:
Revert `slash_adjust` in `exepath`, so that it still respects 'shellslash'</pre>
</div>
</content>
</entry>
<entry>
<title>test(server_notifications_spec): improve chanclose test (#37337)</title>
<updated>2026-01-10T04:12:06+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2026-01-10T04:12:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=cb77bd1b861aa4cb0c99c01efeb26e790263e219'/>
<id>cb77bd1b861aa4cb0c99c01efeb26e790263e219</id>
<content type='text'>
Check that a pending event is actually cancelled, in place of the
nvim_subscribe that was removed in #28487.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check that a pending event is actually cancelled, in place of the
nvim_subscribe that was removed in #28487.</pre>
</div>
</content>
</entry>
<entry>
<title>test(api/server_requests_spec): fix flaky test (again) (#36570)</title>
<updated>2025-11-16T09:47:16+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-11-16T09:47:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=c924d68021a8a035e190daa9cfd514eac666869a'/>
<id>c924d68021a8a035e190daa9cfd514eac666869a</id>
<content type='text'>
Use a fast API, as a deferred API request may be aborted by EOF.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a fast API, as a deferred API request may be aborted by EOF.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(api): broadcast events to ALL channels #28487</title>
<updated>2024-05-17T14:37:39+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2024-05-17T14:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=aec4938a21a02d279d13a9eb64ef3b7cc592c374'/>
<id>aec4938a21a02d279d13a9eb64ef3b7cc592c374</id>
<content type='text'>
Problem:
`vim.rpcnotify(0)` and `rpcnotify(0)` are documented as follows:

    If {channel} is 0, the event is broadcast to all channels.

But that's not actually true. Channels must call `nvim_subscribe` to
receive "broadcast" events, so it's actually "multicast".

- Assuming there is a use-case for "broadcast", the current model adds
  an extra step for broadcasting: all channels need to "subscribe".
- The presence of `nvim_subscribe` is a source of confusion for users,
  because its name implies something more generally useful than what it
  does.

Presumably the use-case of `nvim_subscribe` is to avoid "noise" on RPC
channels not expected a broadcast notification, and potentially an error
if the channel client reports an unknown event.

Solution:
- Deprecate `nvim_subscribe`/`nvim_unsubscribe`.
  - If applications want to multicast, they can keep their own multicast
    list. Or they can use `nvim_list_chans()` and `nvim_get_chan_info()`
    to enumerate and filter the clients they want to target.
- Always send "broadcast" events to ALL channels. Don't require channels
  to "subscribe" to receive broadcasts. This matches the documented
  behavior of `rpcnotify()`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`vim.rpcnotify(0)` and `rpcnotify(0)` are documented as follows:

    If {channel} is 0, the event is broadcast to all channels.

But that's not actually true. Channels must call `nvim_subscribe` to
receive "broadcast" events, so it's actually "multicast".

- Assuming there is a use-case for "broadcast", the current model adds
  an extra step for broadcasting: all channels need to "subscribe".
- The presence of `nvim_subscribe` is a source of confusion for users,
  because its name implies something more generally useful than what it
  does.

Presumably the use-case of `nvim_subscribe` is to avoid "noise" on RPC
channels not expected a broadcast notification, and potentially an error
if the channel client reports an unknown event.

Solution:
- Deprecate `nvim_subscribe`/`nvim_unsubscribe`.
  - If applications want to multicast, they can keep their own multicast
    list. Or they can use `nvim_list_chans()` and `nvim_get_chan_info()`
    to enumerate and filter the clients they want to target.
- Always send "broadcast" events to ALL channels. Don't require channels
  to "subscribe" to receive broadcasts. This matches the documented
  behavior of `rpcnotify()`.</pre>
</div>
</content>
</entry>
<entry>
<title>test: improve test conventions</title>
<updated>2024-04-23T16:17:04+00:00</updated>
<author>
<name>dundargoc</name>
<email>gocdundar@gmail.com</email>
</author>
<published>2024-04-20T15:44:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=052498ed42780a76daea589d063cd8947a894673'/>
<id>052498ed42780a76daea589d063cd8947a894673</id>
<content type='text'>
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(test): inject after_each differently</title>
<updated>2024-04-10T14:53:50+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2024-04-09T11:26:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=81fc27124b9e1b375e0ce9605ae69c3c2a2d9222'/>
<id>81fc27124b9e1b375e0ce9605ae69c3c2a2d9222</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: improve test conventions</title>
<updated>2024-04-08T20:51:00+00:00</updated>
<author>
<name>dundargoc</name>
<email>gocdundar@gmail.com</email>
</author>
<published>2024-04-08T09:03:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7035125b2b26aa68fcfb7cda39377ac79926a0f9'/>
<id>7035125b2b26aa68fcfb7cda39377ac79926a0f9</id>
<content type='text'>
Work on https://github.com/neovim/neovim/issues/27004.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Work on https://github.com/neovim/neovim/issues/27004.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: adjust error message for error in UI event callback (#28200)</title>
<updated>2024-04-06T03:18:43+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2024-04-06T03:18:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ae28ef327e02ac87ef26f941c401312ed0462d8c'/>
<id>ae28ef327e02ac87ef26f941c401312ed0462d8c</id>
<content type='text'>
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.

Also adjust log level in libuv_process_spawn(). Ref #27660</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.

Also adjust log level in libuv_process_spawn(). Ref #27660</pre>
</div>
</content>
</entry>
</feed>
