Checklist for landing a new first-class source language without drifting from repo conventions.
- Decide whether the language is source-language parity or graph-first only.
- List the exact syntax and resolution forms you will claim in
docs/language-parity.mdanddocs/scenario-catalog.md. - If any limitation is intentional, document it before implementation and cover it with an explicit regression test.
- Add the language definition in
src/languages/definitions/<language>.ts. - Register it from
src/languages/all.ts. - Export support from
src/languages.tswhen the public support surface expects it. - Confirm
src/bootstrap/treeSitterLanguages.tsderives the intended chunking config for the new language. - Add the file extension to discovery and resolution in
src/util.ts. - Update CLI help in
src/cli.tswhen a command accepts a language override and cannot derive it from the registered chunking configs.
- Add the JS fallback grammar dependency in
packages/codegraph-js-fallback/package.json. - Update the fallback loader if the grammar package exports a non-standard symbol.
- Add the native grammar dependency in
packages/codegraph-native/Cargo.toml. - Register the native language id and smoke coverage in
packages/codegraph-native/src/lib.rs. - Rebuild the native addon before trusting any native parity failures.
- Define chunk blocks, split points, comments, and node-type hints in the language definition.
- Add import, export, local, and import-binding queries that match the real grammar node names.
- Implement
classifyDefinition,isDeclarationName, and scope helpers so symbol indexing and navigation stay consistent with other source languages. - Prefer shared pipeline hooks over language-specific branches. Add a language-specific branch only when the grammar shape actually requires it.
- Add statement-level parsing helpers in
src/languages/importStatementParsers.tswhen the query captures a whole statement instead of normalized binding captures. - Extend the relevant
src/indexer/module behind thesrc/indexer.tsfacade so import bindings normalize into the sharedImportBindingmodel. - Extend
src/graphs.tsonly where graph and specifier extraction need language-specific recovery. - Extend
src/util.tsfor language-specific module resolution, package metadata parsing, and caches. - Keep dynamic or ambiguous cases conservative. Prefer
externalornot_foundover false-positive navigation. - If the language allows more than one package or namespace surface in a single file, model the symbol index per package/namespace entry instead of assuming one file maps to one package.
- If a resolver is choosing among multiple candidate files for a named symbol, deterministic sorting is usually enough.
- If a resolver is handling a package-wide or wildcard import that semantically depends on multiple files, expand it to multiple graph edges instead of picking the first candidate.
- When you keep a single-target fallback, add stable ordering before any
candidates[0]or equivalent first-match pick. - When you expand to multiple graph edges, add fixtures that prove the behavior across more than one file in the imported package.
- Add or extend
tests/languages/<language>.test.ts. - Add realistic fixtures under
tests/samples/<language>/. - Cover syntax permutations in focused tests such as
tests/import-binding-regressions.test.tsortests/resolution.test.tswhen shared suites would hide the exact regression. - Update
tests/project-file-discovery.test.tsif project-file discovery changes.
- Add shared go-to-definition coverage in
tests/goto.test.ts. - Add shared references coverage in
tests/references.test.ts. - Add native-vs-JS semantic parity in
tests/native-semantic-parity.test.ts. - Add native extraction parity in
tests/native-tree-sitter.test.ts. - Add native-only ownership coverage in
tests/native-parser-ownership.test.tswhen the language is expected to work without the JS fallback package.
- Update
docs/language-parity.md. - Update
docs/scenario-catalog.md. - Update
README.mdwhen supported-language lists or capability summaries changed. - Update
codegraph-skill/codegraph/SKILL.mdwhen the repo's agent-facing capability surface changed.
- Run the focused language suite.
- Run the shared semantic suites.
- Run the native parity and native-only ownership suites if the language uses the native runtime.
- Run
npm run buildafter grammar and runtime changes. - Do not claim support until the docs, fixtures, and verification output all agree.