<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/treesitter, branch 20231130_mix</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: Remove nested for_each_tree in TSTreeView (#26328)</title>
<updated>2023-11-30T16:37:42+00:00</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-11-30T16:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=f5573fba3d460ddf479826b7404e568cc825ed57'/>
<id>f5573fba3d460ddf479826b7404e568cc825ed57</id>
<content type='text'>
Problem:
`LanguageTree:for_each_tree` calls itself for child nodes, so when we
calls `for_each_tree` inside `for_each_tree`, this quickly leads to
exponential tree calls.

Solution:
Use `pairs(child:trees())` directly in this case, as we don't need the
extra callback for each children, this is already handled from the outer
`for_each_tree` call</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`LanguageTree:for_each_tree` calls itself for child nodes, so when we
calls `for_each_tree` inside `for_each_tree`, this quickly leads to
exponential tree calls.

Solution:
Use `pairs(child:trees())` directly in this case, as we don't need the
extra callback for each children, this is already handled from the outer
`for_each_tree` call</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): fix parens stacking in inspector display (#26304)</title>
<updated>2023-11-30T13:04:20+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-11-30T13:04:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=01b91deec7b6113ae728ac3f7a55f64f57ddb3e0'/>
<id>01b91deec7b6113ae728ac3f7a55f64f57ddb3e0</id>
<content type='text'>
When first opened, the tree-sitter inspector traverses all of the nodes
in the buffer to calculate an array of nodes. This traversal is done
only once, and _all_ nodes (both named and anonymous) are included.
Toggling anonymous nodes in the inspector only changes how the tree is
drawn in the buffer, but does not affect the underlying data structure
at all.

When the buffer is traversed and the list of nodes is calculated, we
don't know whether or not anonymous nodes will be displayed in the
inspector or not. Thus, we cannot determine during traversal where to
put closing parentheses. Instead, this must be done when drawing.

When we draw, the tree structure has been flatted into a single array,
so we lose parent-child relationships that would otherwise make
determining the number of closing parentheses straightforward. However,
we can instead rely on the fact that a delta between the depth of a node
and the depth of the successive node _must_ mean that more closing
parentheses are required:

  (foo
    (bar)
  (baz)  ↑
         │
         └ (bar) and (baz) have different depths, so (bar) must have an
           extra closing parenthesis

This does not depend on whether or not anonymous nodes are displayed and
so works in both cases.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When first opened, the tree-sitter inspector traverses all of the nodes
in the buffer to calculate an array of nodes. This traversal is done
only once, and _all_ nodes (both named and anonymous) are included.
Toggling anonymous nodes in the inspector only changes how the tree is
drawn in the buffer, but does not affect the underlying data structure
at all.

When the buffer is traversed and the list of nodes is calculated, we
don't know whether or not anonymous nodes will be displayed in the
inspector or not. Thus, we cannot determine during traversal where to
put closing parentheses. Instead, this must be done when drawing.

When we draw, the tree structure has been flatted into a single array,
so we lose parent-child relationships that would otherwise make
determining the number of closing parentheses straightforward. However,
we can instead rely on the fact that a delta between the depth of a node
and the depth of the successive node _must_ mean that more closing
parentheses are required:

  (foo
    (bar)
  (baz)  ↑
         │
         └ (bar) and (baz) have different depths, so (bar) must have an
           extra closing parenthesis

This does not depend on whether or not anonymous nodes are displayed and
so works in both cases.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): adjust indentation in inspector highlights (#26302)</title>
<updated>2023-11-29T16:17:53+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-11-29T16:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=4a8bf24ac690004aedf5540fa440e788459e5e34'/>
<id>4a8bf24ac690004aedf5540fa440e788459e5e34</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: document TSNode:byte_length() (#26287)</title>
<updated>2023-11-29T14:59:36+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-11-29T14:59:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=18c1fd8e9d759da6806747910320dce6bea2ab42'/>
<id>18c1fd8e9d759da6806747910320dce6bea2ab42</id>
<content type='text'>
Also update the type annotation of TSNode:id(), which returns a string,
not an integer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also update the type annotation of TSNode:id(), which returns a string,
not an integer.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): make InspectTree correctly handle nested injections (#26085)</title>
<updated>2023-11-29T14:16:52+00:00</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-11-29T14:16:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=b6e339eb90e1a04f407f381739e46ad3c84f69c5'/>
<id>b6e339eb90e1a04f407f381739e46ad3c84f69c5</id>
<content type='text'>
Problem: Only injections under the top level tree are found.

Solution: Iterate through all trees to find injections. When two
injections are contained within the same node in the parent tree, prefer
the injection with the larger byte length.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Only injections under the top level tree are found.

Solution: Iterate through all trees to find injections. When two
injections are contained within the same node in the parent tree, prefer
the injection with the larger byte length.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): use proper query syntax for inspector (#26274)</title>
<updated>2023-11-29T14:10:02+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-11-29T14:10:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=7bc5ee7f9327e8210c78bd21935130840aaf63f2'/>
<id>7bc5ee7f9327e8210c78bd21935130840aaf63f2</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): 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): set cursor position when opening inspector</title>
<updated>2023-10-19T12:54:10+00:00</updated>
<author>
<name>Maria José Solano</name>
<email>majosolano99@gmail.com</email>
</author>
<published>2023-10-19T04:18:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=315c711700a87fe3fa546906ab39557ebba19baf'/>
<id>315c711700a87fe3fa546906ab39557ebba19baf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(docs): fix TSNode incorrect signatures</title>
<updated>2023-10-19T08:23:13+00:00</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-10-06T07:27:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=ae7020c667b5314fe832d2a8897fb16d57194bdf'/>
<id>ae7020c667b5314fe832d2a8897fb16d57194bdf</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): check that buf is loaded in autocommands (#25679)</title>
<updated>2023-10-17T20:34:39+00:00</updated>
<author>
<name>Maria José Solano</name>
<email>majosolano99@gmail.com</email>
</author>
<published>2023-10-17T20:34:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=3fd7449d5abe9a75fed8fb6b68c5958bd1a9ee12'/>
<id>3fd7449d5abe9a75fed8fb6b68c5958bd1a9ee12</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
