Skip to content

[JavaScript] Remove possibly stray branch failure#4563

Draft
deathaxe wants to merge 1 commit into
sublimehq:masterfrom
deathaxe:pr/javascript/fix-stray-fail
Draft

[JavaScript] Remove possibly stray branch failure#4563
deathaxe wants to merge 1 commit into
sublimehq:masterfrom
deathaxe:pr/javascript/fix-stray-fail

Conversation

@deathaxe

Copy link
Copy Markdown
Collaborator

This commit removes ts-function-type-arguments branch point failure from ts-type-expression-end as this context is also used in non-function-call expressions. Implementing failure outside of related branch points may have unpredictable side effects.

Instead add a negative lookahead to prevent || or && being consumed as sequence of type operators. Possible branch point failure is to be handled by "calling" context after popping ts-type-expression-end.

Added tests should illustrate it not affecting syntax highlighting behavior of generic function calls.

This commit removes `ts-function-type-arguments` branch point failure from
`ts-type-expression-end` as this context is also used in non-function-call
expressions. Implementing failure outside of related branch points may have
unpredictable side effects.

Instead add a negative lookahead to prevent `||` or `&&` being consumed as
sequence of type operators. Possible branch point failure is to be handled
by "calling" context after popping `ts-type-expression-end`.

Added tests should illustrate it not affecting syntax highlighting behavior
of generic function calls.
@deathaxe
deathaxe marked this pull request as draft June 11, 2026 17:03
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.

1 participant