Incomplete highlights for complex queries (tree-sitter match limit not large enough?). #22042
Open
1 task done
Labels
bug
[core label]
reproducible
Verified steps to reproduce included
tree-sitter
Syntax highlighting and tree-sitter
Check for existing issues
Describe the bug / provide steps to reproduce it
Currently the match limit for Tree-Sitter is assigned at 64 in
zed/crates/language/src/syntax_map.rs:1820
:This limit appears to cause issues quite easily in Python, for example this code:
is highlighted as follows:
(i.e. after a certain token, the highlighting only semi-works - the attributes and strings are captured as expected, but the
string.doc
capture stops being applied)By doubling the match limit to 128, the highlighting works better, but ofc I'm only sweeping the problem under the carpet:
I don't know if this limit can be increased easily without performance impact (probably would need to increase it to at least 1024 or so to cover even the most complicated situations?), or in fact the issue lies somewhere else entirely, so I won't be attempting a PR myself but I'm happy if this gets a solution soon :)
Environment
Zed Preview 0.166.1 546b49c
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
No response
The text was updated successfully, but these errors were encountered: