feat: Add Kotlin support #56

Merged
wetneb merged 4 commits from wetneb/mergiraf:kotlin into main 2025-01-17 09:47:16 +01:00
Owner

Adds support for Kotlin. The parser groups imports together by detecting the empty lines between them, but to do so it includes whitespace at the end of import_list nodes, which isn't something I had planned for in the pretty printer, so I had to make some adjustments accordingly.

Adds support for Kotlin. The parser groups imports together by detecting the empty lines between them, but to do so it includes whitespace at the end of `import_list` nodes, which isn't something I had planned for in the pretty printer, so I had to make some adjustments accordingly.
Cargo.toml Outdated
@ -21,6 +21,7 @@ tree-sitter-rust = "0.23"
tree-sitter-json = "0.23"
tree-sitter-yaml = "0.6.1"
tree-sitter-java = "0.23"
tree-sitter-kotlin = { git = "https://github.com/alexle0nte/tree-sitter-kotlin.git", rev = "9b40bc22b49e616ea1a2fe6bca98fa211565aa7d" }
Author
Owner

This is because the latest published version of this crate only works with older versions of tree-sitter.
I would like to wait for https://github.com/fwcd/tree-sitter-kotlin/pull/150 to get merged and released before merging this, so that we only rely on official versions.

This is because the latest published version of this crate only works with older versions of tree-sitter. I would like to wait for https://github.com/fwcd/tree-sitter-kotlin/pull/150 to get merged and released before merging this, so that we only rely on official versions.
Author
Owner

I have switched the crate to tree-sitter-kotlin-ng, which is maintained here:
https://github.com/tree-sitter-grammars/tree-sitter-kotlin.

I've been told that grammar is still a work in progress but as far as I can tell it is better than the original, in some respects, so I'd be keen to start using it already.

I have switched the crate to [tree-sitter-kotlin-ng](https://crates.io/crates/tree-sitter-kotlin-ng), which is maintained here: https://github.com/tree-sitter-grammars/tree-sitter-kotlin. I've been told that grammar is still a work in progress but as far as I can tell it is better than the original, in some respects, so I'd be keen to start using it already.
wetneb changed title from WIP: feat: Add Kotlin support to feat: Add Kotlin support 2025-01-16 23:50:03 +01:00
ada4a approved these changes 2025-01-17 08:25:38 +01:00
ada4a left a comment
Owner

LGTM! (given that I don't know anything Kotlin)

LGTM! (given that I don't know anything Kotlin)
@ -0,0 +1,6 @@
object MergeAlgorithm {
Owner

very meta:)

very meta:)
wetneb merged commit 0a6f44ec1c into main 2025-01-17 09:47:16 +01:00
wetneb referenced this pull request from a commit 2025-01-17 09:47:17 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: mergiraf/mergiraf#56
No description provided.