Repository navigation
NOTE: Download tree-sitter-c-sharp.tar.gz for the complete source code.
C# 14
- Add C# 14 language support, including extension declarations (#429)
- Parse file-based app directives such as
#:packageand#:sdk(#462)
Parsing fixes
- Parse
(IDENT) && EXPRas a logical AND rather than a cast (#430) - Parse
*(T*)pand*(p + 1)as dereferences (#464) - Allow
refbeforepartialin struct modifiers (#464) - Accept
checkedanduncheckedexpressions as constant patterns (#464) - Parse lambdas whose first parameter is typed with
inorout(#464) - Parse
else, method bodies and returns that span#ifbranches (#464) - Let an
#ifblock hold whole elements of an initializer or collection (#464) - Open an interpolation hole straight after an escaped
{{(#448) - End a verbatim interpolated string at one quote, not at a run of them (#466)
- Preserve slice-only list patterns before logical operators (#444)
- Stop reading
whenafter a list pattern as its designation (#467)
Other changes
- Highlight
unsafeblock statements (#422) - Build with tree-sitter CLI 0.27 (#465)
- Add a schema link to
tree-sitter.json(#408)
Upgrade notes
- Queries: some code now parses to a different tree, so queries that matched the old shape may need updating.
- New node types:
directive_kind,directive_name,directive_separator,directive_value,extension_body,extension_declaration,ignored_directive,receiver_parameterandslice_pattern. - New fields:
bodyonpreproc_if,preproc_elifandpreproc_else;kind,name,separatorandvalueonignored_directive;nameandtypeonreceiver_parameter. - Python: the package now requires
tree-sitter0.25 or later (#465).