Skip to content

Add actionable compiler diagnostics - #8

Merged
konojunya merged 3 commits into
mainfrom
jj/actionable-diagnostics
Sep 3, 2026
Merged

Add actionable compiler diagnostics#8
konojunya merged 3 commits into
mainfrom
jj/actionable-diagnostics

Conversation

@konojunya

Copy link
Copy Markdown
Contributor

背景

Stack consumers need compiler-owned correction guidance so Web and future editors can explain source errors without duplicating language semantics. The specification now requires ordered expected values and provides canonical actionable-diagnostic fixtures.

実装方法

  • Add ordered expected values to the public diagnostic model with an empty default.
  • Report exact parser expectations and corrective help at recursive-descent boundaries.
  • Report all supported node kinds, edge kinds, and layout directions for invalid closed-set values.
  • Suggest up to three nearby node or layout identifiers using Unicode-scalar Levenshtein distance, deterministic ordering, and related declaration ranges.
  • Add corrective help to encoding, string, duplicate, constraint, and complexity diagnostics.
  • Pin conformance to specification commit 7f9154d22702ddf02f2713bbc06dde7bdf635806 and compare expected only when a canonical fixture opts in.

テスト方法

  • cargo +stable fmt --check
  • cargo +stable test
  • STACK_SPECIFICATION_DIR=../specification cargo +stable test --features conformance --test conformance
  • cargo +stable clippy --all-targets --all-features -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo +stable doc --no-deps
  • cargo +stable llvm-cov --lib --all-features --workspace --fail-under-lines 95 --fail-under-functions 95 --fail-under-regions 95
  • cargo +1.85.0 test
  • cargo +1.85.0 clippy --all-targets --all-features -- -D warnings

Review 視点 / 懸念点

The diagnostic representation is additive but public. Identifier suggestions intentionally use the specification threshold and never exceed three results. Human-readable wording is not a compatibility contract; structured expected values are exact only where conformance fixtures opt in.

@konojunya
konojunya merged commit 3d23794 into main Sep 3, 2026
2 checks passed
@konojunya
konojunya deleted the jj/actionable-diagnostics branch September 3, 2026 11:56
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