Implement Jai formatter

This commit is contained in:
hgranthorner
2026-08-06 11:10:07 -04:00
parent 065e0b0bf4
commit 427269ad78
5 changed files with 432 additions and 17 deletions

View File

@@ -171,12 +171,14 @@ Each phase has a machine-checkable gate. Do not advance without a green gate.
| **4** | Structure view, folding, `#import`/`#load` reference resolution + go-to-definition | Tier 4 fixture tests — **done** |
| **5** | Completion (keywords, directives, module names, visible declarations, parameters, module aliases, incomplete-expression recovery), rename, find-usages | Tier 4 fixture tests — **done** (84-test suite) |
| **5a** | Configurable Jai module/import roots and indexed external search scope | Tier 4 settings, resolution, completion, navigation, and find-usages tests — **done** (93-test suite) |
| **6** | Formatter, code style settings | Formatter round-trip: formatting the corpus is idempotent |
| **6** | Formatter, code style settings | Formatter round-trip**done**, formatting all 714 corpus files is idempotent |
| **7** | Inspections (e.g. `#must` misuse), quick fixes, live templates | Tier 4 + `verifyPlugin` |
| **8** | Optional: run-configuration to invoke the `jai` compiler, parse its error output | Integration test against `~/.local/jai/bin` |
Phase 6's idempotence check (format twice, assert no change) is another
corpus-scale invariant that needs no human judgment.
corpus-scale invariant that needs no human judgment. `JaiFormatterTest` runs this
check across all 714 files and also covers formatter registration, representative
spacing/indentation, directive flags, strings, and opaque `#asm` bodies.
---
@@ -185,8 +187,8 @@ corpus-scale invariant that needs no human judgment.
Phase 5 completion now covers keywords, compiler directives,
`#import`/`#load` module and file paths, visible same-file or imported
top-level declarations, procedure parameters, and members of imported module
aliases. Struct-field completion remains a possible follow-up before or after
Phase 6, but it is not currently a committed milestone.
aliases. Struct-field completion remains a possible follow-up, but it is not
currently a committed milestone.
## 5. Risks and how the plan handles them
@@ -216,6 +218,6 @@ Phase 6, but it is not currently a committed milestone.
setup, works today), or install a system JDK via Homebrew? I'd default to the
wrapper.
Phases 05a are implemented and verified headlessly. The next decision is
whether to continue with the optional formatter, inspections, and compiler
integration work in Phases 68.
Phases 06 are implemented and verified headlessly. The next decision is
whether to continue with the optional inspections and compiler integration work
in Phases 78.