Skip to content

Formulas: report the parse error for the text as typed (#2030) - #6

Draft
isaac-levine wants to merge 494 commits into
mainfrom
formula-incomplete-error
Draft

isaac-levine wants to merge 494 commits into
mainfrom
formula-incomplete-error

Conversation

@isaac-levine

Copy link
Copy Markdown
Owner

Typing an incomplete formula such as =1+ reported "unexpected )" although no ) was typed. Cell entry closes missing parentheses by retrying the parse with up to 8 appended ), and it returned the error from the last retry. That error is about the appended parens, not the text the user typed.

The entry path now keeps the error from the first parse and reports that if every retry fails. =1+ now says "unexpected end of formula". The same retry loop in crates/ui-egui/src/formula_locale.rs got the same change. A new engine test covers the message and checks that =SUM(1,2 is still auto-closed.

Commands run:

  • cargo fmt --all -- --check: clean
  • cargo clippy -p gridcraft-engine -p gridcraft-ui-egui --all-targets -- -D warnings: clean
  • cargo test -p gridcraft-engine: all pass (296 unit tests plus integration tests)
  • cargo test -p gridcraft-ui-egui --lib formula_locale: passes, but no test in that filter exercises the changed code
  • cargo xtask layers: no violations

Not verified: cargo xtask wasm and the full gridcraft-ui-egui test suite were not run (the sandbox disk filled up mid-run). I did not confirm the new test fails without the fix by running it, only by reading the code path.

Upstream issue: storytold#2030


Generated by Claude Code

echelon and others added 30 commits October 12, 2026 23:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
echelon and others added 30 commits October 19, 2026 12:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… where dbus-daemon is missing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ength

# Conflicts:
#	docs/localization-parity.md
…-left-sheets

# Conflicts:
#	docs/file-format-parity.md
#	docs/localization-parity.md
# Conflicts:
#	docs/file-format-parity.md
#	docs/localization-parity.md
# Conflicts:
#	docs/file-format-parity.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…press

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/file-format-parity.md
#	docs/localization-parity.md
…anslations

# Conflicts:
#	crates/ui-egui/src/i18n.rs
#	docs/localization-parity.md
…itor-references

docs: drop references to competing commercial software
…o-closed parens (storytold#2030)

Entry retries with up to 8 appended ')' and returned the last error, so an incomplete formula like =1+ reported an unexpected ')' the user never typed. Keep the first error instead. Same fix in the UI locale path.
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.