apex-language

Official

Implement Apex parsers and validators

Authorforcedotcom
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides concrete guidance and patterns for implementing reliable Apex parsing, listener-based analysis, and compiler-aligned validation so developers can build language-server features that match Salesforce compiler behavior.

Core Features & Use Cases

  • ANTLR grammar mapping: Explains where to find BaseApexParser and BaseApexLexer rules and how parser rule names map to generated Context classes used in listeners.
  • Listener and validator patterns: Describes extending BaseApexParserListener, scope tracking, entering/exiting rule handlers, and integrating with CompilerService to collect results, errors, and warnings.
  • Validation workflow & error codes: Documents TIER 1 and TIER 2 validator strategies, how to consult messages_en_US.properties, and the required workflow for adding and regenerating error codes.
  • Use Case: Build a validator that enforces parameter limits and reports Salesforce-consistent error codes across .cls, .trigger, and anonymous .apex files.

Quick Start

Ask the AI to parse MyClass.cls with the Apex grammar and return AST nodes, syntax errors, and suggested validator checks.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: apex-language
Download link: https://github.com/forcedotcom/apex-language-support/archive/main.zip#apex-language

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.