<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/treesitter, branch fix_20726</title>
<subtitle>Neovim fork with Rahm's personal hacks.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/'/>
<entry>
<title>fix(treesitter): don't invalidate parser when discovering injections</title>
<updated>2023-11-27T14:53:26+00:00</updated>
<author>
<name>Dmytro Soltys</name>
<email>soap@slotos.net</email>
</author>
<published>2023-11-27T12:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=72ed99319dd662f0e35b58e888b57f98ac3b3eec'/>
<id>72ed99319dd662f0e35b58e888b57f98ac3b3eec</id>
<content type='text'>
When parsing with a range, languagetree looks up injections and adds
them if needed. This explicitly invalidates parser, making `is_valid`
report `false` both when including and excluding children.

This is an attempt to describe desired behaviour of `is_valid` in tests,
with what ended up being a single line change to satisfy them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When parsing with a range, languagetree looks up injections and adds
them if needed. This explicitly invalidates parser, making `is_valid`
report `false` both when including and excluding children.

This is an attempt to describe desired behaviour of `is_valid` in tests,
with what ended up being a single line change to satisfy them.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): make Visual hl work consistently with foldtext (#25484)</title>
<updated>2023-10-03T05:07:03+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2023-10-03T05:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=3af59a415c98afc42755308e56912b302ad5eb3d'/>
<id>3af59a415c98afc42755308e56912b302ad5eb3d</id>
<content type='text'>
Problem:  Visual highlight is inconsistent on a folded line with
          treesitter foldtext.
Solution: Don't added Folded highlight as it is already in background.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Visual highlight is inconsistent on a folded line with
          treesitter foldtext.
Solution: Don't added Folded highlight as it is already in background.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter): add foldtext with treesitter highlighting (#25391)</title>
<updated>2023-10-01T19:10:51+00:00</updated>
<author>
<name>Till Bungert</name>
<email>tillbungert@gmail.com</email>
</author>
<published>2023-10-01T19:10:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=9ce1623837a817c3f4f5deff9c8ba862578b6009'/>
<id>9ce1623837a817c3f4f5deff9c8ba862578b6009</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(languagetree): don't treat unparsed nodes as occupying full range</title>
<updated>2023-09-22T11:51:51+00:00</updated>
<author>
<name>L Lllvvuu</name>
<email>git@llllvvuu.dev</email>
</author>
<published>2023-09-20T04:41:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=e353c869cea4541d00d627ec82724d3f247225a3'/>
<id>e353c869cea4541d00d627ec82724d3f247225a3</id>
<content type='text'>
This is incorrect in the following scenario:
1. The language tree is Lua &gt; Vim &gt; Lua.
2. An edit simultaneously wipes out the `_regions` of all nodes, while
   taking the Vim injection off-screen.
3. The Vim injection is not re-parsed, so the child Lua `_regions` is
   still `nil`.
4. The child Lua is assumed, incorrectly, to occupy the whole document.
5. This causes the injections to be parsed again, resulting in Lua &gt; Vim
   &gt; Lua &gt; Vim.
6. Now, by the same process, Vim ends up with its range assumed over the
   whole document. Now the parse is broken and results in broken
   highlighting and poor performance.

It should be fine to instead treat an unparsed node as occupying
nothing (i.e. effectively non-existent). Since, either:
- The parent was just parsed, hence defining `_regions`
- The parent was not just parsed, in which case this node doesn't need
  to be parsed either.

Also, the name `has_regions` is confusing; it seems to simply
mean the opposite of "root" or "full_document". However, this PR does
not touch it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is incorrect in the following scenario:
1. The language tree is Lua &gt; Vim &gt; Lua.
2. An edit simultaneously wipes out the `_regions` of all nodes, while
   taking the Vim injection off-screen.
3. The Vim injection is not re-parsed, so the child Lua `_regions` is
   still `nil`.
4. The child Lua is assumed, incorrectly, to occupy the whole document.
5. This causes the injections to be parsed again, resulting in Lua &gt; Vim
   &gt; Lua &gt; Vim.
6. Now, by the same process, Vim ends up with its range assumed over the
   whole document. Now the parse is broken and results in broken
   highlighting and poor performance.

It should be fine to instead treat an unparsed node as occupying
nothing (i.e. effectively non-existent). Since, either:
- The parent was just parsed, hence defining `_regions`
- The parent was not just parsed, in which case this node doesn't need
  to be parsed either.

Also, the name `has_regions` is confusing; it seems to simply
mean the opposite of "root" or "full_document". However, this PR does
not touch it.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(languagetree): apply `resolve_lang` to `metadata['injection.language']`</title>
<updated>2023-09-16T10:12:06+00:00</updated>
<author>
<name>L Lllvvuu</name>
<email>git@llllvvuu.dev</email>
</author>
<published>2023-09-13T23:51:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=908843df61fc80f160392edc0af0d1672a8f9a68'/>
<id>908843df61fc80f160392edc0af0d1672a8f9a68</id>
<content type='text'>
`resolve_lang` is applied to `@injection.language` when it's supplied as a
capture:

https://github.com/neovim/neovim/blob/f5953edbac14febce9d4f8a3c35bdec1eae26fbe/runtime/lua/vim/treesitter/languagetree.lua#L766-L768

If we want to support `metadata['injection.language']` (as per #22518 and
[tree-sitter upstream](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection))
then the behavior should be consistent.

Fixes: nvim-treesitter/nvim-treesitter#4918
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`resolve_lang` is applied to `@injection.language` when it's supplied as a
capture:

https://github.com/neovim/neovim/blob/f5953edbac14febce9d4f8a3c35bdec1eae26fbe/runtime/lua/vim/treesitter/languagetree.lua#L766-L768

If we want to support `metadata['injection.language']` (as per #22518 and
[tree-sitter upstream](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection))
then the behavior should be consistent.

Fixes: nvim-treesitter/nvim-treesitter#4918
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(query_error): multiline bug</title>
<updated>2023-08-31T14:12:17+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-08-31T13:11:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=dd0e77d48a843fc9730fe4ef7567330daf8dfb81'/>
<id>dd0e77d48a843fc9730fe4ef7567330daf8dfb81</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter): improve query error message</title>
<updated>2023-08-31T12:33:40+00:00</updated>
<author>
<name>Amaan Qureshi</name>
<email>amaanq12@gmail.com</email>
</author>
<published>2023-07-19T09:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=845d5b8b64190e0e09a6a6dd97bdbc0e6f96eb02'/>
<id>845d5b8b64190e0e09a6a6dd97bdbc0e6f96eb02</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): fix another TSNode:tree() double free</title>
<updated>2023-08-29T09:35:46+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2023-08-29T09:21:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=50a03c0e9975925e3198a2741c5b9fc0ad727e84'/>
<id>50a03c0e9975925e3198a2741c5b9fc0ad727e84</id>
<content type='text'>
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): fix TSNode:tree() double free (#24796)</title>
<updated>2023-08-29T08:48:23+00:00</updated>
<author>
<name>nwounkn</name>
<email>nwounkn@gmail.com</email>
</author>
<published>2023-08-29T08:48:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=6e45567b498ca8455aaf3628c10de997ac070ee1'/>
<id>6e45567b498ca8455aaf3628c10de997ac070ee1</id>
<content type='text'>
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.

Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.

Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter): add 'injection.self' and 'injection.parent'</title>
<updated>2023-08-24T00:05:44+00:00</updated>
<author>
<name>Amaan Qureshi</name>
<email>amaanq12@gmail.com</email>
</author>
<published>2023-08-22T04:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=c6ec7fa8d741d6301701067ecd095bf02e7a741a'/>
<id>c6ec7fa8d741d6301701067ecd095bf02e7a741a</id>
<content type='text'>
Co-authored-by: ObserverOfTime &lt;chronobserver@disroot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: ObserverOfTime &lt;chronobserver@disroot.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
