[W-20479746] refactor: create stub apex impls for builtins #174
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.
Refactor Built-in Type Management and Resolution
Summary
This PR refactors how built-in Apex types (String, Integer, List, Map, Set, etc.) are managed in the Standard Apex Library. The changes improve maintainability by separating built-in type definitions into a dedicated
builtins/folder while maintaining backward compatibility through ZIP generation that merges them into the StandardApexLibrary structure.Changes
1. Built-in Type Source Organization
Restored
builtins/folder insrc/resources/with 15 essential built-in classes:Blob,Boolean,Date,DateTime,Decimal,Double,Id,Integer,Long,String,TimeList,Map,SetObjectModified ZIP generation (
scripts/generate-zip.mjs) to merge built-in classes frombuiltins/intoStandardApexLibrary/System/during ZIP creationRemoved built-in classes from
StandardApexLibrary/System/in source (they now only exist inbuiltins/and are merged during build)2. Type Resolution Improvements
apexlib://resources/StandardApexLibrary/System/...)isBuiltinClass()method to ResourceLoader for built-in type detection3. Symbol Resolution Enhancements
List<T>,Map<K,V>) with empty names4. Code Simplification
apexlib://resources/StandardApexLibrary/5. Documentation and Testing
File Changes
Added Files
packages/apex-parser-ast/src/resources/builtins/*.cls(15 built-in type class files)packages/apex-parser-ast/test/fixtures/builtin-types.clsModified Files
packages/apex-parser-ast/scripts/generate-zip.mjs- ZIP generation with built-in mergepackages/apex-parser-ast/src/utils/resourceLoader.ts- Built-in type detection and resolutionpackages/apex-parser-ast/src/utils/TypeInfoFactory.ts- Primitive type recognitionpackages/apex-parser-ast/src/utils/BuiltInTypeTables.ts- Simplified to non-class types onlypackages/apex-parser-ast/src/symbols/ApexSymbolManager.ts- Built-in type resolutionpackages/apex-parser-ast/src/listeners/ApexSymbolCollectorListener.ts- Enhanced type reference collectionpackages/apex-parser-ast/src/types/symbol.ts- Type system updatespackages/apex-parser-ast/README.md- Maintenance documentationRemoved Files
packages/apex-parser-ast/src/resources/StandardApexLibrary/System/Date.cls(moved to builtins/)packages/apex-parser-ast/src/resources/StandardApexLibrary/System/Time.cls(moved to builtins/)Backward Compatibility
✅ Fully backward compatible - The ZIP file structure remains unchanged:
StandardApexLibrary/System/in the ZIP (merged during build)Testing
Impact
Benefits
Risk Assessment
Migration Notes
No migration required - this is an internal refactoring that maintains backward compatibility.
@W-20479746@