-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider setting idle timeout to 0 by default #5054
Comments
Is it really that slow? At Right now I'd recommend setting idle timeout to at least |
It is, and that’s I think is the problem for the first impression: It definitely is a perceptible, annoying delay. At the same time, it is fast enough to seem to be a performance problem, rather than an artificial delay.
Good tip, thanks. Might put that in the docs alongside the current advice about 0.
The ideal way to solve this is to highlight only the prefix of the doc which fits on the screen. That should be O(1) time and fast enough to basically always do. |
Tree-sitter may need the full document to parse the syntax tree or for syntax highlighting queries to match correctly. (See #609) |
FWIW, the way this works in IDEA is that lexing and parsing phases are separate, lexing is super-fast, incremental and robust, and syntax highlighting is done in two passes: lexemes give basic colors, and then syntax (and actual semantic analysis on top) give finer shades of meaning to tokens. So there's an perceptual small change between sync, fast, but approximate results, and precise but async results. |
That is an interesting approach. I had been thinking about something similar because tree-sitter highlights slow down the editor for very large files (20MB+) as they are performed synchronously. My idea was to perform them asyncronously so we put them on a timeout and render without syntax highlighting after a certain delay (which would then be added later as you described). The approach you described would be a better version of that by always providing lexical highlighting at least. Sadly treesitter does not expose a way to perform lexing separately from parsing AFAIK so we will probably not be able to implement this. |
I also feel some discomfort, when I’m using autocomplete with default For instance, I have the next Python code: from itertools import accumulate So now I want to use If I’m exploring and don’t know exactly, what method/class/etc is called – maybe If we talk about code highlighting on the file picker preview – again at the beginning I thought that it’s an editor’s lag ( |
It would be nice if Helix could mention |
Addressed by #8021. Completikns are now triggered much more reliably (only edits reset the timeout) and the timeout has been reduced to 200ms (and reducing it to low values like 10ms is actually not broken now). We don't want to lower the default any lower since we prefer a slightly longer timeout. This is somewhat su jective so with the option of lowering it further being property supported now I think we can close this. |
Once again test-driving helix today, and one thing I've noticed are somewhat sluggish completions. Luckily, I had enough background knowledge to google for some artificial delay, but I fear that most users would just assume the thing is slow. 400ms seems like the maximally annoying timeout -- it's clearly human perceptible, and yet still fast enough to feel basically ok. I think that maybe just setting this to 100 would be good enough?
The text was updated successfully, but these errors were encountered: