| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
Problem: Argument type mismatches are excluded from EmmyLua checks.
Solution: Correct runtime annotations and calls, document local checker
workarounds, and enable the diagnostic.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
An operator on a target that creates a Visual selection (`cgn`,
`d<C-v>j`, an omap text object like `:<C-U>normal! viw`) sets `'< '>`,
`gv` and `visualmode()` to the operator target.
This causes at least the following problems:
- clobbers the user's previous `'< '>` (annoying and usually unwanted)
- E.g. after a custom textobj, `:help text-object-define`.
- "cgn" with a `\%V` pattern can't be dot-repeated (".")
Solution:
Don't save the Visual area if the operator target created it (operator
was pending).
Also fix `an`/`in` with `'selection'=exclusive` starting from an empty
range.
|
| |
|
|
|
|
|
|
|
|
| |
Enable checks for unused code, deprecated calls, return types, and
annotations.
Fix the warnings and replace the deprecated highlight function. Keep
exceptions where old APIs are still needed or the checker gets it wrong.
AI-assisted
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
- To share logic, creating a `vim.Range` currently creates two `vim.Pos` values
as intermediates, which causes unnecessary table allocations.
- `pos.lua` and `range.lua` contain some overlapping logic.
Solution:
Add `vim.pos._util`, a module for handling
positions represented directly by `row` and `col`.
|
| | |
|
| |
|
|
| |
Type fixes caught by emmylua
|
| |
|
|
|
| |
* refactor(docs): remove `@private` annotations from local functions
* refactor(docs): remove unnecessary `@nodoc` annotations
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
treesitter injected language ranges sometimes cross over the capture
boundaries when `@combined`.
Solution:
Clip child regions to not spill out of parent regions within
languagetree.lua, and only apply highlights within those regions in
highlighter.lua.
Co-authored-by: Cormac Relf <web@cormacrelf.net>
|
| |
|
|
|
|
|
|
| |
docs(treesitter): in-place parameter description
docs(treesitter): remove internal type names
docs(treesitter): add missing private annotation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
Fixes #20419
|
| | |
|
| |
|
|
|
|
| |
- And address more type errors.
- Removed the `concat` option from `get_node_text` since it was applied
inconsistently and made typing awkward.
|
| | |
|
| |
|
|
|
|
|
| |
(#22575)
Revert "refactor(treesitter): delegate region calculation to treesitter (#22553)"
This reverts commit 276b647fdba07bf1762d8dd371c4b655b8a418df.
|
| | |
|
| | |
|
| |
|
| |
fix(treesitter): typos _range.lua
|
|
|
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.
|