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

[STAL-2736] feat!: switch upstream Kotlin parser #504

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

amaanq
Copy link
Collaborator

@amaanq amaanq commented Aug 30, 2024

What problem are you trying to solve?

Currently the Kotlin grammar we use is from a third-party repository, and there are some open issues w.r.t parsing. Not only that, but certain queries take a very long time; the lag while typing in the rule editor is very noticeable.

What is your solution?

The new grammar I wrote that lives in the tree-sitter-grammars org parses Kotlin more correctly and is easier to query since the parse tree is simpler. It also removes the noticeable lag when editing with the old Kotlin grammar, and is also an actively maintained grammar with support from tree-sitter & neovim contributors.

Alternatives considered

What the reviewer should know

Kotlin supports block comments, so I moved the match arm in get_lines_to_ignore to be with JS/TS which checks for two slashes and a slash + asterisk, instead of just two slashes.

The new grammar in the `tree-sitter-grammars` org parses Kotlin much
more correctly, and is easier to query.
@amaanq amaanq requested a review from a team as a code owner August 30, 2024 14:31
@amaanq amaanq requested a review from jacobotb August 30, 2024 14:31
@amaanq amaanq changed the title feat!: switch upstream Kotlin parser [2736] feat!: switch upstream Kotlin parser Aug 30, 2024
@amaanq amaanq changed the title [2736] feat!: switch upstream Kotlin parser [STAL-2736] feat!: switch upstream Kotlin parser Aug 30, 2024
@amaanq amaanq merged commit 492ce42 into main Sep 4, 2024
64 checks passed
@jasonforal jasonforal deleted the kotlin-switch branch November 8, 2024 09:39
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