Skip to content

Add Zig and Vue SFC analyzers, Autotools build artifacts - #142

Merged
anhnh2002 merged 1 commit into
mainfrom
feat/zig-vue-autotools
Oct 22, 2026
Merged

anhnh2002 merged 1 commit into
mainfrom
feat/zig-vue-autotools

Conversation

@anhnh2002

Copy link
Copy Markdown
Collaborator

Summary

Adds support for the languages and build systems in SWE-Refactor-Bench that CodeWiki couldn't analyze yet:

  • Zig: new analyzer, analyzers/zig.py. Covers lang05 (goyaml Go→Zig).
  • Vue single-file components: new analyzer, analyzers/vue.py. Covers fw03 (conduit Vue→React).
  • Autotools build files: added to the build-file handling in analyzers/artifact.py. Covers build01 (libsodium autotools→CMake).

All three grammars come from tree-sitter-language-pack, so there's no new dependency.

Zig

  • Components: functions, containers (struct, enum, union, opaque), their member functions (Point.add), and generic type functions (fn List(comptime T: type) type { return struct {...}; }).
  • Edges: calls, T{...} instantiation, and types named in params, return types, fields and annotated locals.
  • Name resolution:
    • @import aliases and re-exports resolve to the file that declares the name, and so do module names registered with addModule in the root build.zig.
    • Calls into std, builtin and third-party packages are dropped.
  • Skipped: test blocks, plus zig-cache/, .zig-cache/ and zig-out/.
  • Build files: build.zig is a build artifact and build.zig.zon a manifest.

Vue

  • Scripts: <script> and <script setup> go through the existing JS/TS analyzers. Everything else in the file is blanked, so line numbers match the .vue file.
  • Components: each file becomes a component, and its options-API members (methods, computed, watch, lifecycle hooks) become its methods.
  • Edges from the component go to:
    • the .vue files and modules it imports (relative and @/ paths);
    • the components its template uses (kebab-case or PascalCase tags);
    • the members and script functions its template expressions call or bind.

Autotools

  • Recognised files: configure.ac, Makefile.am and other *.am files, acinclude.m4, and m4/*.m4.
  • Makefile.am: one unit per library or program it builds (libsodium.la), linked to its _SOURCES. SUBDIRS links the sub-directory Makefile.am files.
  • configure.ac: one unit per AC_ARG_ENABLE / AC_ARG_WITH option, plus links to the Makefile.am files listed in AC_CONFIG_FILES.

Test plan

  • New tests/test_zig_analyzer.py and tests/test_vue_analyzer.py, plus new Autotools cases in tests/test_artifact_analyzer.py.
  • pytest -q -o addopts="": 402 passed, 1 failed. The failure is test_clustering_skip.py::test_over_threshold_calls_llm_and_bad_response_falls_back, which fails the same way on main.
  • ruff check and ruff format --check are clean.
  • End-to-end codewiki generate with --provider codex and model gpt-6-luna. Every run exited 0:
Repo Time Modules Pages / words
gothinkster/vue-realworld-example-app 1m single page 1 / 2.1k
karlseguin/http.zig 16m 3 16 / 21k
zigtools/zls (57k lines of Zig) 25m 5 26 / 35k
PanJiaChen/vue-element-admin (131 .vue files) 21m 4 22 / 24k
jedisct1/libsodium 66m 9 64 / 77k
  • Static analysis is fast and clean. Every file analyzed, and no edge points at a missing component:
    • zls: 1224 components and 1016 cross-file edges, in 0.5s.
    • vue-element-admin: 530 Vue components and members.
    • libsodium: 86 build artifacts with 1167 edges to sources.

Zig (analyzers/zig.py): functions, containers (struct, enum, union,
opaque), their member functions (Point.add), and generic type functions
(fn List(comptime T: type) type { return struct {...}; }) become
components, with call, T{...} instantiation, and type-reference edges.
@import aliases and re-exports resolve to the file that declares the
name, as do module names the root build.zig registers with addModule;
std, builtin, and third-party packages are dropped. test blocks and
zig-cache/, .zig-cache/, zig-out/ are skipped.

Vue (analyzers/vue.py): the <script> and <script setup> blocks of a .vue
file go through the JavaScript/TypeScript analyzers with everything else
blanked, so line numbers stay those of the .vue file. The file itself
becomes a component and its options-API members (methods, computed,
watch, lifecycle hooks) its methods. Edges link the component to the
.vue files and modules it imports (relative and @/ paths), to the
components its template uses (kebab- or PascalCase tags), and to the
members and script functions its template expressions call or bind.

Autotools (analyzers/artifact.py): configure.ac, Makefile.am / *.am,
acinclude.m4 and m4/*.m4 are build artifacts. A Makefile.am gets a unit
per library or program it builds, linked to its _SOURCES; SUBDIRS links
sub-directory Makefile.am files. configure.ac gets a unit per
AC_ARG_ENABLE / AC_ARG_WITH option and links to the Makefile.am files
AC_CONFIG_FILES generates. build.zig is a build artifact and
build.zig.zon a manifest.

Wires .zig and .vue through the call-graph dispatch, supported-language
lists, extension maps, include patterns, CLI validators, and MCP change
detection. All grammars come from tree-sitter-language-pack, so no new
dependency.
@anhnh2002
anhnh2002 merged commit 03d0a29 into main Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant