Skip to content
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

add a knob to configure tree sitter timeout #13217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcgoodfellow
Copy link

@rcgoodfellow rcgoodfellow commented Mar 28, 2025

  • adds syntax-timeout to languages configuration (not tied to any specific language)
  • preserves existing half-second timeout as a default
  • doing this because I have some very large KDL files I work with that take a bit longer than half a second to parse

@pascalkuthe
Copy link
Member

I don't think thus make sense. A parsetime of 500ms was already quite a conservative timeout and will make editing/typing practically impossible. I would try to improve the parser for that particular language.

Longterm I think concerns likely this will be covered by async parsing and potentially dynamically adjusting the timeout based on edit size (shorter timeouts for small edits with the initial parse/big edits having maybe 1-2s timeouts)

@rcgoodfellow
Copy link
Author

rcgoodfellow commented Mar 29, 2025

I would not describe the editing experience I have with this change as practically impossible, there is a bit of lag, but it's still very usable and the tradeoff is well worth it to have syntax highlighting. The half-second default is still preserved in this PR, it just gives folks that want to use helix to work with large files and have syntax highlighting a path to do so.

@rcgoodfellow
Copy link
Author

This issue is also not specific to KDL. When I use Helix on large Rust files produced by code generators, I hit the half second timeout there as well. For those files, I'm oftentimes not editing them, so interactive editing speed is not as important, but syntax highlighting is important for reading code efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants