-
Notifications
You must be signed in to change notification settings - Fork 28
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
[ts] highlighting breaks with a complex type guard #237
Comments
The parser limits lookahead to two lines for performance reasons, and arrow function syntax is highly ambiguous until the arrow is seen—which with the extra newline here is more than two lines ahead from the first opening parentheses (the point where it has to decide what to parse). We could look into loosening that, or move to a more fine-grained unit for the limit, like characters or tokens. Do you have any defined requirements or benchmarks for the highlighting performance? |
Interesting! We don't have any specific metrics for highlighting performance since it's not generally been a problem before. I've only hit this issue in a somewhat contrived coding situation (but still a real piece of code I needed to write). Maybe let's try bumping up the limit to 3 lines (maybe just for TS, since we've not had this reported for other langauges?) and I can circle back if we notice any performance issues coming out of it. |
Okay, if you install codemirror-grammar-mode 0.1.8, that version has a max lookahead of 3 lines. |
highlights fine, but if you press enter right before the second
values
does not
The text was updated successfully, but these errors were encountered: