Skip to content

feat(al): add AL (Business Central / Dynamics 365) language support - #1649

Draft
Capitaller wants to merge 7 commits into
colbymchenry:mainfrom
Capitaller:feature/al-language-support
Draft

feat(al): add AL (Business Central / Dynamics 365) language support#1649
Capitaller wants to merge 7 commits into
colbymchenry:mainfrom
Capitaller:feature/al-language-support

Conversation

@Capitaller

Copy link
Copy Markdown

Summary

Adds full AL (Microsoft Dynamics 365 Business Central) language support to CodeGraph, enabling semantic code intelligence across large ERP codebases.

What's included:

  • New alExtractor in src/extraction/languages/al.ts with a resolveName hook that correctly resolves AL object names from the object_name field (Codeunit, Table, Page, Report, XMLport, Query, and all extension types)
  • .al extension registered in src/extraction/grammars.ts
  • 'al' language type added to src/types.ts
  • Case-insensitive reference resolution in src/resolution/name-matcher.ts (AL is case-insensitive by language spec)
  • Extraction parity test in __tests__/al-extraction.test.ts
  • Uses the tree-sitter-al WASM grammar (bundled under src/extraction/wasm/)

Motivation

AL is the primary language for Microsoft Dynamics 365 Business Central, one of the most widely deployed ERP platforms globally. A typical BC codebase (e.g. the official W1 BaseApp) contains 7,800+ files, 115,000+ symbols and 264,000+ dependency edges.

Without CodeGraph, AI agents are forced to rely on grep/find, which fails to understand the graph of Codeunit dependencies and produces shallow, keyword-matched answers.

With CodeGraph, an AI agent answers this in 47s using 2 tool calls:

"Which Codeunit and function is responsible for calculating invoice rounding when there is a 100% prepayment on a Sales line? What temporary tables does it use?"

The agent correctly traces the full call chain: GetSalesLinesInsertInvoiceRoundingInitInvoiceRoundingLine, identifies the responsible Codeunit (Sales-Post Prepayments, Codeunit 442), and names the correct temporary tables (TempPrepmtInvLineBuf, TempSalesLine, TempVATAmountLine). Without CodeGraph, the same agent runs 10+ grep commands and produces a shallow answer that misses the core architecture.

Test plan

  • npm run build — passes with zero TypeScript errors
  • npm run test __tests__/al-extraction.test.ts — AL extraction parity test passes (Codeunit name, procedure nodes, and call reference edges all verified)
  • npm run test — full suite passes: 175 test files, 3,010 tests, 0 failures
  • Indexed 7,820 files from the official Microsoft BC W1 BaseApp source → 115,609 nodes, 264,588 edges in 11.3s
  • Verified AI agent uses codegraph_explore MCP tool calls exclusively — no grep/find fallback — on real Business Central architecture queries

@Capitaller Capitaller changed the title Ífeat(al): add AL (Business Central / Dynamics 365) language support feat(al): add AL (Business Central / Dynamics 365) language support Aug 30, 2026
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