Add Formula Exception Stubs to System Namespace - #78
Merged
Conversation
Fix stale/inaccurate guidance in copilot-instructions.md: show the BSD copyright header in the stub pattern, drop the hardcoded 2025 year in favour of the current year, permit native Exception/UnsupportedOperationException in the import rule, and bump the version example to v67.X.X (Summer '26). Add .claude/CLAUDE.md that forwards to copilot-instructions.md so Claude Code and Copilot share one source of instructions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add FormulaValidationException and FormulaEvaluationException to the System namespace so apex-ls resolves the exceptions thrown by the Formula/FormulaEval API instead of reporting "No type declaration found". Closes #77 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kjonescertinia
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
FormulaEvaluationExceptionandFormulaValidationExceptionto theSystempackage so apex-ls resolves the exceptions theFormulaEvalAPI throws, instead of reporting "No type declaration found". Closes #77.Both follow the standard exception-stub pattern (extends
Exception, four universal constructors, bodies throwingUnsupportedOperationException), matchingMathException.Salesforce Documentation
These exceptions are real but oddly undocumented, they appear only in prose and only in the original preview note:
build()triggersFormulaValidationException,evaluate()triggersFormulaEvaluationExceptionTesting/Evidence
Run the following Apex snippet against an org on API version 67.0:
Additional Changes
.github/copilot-instructions.mdtweaks: "current calendar year" instead of hardcoded 2025, v64/Summer '25 bumped to v67/Summer '26, native-type allowlist spelled out, full header example.claude/CLAUDE.mdwhich just references.github/copilot-instructions.md