{"id":13495890,"url":"https://github.com/tree-sitter/tree-sitter-c-sharp","last_synced_at":"2025-10-17T21:41:12.932Z","repository":{"id":13195145,"uuid":"73852242","full_name":"tree-sitter/tree-sitter-c-sharp","owner":"tree-sitter","description":"C# Grammar for tree-sitter","archived":false,"fork":false,"pushed_at":"2025-02-14T19:43:55.000Z","size":124433,"stargazers_count":217,"open_issues_count":22,"forks_count":63,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-04T17:02:29.743Z","etag":null,"topics":["c-sharp","parser","tree-sitter"],"latest_commit_sha":null,"homepage":null,"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/tree-sitter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"tree-sitter","patreon":null,"open_collective":"tree-sitter","ko_fi":"amaanq","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2016-11-15T20:26:16.000Z","updated_at":"2025-03-26T16:24:33.000Z","dependencies_parsed_at":"2024-05-06T15:23:25.846Z","dependency_job_id":"842cc266-0965-42b0-b189-d9276928fbb0","html_url":"https://github.com/tree-sitter/tree-sitter-c-sharp","commit_stats":{"total_commits":514,"total_committers":27,"mean_commits":"19.037037037037038","dds":0.5350194552529183,"last_synced_commit":"4bf615f8d688f50d69fc5677187dc35f22e03ad6"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter%2Ftree-sitter-c-sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter%2Ftree-sitter-c-sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter%2Ftree-sitter-c-sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter%2Ftree-sitter-c-sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tree-sitter","download_url":"https://codeload.github.com/tree-sitter/tree-sitter-c-sharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480437,"owners_count":21110937,"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":["c-sharp","parser","tree-sitter"],"created_at":"2024-07-31T19:01:39.323Z","updated_at":"2025-10-17T21:41:12.843Z","avatar_url":"https://github.com/tree-sitter.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tree-sitter","https://opencollective.com/tree-sitter","https://ko-fi.com/amaanq"],"categories":["JavaScript","Grammars"],"sub_categories":["Tree Sitter Org"],"readme":"# tree-sitter-c-sharp\n\n[![CI][ci]](https://github.com/tree-sitter/tree-sitter-c-sharp/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-c-sharp)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-c-sharp)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-c-sharp)\n\nC# grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) based upon the Roslyn grammar with changes in order to:\n\n- Deal with differences between the parsing technologies\n- Work around some bugs in that grammar\n- Handle `#if`, `#else`, `#elif`, `#endif` blocks\n- Support syntax highlighting/parsing of fragments\n- Simplify the output tree\n- Reduce parser state count and complexity\n- Be in-line with tree-sitter's convention where applicable\n\n### Status\n\nComprehensive supports C# 1 through 13.0 with the following exception:\n\n- [ ] `async`, `var` and `await` cannot be used as identifiers everywhere they are valid\n\n### References\n\n- [Official C# 8 Draft Language Spec](https://github.com/dotnet/csharpstandard/tree/draft-v8/standard) provides chapters that formally define the language grammar.\n- [Roslyn C# language grammar export](https://github.com/dotnet/roslyn/blob/master/src/Compilers/CSharp/Portable/Generated/CSharp.Generated.g4)\n- [SharpLab](https://sharplab.io) (web-based syntax tree playground based on Roslyn)\n\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-c-sharp/ci.yml?logo=github\u0026label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord\u0026label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix\u0026label=matrix\n[npm]: https://img.shields.io/npm/v/tree-sitter-c-sharp?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-c-sharp?logo=rust\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-c-sharp?logo=pypi\u0026logoColor=ffd242\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftree-sitter%2Ftree-sitter-c-sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftree-sitter%2Ftree-sitter-c-sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftree-sitter%2Ftree-sitter-c-sharp/lists"}