GitNexus/gitnexus/test/fixtures/sample-code
Navid EMAD d02f09c53a
feat(zig): export fn visibility, opaque containers, named test blocks, member ownership
Ports the parts of upstream PR #305 (closed, unmerged) that our Zig
provider lacked, plus two gaps found while porting.

- `export fn` / `export var` (C-ABI linkage, never `pub`) are exported;
  the pub/export predicate is now shared by the export checker and the
  method/variable extractors' visibility (`hasZigVisibilityKeyword`).
- `const H = opaque { … }` is a Struct-labelled container (it may own
  methods, never fields) in both the structure queries and the scope
  query; ZIG_CONTAINER_TYPES is the single source for the extractor
  configs.
- `test "name" { … }` blocks are Function nodes named by the string
  node WITH quotes, so `test "add"` beside `fn add` cannot merge onto
  Function:<file>:add; `test_declaration` joins FUNCTION_NODE_TYPES and
  the Zig method config names it in the enclosing-function walk, so
  calls inside a test attribute to the test. Anonymous `test {}` and
  decl-tests `test add {}` are scopes without a node (an empty-name hook
  result stops the walk instead of falling through to the identifier of
  the function under test).
- Empty container bodies (`struct {}`, `opaque {}`) no longer mint a
  nameless Property: tree-sitter-zig 1.1.2 recovers them as a
  container_field with a MISSING identifier; #not-eq? guards in both
  queries and the field extractor drop it.
- Owner walk (`findEnclosingClassInfo`): an anonymous container bound
  by the enclosing `variable_declaration` takes the binding identifier,
  same shape as the Go `type_spec` branch. Before this NO Zig member
  had an owner — zero HAS_METHOD / HAS_PROPERTY edges for Zig.

Not ported from #305, deliberately: `builtInNames` (a bare-name call-site
drop filter; `alloc`/`free`/`append`/`print` are the most common user
method names in Zig and `std.*` receivers are already external via the
import binding), `usingnamespace` (removed in Zig 0.15), `@cImport`,
`build.zig` ignore, and the web-app changes.
2026-08-24 19:56:13 +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(zig): export fn visibility, opaque containers, named test blocks, member ownership 2026-08-24 19:56:13 +02:00
swift-extension.swift feat: language-aware code intelligence — symbol resolution, MRO, constructor discrimination (#238) 2026-03-13 13:12:23 +00:00