{"id":15018719,"url":"https://github.com/fwcd/tree-sitter-kotlin","last_synced_at":"2025-05-14T19:09:31.692Z","repository":{"id":35056644,"uuid":"199330753","full_name":"fwcd/tree-sitter-kotlin","owner":"fwcd","description":"Kotlin grammar for Tree-sitter","archived":false,"fork":false,"pushed_at":"2025-04-28T18:07:58.000Z","size":77701,"stargazers_count":139,"open_issues_count":34,"forks_count":66,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-28T19:24:08.673Z","etag":null,"topics":["kotlin","language-grammars","parser","tree-sitter"],"latest_commit_sha":null,"homepage":"https://fwcd.github.io/tree-sitter-kotlin","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-28T19:51:27.000Z","updated_at":"2025-04-28T18:08:07.000Z","dependencies_parsed_at":"2023-02-16T09:45:29.376Z","dependency_job_id":"0a7357e3-0335-4120-928c-8d2646d60819","html_url":"https://github.com/fwcd/tree-sitter-kotlin","commit_stats":{"total_commits":307,"total_committers":33,"mean_commits":9.303030303030303,"dds":0.4071661237785016,"last_synced_commit":"0662afbd2ce19b17c603acf67ae707b4d69ab8f4"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Ftree-sitter-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Ftree-sitter-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Ftree-sitter-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Ftree-sitter-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/tree-sitter-kotlin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","language-grammars","parser","tree-sitter"],"created_at":"2024-09-24T19:52:21.506Z","updated_at":"2025-05-14T19:09:30.333Z","avatar_url":"https://github.com/fwcd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin Grammar for Tree-sitter\n\n[![Build](https://github.com/fwcd/tree-sitter-kotlin/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/tree-sitter-kotlin/actions/workflows/build.yml)\n[![NPM](https://img.shields.io/npm/v/tree-sitter-kotlin)](https://www.npmjs.com/package/tree-sitter-kotlin)\n[![crates.io](https://img.shields.io/crates/v/tree-sitter-kotlin)](https://crates.io/crates/tree-sitter-kotlin)\n\n[Kotlin](https://kotlinlang.org) language grammar for [Tree-sitter](http://tree-sitter.github.io/tree-sitter/). You can try it out directly [on the web](https://fwcd.github.io/tree-sitter-kotlin).\n\n![Icon](Icon128.png)\n\nThe grammar is based on the [official language grammar](https://kotlinlang.org/docs/reference/grammar.html).\n\n## Project Structure\n\n| File | Description |\n| ---- | ----------- |\n| grammar.js | The Tree-sitter grammar |\n| grammar-reference.js | A direct translation of the Kotlin language grammar that is, however, ambiguous to Tree-sitter |\n| src | The generated parser |\n\n## Setup\n\n\u003e`npm install`\n\n## Development\n\n### Compilation\n\nTo (re-)compile the grammar, run:\n\n\u003e`npm run generate`\n\nNote that the grammar is written completely in JavaScript (`grammar.js`), the other source files are generated by `tree-sitter`.\n\n### Testing\n\nTo run the unit tests, run:\n\n\u003e`npm run test`\n\nIt is also helpful to run the parser on a real Kotlin project's source files.\n\n```shell\n./node_modules/.bin/tree-sitter parse \"/path/to/some/project/**/*.kt\"  --quiet --stat\n```\n\n## WebAssembly\n\n### Compilation\n\nFirst make sure to have [Emscripten](https://emscripten.org/) installed. If you use Homebrew, you can `brew install emscripten`. Then run:\n\n\u003e`npm run build-wasm`\n\n### Playground\n\nAfter compiling the grammar to WebAssembly, you can invoke\n\n\u003e`npm run playground`\n\nto launch an interactive editing environment that displays the parsed syntax tree on-the-fly in the browser. You can also view a deployed version of this playground [on the web](https://fwcd.github.io/tree-sitter-kotlin).\n\n![Screenshot](playground-screenshot.png)\n\n## Documentation\n\nMore documentation on how to create Tree-sitter grammars [can be found here](https://tree-sitter.github.io/tree-sitter/creating-parsers).\n\n## See also\n\n* [Kotlin Language Server](https://github.com/fwcd/kotlin-language-server) for code completion, diagnostics and more\n* [Kotlin Debug Adapter](https://github.com/fwcd/kotlin-debug-adapter) for JVM debugging support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Ftree-sitter-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Ftree-sitter-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Ftree-sitter-kotlin/lists"}