Closed fdschmidt93 closed 4 months ago
am i dreaming ? Awesome feature!
@fdschmidt93 i throws an error when i tried to grep:
[telescope] [WARN 18:11:47] /Users/otavio/.local/share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:642: Finder failed with msg: ....nvim/lua/telescope/_extensions/egrepify/entry_maker.lua:100: attempt to call field 'iter' (a nil value)
Ah, that's a nightly API. Will change that. Thanks!
Ideally fixed now!
Ideally fixed now!
The performance is awesome! working great now!
A possible improvement is the "match" highlight. When the highlight happens, it loses the colors. The ideal is just change the background or something like that:
EDIT about the performance:
For my big project, it slow considerable for some reason. could have an option to just add the highlight for TS for the first X matches, what you think @fdschmidt93 ?
When typing to search a term in a big project, it slows considerable (when return 1000 results or more), its pretty common to happen. i think the idea here is to add the highlight for the first 50 matches or something like that
A possible improvement is the "match" highlight. When the highlight happens, it loses the colors. The ideal is just change the background or something like that:
I'm not sure I 100% follow. If I understand you correctly:
TelescopeMatching
cannot intersect for the time being. Not sure if it's possible but that would require a telescope PR which I surely won't doTelescopeMatching
needs to be set by the userSo long story short, very likely not possible right now.
For my big project, it slow considerable for some reason. could have an option to just add the highlight for TS for the first X matches, what you think fdschmidt93 ?
Right now it only tries to highlight entries that appear in your results list and caches highlights for those files.
One approach would be to increase some debounce
(in ms) to the picker so the results entries don't get rerendered too often so the load is a bit spread out.
Common slow downs I'd expect:
debounce
Highlight parsing is probably the one that could be most improved. Might do it in a follow-up PR.
When typing to search a term in a big project, it slows considerable (when return 1000 results or more), its pretty common to happen. i think the idea here is to add the highlight for the first 50 matches or something like that
That's essentially already happening.
I can reproduce slowdown now. Will try to improve performance such that it becomes acceptable.
i found another bug @fdschmidt93 , sometimes, after you select the file, it open the file without highlight
Nice! It seems to work fine for me. I can check results more clearly. I will test for a while.
I've been using recent months, and really been satisfied with this. Can you merge this? @fdschmidt93
I'll merge this since it's opt-in anyways but I won't have any time to work/improve this myself until some time in August, to be honest :sweat_smile:
But I trust your stress-testing @delphinus
Enable treesitter highlighting of results buffer. In practice, I don't notice any slowdown
Known issue: scratch buffer whennvim
is opened does not get closed@delphinus @otavioschwanck I would greatly appreciate if you hop on this branch and give it a whirl for feedback! Thanks in advance if you do so :) Though I'll plan on making the feature opt-in anyways.
Needs
results_ts_hl = true
in config.Update:
The big problem here is getting performance right. There are are quite a few scenarios in which tree-sitter highlighting would lead to major blockage. The best would be some sort of timeout for highlighting a particular file but tree-sitter parsing cannot be cancelled once started. The best solution that comes to mind would be to spawn an embedded
nvim
instance when the picker opens, ask that one to parse the file and send the parsed tree to the main instance, since, if we don't receive the tree in time, we can just proceed and ignore the tree even once we received it (which doesn't block neovim as much).