Skip to content

Improve parser error messages for templates#22400

Open
dpny518 wants to merge 2 commits intodigital-asset:mainfrom
dpny518:improve-parser-error-messages
Open

Improve parser error messages for templates#22400
dpny518 wants to merge 2 commits intodigital-asset:mainfrom
dpny518:improve-parser-error-messages

Conversation

@dpny518
Copy link
Copy Markdown

@dpny518 dpny518 commented Nov 20, 2025

This commit enhances parse error diagnostics to provide more helpful, context-specific error messages for common Daml template issues.

Fixes #22354: When 'choice' is badly indented, the error now includes a hint about proper indentation with an example.

Addresses #22361: For generic parse errors that commonly occur with missing key type signatures, the error now includes hints about common template parsing issues, including the requirement that 'key' needs an explicit type signature.

The implementation adds a diagnostic post-processing layer in sendFileDiagnostics that pattern-matches specific error messages and enhances them with targeted hints, similar to how LF conversion errors are handled.

dpny518 and others added 2 commits November 20, 2025 11:17
This commit enhances parse error diagnostics to provide more helpful,
context-specific error messages for common Daml template issues.

Fixes digital-asset#22354: When 'choice' is badly indented, the error now includes
a hint about proper indentation with an example.

Addresses digital-asset#22361: For generic parse errors that commonly occur with
missing key type signatures, the error now includes hints about
common template parsing issues, including the requirement that 'key'
needs an explicit type signature.

The implementation adds a diagnostic post-processing layer in
sendFileDiagnostics that pattern-matches specific error messages
and enhances them with targeted hints, similar to how LF conversion
errors are handled.
@adrien-piquerez-da adrien-piquerez-da requested a review from a team January 5, 2026 08:23
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.

[Error Message Improvement] improve error on badly indented choice

1 participant