C# Grammar for tree-sitter
  • JavaScript 45.2%
  • C# 35.2%
  • C 16.8%
  • Tree-sitter Query 2.7%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 8c0abe0b84
ci: bump actions/setup-node from 6 to 7 (#438)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-29 09:10:04 +01:00
.github ci: bump actions/setup-node from 6 to 7 (#438) 2026-09-29 09:10:04 +01:00
bindings feat: update bindings with 0.26.3 (#405) 2026-01-19 17:19:49 +00:00
queries feat: add highlighting for unsafe block statement (#422) 2026-06-02 17:57:27 +01:00
src fix: parse (IDENT) && EXPR as logical-AND, not cast (#413) (#430) 2026-06-02 17:56:56 +01:00
test fix: parse (IDENT) && EXPR as logical-AND, not cast (#413) (#430) 2026-06-02 17:56:56 +01:00
tools/highlight-test-generator Add syntax highlight generator 2023-02-05 20:09:43 +01:00
.editorconfig build: update bindings 2024-11-11 00:20:59 -05:00
.gitattributes build: update bindings 2024-11-11 00:20:59 -05:00
.gitignore Fix C# 13 params non-array types (#410) 2026-02-17 17:08:34 +00:00
binding.gyp build: update bindings 2024-05-01 16:24:57 -04:00
Cargo.lock 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
Cargo.toml 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
CMakeLists.txt 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
eslint.config.mjs build: update bindings 2024-10-15 03:50:11 +00:00
go.mod build: update bindings 2024-11-11 00:20:59 -05:00
go.sum build: update bindings 2024-11-11 00:20:59 -05:00
grammar.js fix: parse (IDENT) && EXPR as logical-AND, not cast (#413) (#430) 2026-06-02 17:56:56 +01:00
LICENSE build: update bindings and manifests 2024-05-03 18:42:51 -04:00
Makefile 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
package-lock.json 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
package.json 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
Package.swift Hexadecimal escape sequences (#394) 2025-11-13 08:03:15 +00:00
pyproject.toml 0.23.5 (#418) 2026-04-14 17:05:24 +01:00
README.md feat: C# 14 language support (#429) 2026-06-02 17:15:36 +01:00
setup.py feat: update bindings with 0.26.3 (#405) 2026-01-19 17:19:49 +00:00
tree-sitter.json 0.23.5 (#418) 2026-04-14 17:05:24 +01:00

tree-sitter-c-sharp

CI discord matrix crates npm pypi

C# grammar for tree-sitter based upon the Roslyn grammar with changes in order to:

  • Deal with differences between the parsing technologies
  • Work around some bugs in that grammar
  • Handle #if, #else, #elif, #endif blocks
  • Support syntax highlighting/parsing of fragments
  • Simplify the output tree
  • Reduce parser state count and complexity
  • Be in-line with tree-sitter's convention where applicable

Status

Comprehensive supports C# 1 through 14.0 with the following exceptions:

  • async, var and await cannot be used as identifiers everywhere they are valid
  • File-based apps preprocessor directives (#:property, #:package, #:sdk, #:project) are not yet recognized

References