fix(query): inefficient query of collection_type in highlights.scm#230
fix(query): inefficient query of collection_type in highlights.scm#230fdncred merged 3 commits intonushell:mainfrom
Conversation
|
Though this is dealing with the query perf, I figure I'd dump my grammar per notes because this stuff generally isn't in the tree-sitter book: Some highlight tests would be handy as well for this kind of stuff to get some numbers on regressions, looks better at the surface. |
Thanks, I think #185 was designed to track that as well, it gradually evolves to more WASM comp time focused though.
Is there any example of how to do that? |
True, there're other such patterns of anonymous field in other rules (e.g. where clauses IIRC). They seem not worth a breaking change to me (so far), so I haven't touched them yet.
Well, at least the lagging comes from another issue, which is the same to this. Your example query above shares the same pattern, likely will be laggy as well. |
mkatychev
left a comment
There was a problem hiding this comment.
LGTM, you're right my suggestions aren't that useful. I'd be curious where cursor travel distance is heaviest.
These are the ones I maintain: |
|
@mkatychev actually the suggestion of adding highlighting perf test is quite useful. I'm trying to figure out how. |
@mkatychev Thanks a lot, it's super helpful. |
|
lemme know when this is ready to land |
It's ready, please land it, thanks! |
|
Thanks |

More efficient queries, no more lagging when dealing with verbose type signatures:
Originally reported by @Jan9103 on discord.
@mkatychev I'm not sure this is the best way to do it, would you like to take a look at it?