<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/treesitter/_range.lua, branch aucmd_textputpost</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(treesitter)!: incremental injection parsing</title>
<updated>2023-08-12T15:11:36+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-08-10T13:21:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=2ca076e45fb3f1c08f6a1a374834df0701b8d778'/>
<id>2ca076e45fb3f1c08f6a1a374834df0701b8d778</id>
<content type='text'>
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): correctly calculate bytes for text sources (#23655)</title>
<updated>2023-05-16T15:41:47+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-05-16T15:41:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6b19170d44ca56cf65542ee184d2bc89c6d622a9'/>
<id>6b19170d44ca56cf65542ee184d2bc89c6d622a9</id>
<content type='text'>
Fixes #20419</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #20419</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(treesitter): add Range type aliase for Range4|Range6</title>
<updated>2023-03-11T16:38:18+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-10T16:40:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=58bbc2ea0b3dfed13471e8cc0447d7598be24276'/>
<id>58bbc2ea0b3dfed13471e8cc0447d7598be24276</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)!: consolidate query util functions</title>
<updated>2023-03-10T16:35:06+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-10T16:10:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=9d70fe062ca01ac0673faa6ccbb88345916aeea7'/>
<id>9d70fe062ca01ac0673faa6ccbb88345916aeea7</id>
<content type='text'>
- And address more type errors.
- Removed the `concat` option from `get_node_text` since it was applied
  inconsistently and made typing awkward.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- And address more type errors.
- Removed the `concat` option from `get_node_text` since it was applied
  inconsistently and made typing awkward.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(treesitter): use byte ranges from treesitter (#22589)</title>
<updated>2023-03-09T16:09:39+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-09T16:09:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ae263aff9547b8b513c4fedaceb4cbf93c57b866'/>
<id>ae263aff9547b8b513c4fedaceb4cbf93c57b866</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "refactor(treesitter): delegate region calculation to treesitter" (#22575)</title>
<updated>2023-03-08T17:59:45+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-08T17:59:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=b9f19d3e286d95d9209afbc479fa2eb908067fb1'/>
<id>b9f19d3e286d95d9209afbc479fa2eb908067fb1</id>
<content type='text'>
Revert "refactor(treesitter): delegate region calculation to treesitter (#22553)"

This reverts commit 276b647fdba07bf1762d8dd371c4b655b8a418df.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert "refactor(treesitter): delegate region calculation to treesitter (#22553)"

This reverts commit 276b647fdba07bf1762d8dd371c4b655b8a418df.</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(treesitter): delegate region calculation to treesitter (#22553)</title>
<updated>2023-03-08T17:22:28+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-08T17:22:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=276b647fdba07bf1762d8dd371c4b655b8a418df'/>
<id>276b647fdba07bf1762d8dd371c4b655b8a418df</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(treesitter): simplify some range functions</title>
<updated>2023-03-06T10:57:14+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-03-06T10:57:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f9a46391ab5961fe6c6b7d1efdc96befdd495c11'/>
<id>f9a46391ab5961fe6c6b7d1efdc96befdd495c11</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): typos in _range.lua</title>
<updated>2023-03-03T11:05:59+00:00</updated>
<author>
<name>Jaehwang Jung</name>
<email>tomtomjhj@gmail.com</email>
</author>
<published>2023-03-03T11:05:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f0a2ffab2923202f4454860ba1a7c7bd0e035ed2'/>
<id>f0a2ffab2923202f4454860ba1a7c7bd0e035ed2</id>
<content type='text'>
fix(treesitter): typos _range.lua</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix(treesitter): typos _range.lua</pre>
</div>
</content>
</entry>
<entry>
<title>perf(treesitter): smarter languagetree invalidation</title>
<updated>2023-02-23T15:19:52+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-02-23T15:19:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=75e53341f37eeeda7d9be7f934249f7e5e4397e9'/>
<id>75e53341f37eeeda7d9be7f934249f7e5e4397e9</id>
<content type='text'>
Problem:
  Treesitter injections are slow because all injected trees are invalidated on every change.

Solution:
    Implement smarter invalidation to avoid reparsing injected regions.

    - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change.
    - Add valid flags for each region in self._regions.
    - Call on_bytes recursively for all children.
       - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children.

This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
  Treesitter injections are slow because all injected trees are invalidated on every change.

Solution:
    Implement smarter invalidation to avoid reparsing injected regions.

    - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change.
    - Add valid flags for each region in self._regions.
    - Call on_bytes recursively for all children.
       - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children.

This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.</pre>
</div>
</content>
</entry>
</feed>
