Skip to content

feat(extraction): add Slint language support#1081

Open
ZyphrZero wants to merge 3 commits into
colbymchenry:mainfrom
ZyphrZero:codex/issue-648-slint-support
Open

feat(extraction): add Slint language support#1081
ZyphrZero wants to merge 3 commits into
colbymchenry:mainfrom
ZyphrZero:codex/issue-648-slint-support

Conversation

@ZyphrZero

@ZyphrZero ZyphrZero commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Add Slint (.slint) as a supported language with a vendored ABI-15 tree-sitter grammar.
  • Extract Slint components, globals, interfaces, structs, enums, properties, callbacks, functions, imports, child component references, and call edges.
  • Fix Slint re-export barrels such as export { AboutPage } from "about_page.slint"; so barrel-only files create import nodes and resolved cross-file imports edges.
  • Document Slint support in the README, docs language reference, changelog, and add Slint repos to the reusable agent-eval corpus.

Refs #648
Refs #916

Validation

  • npm run build with Node v24.14.0: passed.
  • npx vitest run __tests__/slint-extraction.test.ts: passed, 5 tests.
  • npx vitest run __tests__/slint-extraction.test.ts --pool=forks --maxWorkers=1 --minWorkers=1: passed, 5 tests.
  • npx vitest run __tests__/extraction.test.ts -t "React|TSX|component": passed, 14 selected tests.
  • CLI smoke: indexed a temporary .slint project with dist/bin/codegraph.js; status reported languages: ["slint"], 1 file, 6 nodes, 8 edges.
  • Re-export smoke: indexed a temporary pages.slint barrel and verified SQLite edges from pages.slint to AboutPage, TableViewPage, and TableViewPageAdapter in the target files.

Full-suite status on Windows

  • npm test is not green in this Windows checkout. The failures are outside the Slint extractor path: temp-dir EPERM cleanup in JVM/C++/PHP/MCP tests, MCP initialize/roots Windows file-lock failures, worktree tests comparing short ADMINI~1 paths with long Administrator paths, and a Vitest worker OOM when running the large extraction.test.ts file.
  • I did not change non-Slint test infrastructure in this PR; the Slint-specific tests and focused regression checks above pass.

Add-language extraction benchmark

Ran scripts/add-lang/bench.sh slint <repo> <url> "<question>" headless with the local PR build via CG_BIN=/tmp/codegraph-dev-bin/codegraph on 2026-06-30. After the re-export fix, extraction was rerun and the large repo index grew as expected.

Tier Repo Indexed files Nodes Edges Extraction
Small slint-nodejs-template 2 9 10 PASS
Medium SurrealismUI 244 3,439 3,744 PASS
Large slint 2,694 42,001 143,353 PASS

Paid agent A/B benchmark

Headless Claude Code A/B (--model sonnet --effort high, --max-budget-usd 4) comparing local CodeGraph MCP vs no CodeGraph MCP.

Repo Arm Tool calls Read Bash/Grep CodeGraph calls Duration Cost
slint-nodejs-template with CodeGraph 2 0 0 2 17s $0.194
slint-nodejs-template without CodeGraph 5 3 2 0 17s $0.189
SurrealismUI with CodeGraph 5 0 0 5 55s $0.426
SurrealismUI without CodeGraph 19 15 4 0 71s $0.471

Previous valid large-repo paid A/B run, before the re-export fix:

Repo Arm Tool calls Read Bash/Grep CodeGraph calls Duration Cost
slint with CodeGraph 15 7 1 7 75s $0.765
slint without CodeGraph 20 12 5 0 86s $0.562

The large-repo paid A/B rerun after the re-export fix was blocked by API 402 Insufficient Balance in both arms, so I am not claiming post-fix large A/B numbers. The post-fix extraction benchmark did complete and shows the larger slint repo index increasing from 41,774 nodes / 142,923 edges to 42,001 nodes / 143,353 edges.

Notes

  • The benchmark exposed a real Slint support gap: barrel files like examples/gallery/ui/pages/pages.slint only re-export symbols and previously indexed with no useful dependencies. This PR now links those barrels to the exported target symbols.
  • The small and medium Slint repos reached 0 Read/Bash with CodeGraph in the latest paid rerun. Medium still improved duration/cost; small had fewer tool calls and no reads, but similar duration and slightly higher cost in that rerun.
  • The previous valid large official slint run reduced duration, total tool calls, Reads, and Bash/Grep usage, but still fell back to 7 Reads and cost more than the no-CodeGraph arm. The residual fallback is around the mixed Slint/Rust include_modules! / generated-runtime boundary, so this PR proves useful Slint extraction but does not claim complete cross-language macro/runtime flow coverage.

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