GitNexus/gitnexus/test/fixtures/sample-code
Navid EMAD 8c8eec7cf8
feat: add Zig language support
Adds a Zig LanguageProvider grounded in @tree-sitter-grammars/tree-sitter-zig 1.1.2.
The grammar's published peerOptional `tree-sitter@^0.22.1` is suppressed via an
npm `overrides` entry that aliases the peer to the bundled `tree-sitter@0.21.x`;
load-time smoke testing confirmed ABI compatibility.

v1 capabilities:
  - .zig file detection + Prism syntax mapping
  - Top-level + nested function_declaration as Function/Method
  - struct/enum/union (anonymous in the grammar — owner name resolved from the
    enclosing variable_declaration in class/field/method extractors)
  - container_field as struct/union fields and enum variants
  - top-level const/var as Variable nodes
  - free + member call_expression as @call edges
  - @import("./foo.zig") local-file resolution; std and external packages
    return empty (no ghost edges)
  - pub keyword detection for export checking
  - no heritage hooks (Zig has no inheritance; queries never emit @heritage.*)

Generic extractor changes (backward-compatible):
  - field-extractors/generic.ts and method-extractors/generic.ts: empty
    `bodyNodeTypes` falls back to the type declaration node itself as its own
    body container — needed because Zig's struct_declaration directly contains
    its container_field children. (The `extractOwnerName` hook this commit
    originally introduced now exists upstream; Zig just configures it.)

Out of scope (deferred):
  - usingnamespace, build.zig.zon package graph, comptime/anytype
  - scope-resolution hooks (emitScopeCaptures, interpretImport, …): Zig is
    classified `experimental` and uses the generic fallback resolution path
  - cross-package imports (std, deps)

Tests:
  - new fixture test/fixtures/sample-code/simple.zig
  - Zig describe block in tree-sitter-languages integration test
  - simple.zig added to parsing.test.ts fixture-existence list
  - Zig added to ingestion-utils detection unit test
  - Zig smoke case in parser-loader-abi.test.ts
  - Zig grammar registered in the grammar-literal validation gate
2026-08-24 19:56:11 +02:00
..
dart-advanced.dart feat: add Dart language support (#204) 2026-03-26 08:42:49 +00:00
simple.c test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.cpp test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.cs fix: consolidate C/C++/C#/Rust language support from 6 overlapping PRs (#237) 2026-03-10 23:03:32 +00:00
simple.dart feat: add Dart language support (#204) 2026-03-26 08:42:49 +00:00
simple.go test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.java test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.js test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.php test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.py test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.rs test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.swift test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.tsx test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
simple.zig feat: add Zig language support 2026-08-24 19:56:11 +02:00
swift-extension.swift feat: language-aware code intelligence — symbol resolution, MRO, constructor discrimination (#238) 2026-03-13 13:12:23 +00:00