<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/treesitter/node_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>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(treesitter): get_node_text() inconsistent trailing newline #39409</title>
<updated>2026-05-03T13:23:32+00:00</updated>
<author>
<name>David Balatero</name>
<email>dbalatero@gmail.com</email>
</author>
<published>2026-05-03T13:23:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7ed5609439ba83d75e972beb859245d998df09ea'/>
<id>7ed5609439ba83d75e972beb859245d998df09ea</id>
<content type='text'>
Problem:
`get_node_text()` returned inconsistent results between buffer and
string sources when a node's range ends at `end_col == 0` (i.e. the node
ends with a newline). The buffer path dropped the trailing newline; the
string path included it correctly.

Solution:
Append `'\n'` in `buf_range_get_text()` when `end_col == 0` and
`start_row ~= end_row`. The `start_row ~= end_row` guard excludes
zero-width nodes at column 0, which should return `""`.

Remove the workaround in the `#trim!` directive that manually
compensated for the missing newline.

Strip whitespace in `resolve_lang()` so injection language nodes ending
at `end_col == 0` (e.g. `"&gt;lua\n"`) still resolve correctly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`get_node_text()` returned inconsistent results between buffer and
string sources when a node's range ends at `end_col == 0` (i.e. the node
ends with a newline). The buffer path dropped the trailing newline; the
string path included it correctly.

Solution:
Append `'\n'` in `buf_range_get_text()` when `end_col == 0` and
`start_row ~= end_row`. The `start_row ~= end_row` guard excludes
zero-width nodes at column 0, which should return `""`.

Remove the workaround in the `#trim!` directive that manually
compensated for the missing newline.

Strip whitespace in `resolve_lang()` so injection language nodes ending
at `end_col == 0` (e.g. `"&gt;lua\n"`) still resolve correctly.</pre>
</div>
</content>
</entry>
<entry>
<title>test: remove a few more redundant clear() calls (#35903)</title>
<updated>2025-09-24T06:25:54+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-09-24T06:25:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=eb7c12d3e347b5dc5eeab7f173a9fc64e074ab06'/>
<id>eb7c12d3e347b5dc5eeab7f173a9fc64e074ab06</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test(treesitter): test tree:root() is idempotent</title>
<updated>2025-07-02T16:05:17+00:00</updated>
<author>
<name>Rodrigodd</name>
<email>rodrigobatsmoraes@hotmail.com</email>
</author>
<published>2025-06-28T19:28:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=94f44d58fdd23f18b9e72195b36504c50a3e3de3'/>
<id>94f44d58fdd23f18b9e72195b36504c50a3e3de3</id>
<content type='text'>
Test for regression #34605
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Test for regression #34605
</pre>
</div>
</content>
</entry>
<entry>
<title>test(treesitter): test node access after tree edit</title>
<updated>2025-06-06T14:35:52+00:00</updated>
<author>
<name>Rodrigodd</name>
<email>rodrigobatsmoraes@hotmail.com</email>
</author>
<published>2025-06-06T00:28:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=4c333fdbb7bee299f36624b429f5c065470e421d'/>
<id>4c333fdbb7bee299f36624b429f5c065470e421d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lua): vim.text.indent()</title>
<updated>2025-02-26T22:06:22+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2025-02-21T01:02:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=be1fbe38b31b6046d396407c4efbf238941c6b08'/>
<id>be1fbe38b31b6046d396407c4efbf238941c6b08</id>
<content type='text'>
Problem:
Indenting text is a common task in plugins/scripts for
presentation/formatting, yet vim has no way of doing it (especially
"dedent", and especially non-buffer text).

Solution:
Introduce `vim.text.indent()`. It sets the *exact* indentation because
that's a more difficult (and thus more useful) task than merely
"increasing the current indent" (which is somewhat easy with a `gsub()`
one-liner).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Indenting text is a common task in plugins/scripts for
presentation/formatting, yet vim has no way of doing it (especially
"dedent", and especially non-buffer text).

Solution:
Introduce `vim.text.indent()`. It sets the *exact* indentation because
that's a more difficult (and thus more useful) task than merely
"increasing the current indent" (which is somewhat easy with a `gsub()`
one-liner).
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): `TSNode:field()` returns all children with the given field</title>
<updated>2025-02-21T09:47:02+00:00</updated>
<author>
<name>Riley Bruins</name>
<email>ribru17@hotmail.com</email>
</author>
<published>2025-02-15T21:33:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=55b165ac15a7528a3c679d928b1edf9d701f850b'/>
<id>55b165ac15a7528a3c679d928b1edf9d701f850b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build(deps)!: bump tree-sitter to HEAD, wasmtime to v29.0.1 (#32200)</title>
<updated>2025-01-27T15:16:06+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2025-01-27T15:16:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=eb60cd74fb5caa997e6253bef6a1f0b58e1b6ec6'/>
<id>eb60cd74fb5caa997e6253bef6a1f0b58e1b6ec6</id>
<content type='text'>
Breaking change: `ts_node_child_containing_descendant()` was removed

Breaking change: tree-sitter 0.25 (HEAD) required</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Breaking change: `ts_node_child_containing_descendant()` was removed

Breaking change: tree-sitter 0.25 (HEAD) required</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter)!: don't parse tree in get_parser() or start()</title>
<updated>2025-01-12T16:10:49+00:00</updated>
<author>
<name>Riley Bruins</name>
<email>ribru17@hotmail.com</email>
</author>
<published>2024-12-21T00:23:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=bd4ca22d0334a3323313dfd6975a80218ec65e36'/>
<id>bd4ca22d0334a3323313dfd6975a80218ec65e36</id>
<content type='text'>
**Problem:** `vim.treesitter.get_parser()` and `vim.treesitter.start()`
both parse the tree before returning it. This is problematic because if
this is a sync parse, it will stall the editor on large files. If it is
an async parse, the functions return stale trees.

**Solution:** Remove this parsing side effect and leave it to the user
to parse the returned trees, either synchronously or asynchronously.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
**Problem:** `vim.treesitter.get_parser()` and `vim.treesitter.start()`
both parse the tree before returning it. This is problematic because if
this is a sync parse, it will stall the editor on large files. If it is
an async parse, the functions return stale trees.

**Solution:** Remove this parsing side effect and leave it to the user
to parse the returned trees, either synchronously or asynchronously.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter): introduce child_with_descendant()</title>
<updated>2024-10-11T15:29:45+00:00</updated>
<author>
<name>Riley Bruins</name>
<email>ribru17@hotmail.com</email>
</author>
<published>2024-10-02T17:34:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=267c7525f738cdd6024c39da758e885c026ffaaa'/>
<id>267c7525f738cdd6024c39da758e885c026ffaaa</id>
<content type='text'>
This commit also marks `child_containing_descendant()` as deprecated
(per upstream's documentation), and uses `child_with_descendant()` in
its place. Minimum required tree-sitter version will now be `0.24`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit also marks `child_containing_descendant()` as deprecated
(per upstream's documentation), and uses `child_with_descendant()` in
its place. Minimum required tree-sitter version will now be `0.24`.
</pre>
</div>
</content>
</entry>
</feed>
