feat(csharp): index C# 12 primary constructors via an up-to-date grammar (#237) (#717)

Vendor tree-sitter-c-sharp 0.23.5 (ABI 15) for C#, replacing the bundled ABI-13
build that dropped primary-constructor classes. Adds native primary-ctor
parsing, primary-ctor parameter dependency edges, return-type extraction via the
renamed `returns` field, and a preParse that blanks `#if` directive lines the
new grammar mis-parses inside enum bodies. Validated on MediatR / eShopOnWeb /
Newtonsoft.Json + full suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-06-07 10:50:15 -04:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 2f50473aaa
commit 80db274e5f
8 changed files with 206 additions and 4 deletions
+10
View File
@@ -78,6 +78,16 @@ export interface ExtractorContext {
* language-specific details like signatures, visibility, and imports.
*/
export interface LanguageExtractor {
/**
* Optional source transform applied immediately before the grammar parses the
* file. Used to work around grammar gaps that would otherwise corrupt the
* parse tree (e.g. C# blanks conditional-compilation directive lines the
* grammar mis-parses inside enum bodies). MUST preserve byte offsets (replace
* removed text with spaces, keep newlines) so node positions and getNodeText
* stay correct; the returned string is used for both parsing and extraction.
*/
preParse?: (source: string) => string;
// --- Node type mappings ---
/** Node types that represent functions */