Skip to content

Update tree-sitter-kotlin to fix spurious semicolon insertion#781

Merged
norhh merged 1 commit intomasterfrom
fix/kotlin-scanner-semicolon
Apr 1, 2026
Merged

Update tree-sitter-kotlin to fix spurious semicolon insertion#781
norhh merged 1 commit intomasterfrom
fix/kotlin-scanner-semicolon

Conversation

@norhh
Copy link
Copy Markdown
Contributor

@norhh norhh commented Apr 1, 2026

Bumps the pinned tree-sitter-kotlin rev to ff4faf1d4e76a579df0d55410e22bc5512a6e731 (danieltrt/tree-sitter-kotlin, use-0.3.5 branch) which fixes three bugs in the external scanner:

  1. Same-line case 'e' inserted semicolons before any identifier starting with 'e' that wasn't 'else' (e.g. eventStream, error, element). This caused return eventStream.error().filter{...} to parse as bare return + separate call_expression, leading AutoClean to incorrectly remove the return argument as dead code (D22753743).

  2. scan_for_word lacked word-boundary checking, so import matched importantValue and similar prefixes.

  3. pop() used post-decrement, reading one element past valid stack data.

Bumps the pinned tree-sitter-kotlin rev to ff4faf1d4e76a579df0d55410e22bc5512a6e731
(danieltrt/tree-sitter-kotlin, use-0.3.5 branch) which fixes three bugs
in the external scanner:

1. Same-line `case 'e'` inserted semicolons before any identifier starting
   with 'e' that wasn't 'else' (e.g. eventStream, error, element). This
   caused `return eventStream.error().filter{...}` to parse as bare
   `return` + separate call_expression, leading AutoClean to incorrectly
   remove the return argument as dead code (D22753743).

2. `scan_for_word` lacked word-boundary checking, so `import` matched
   `importantValue` and similar prefixes.

3. `pop()` used post-decrement, reading one element past valid stack data.
@norhh norhh enabled auto-merge (squash) April 1, 2026 16:17
@norhh
Copy link
Copy Markdown
Contributor Author

norhh commented Apr 1, 2026

CLA Bot is bugged. Can't see any license to accept. I agree to whatever's there in that license.

@norhh norhh disabled auto-merge April 1, 2026 16:19
@norhh norhh merged commit e5ff498 into master Apr 1, 2026
7 checks passed
@norhh norhh deleted the fix/kotlin-scanner-semicolon branch April 1, 2026 16:20
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