feat(extract): add Salesforce Apex extractor (.cls, .trigger)#1159
Closed
mishrajeev wants to merge 1 commit into
Closed
feat(extract): add Salesforce Apex extractor (.cls, .trigger)#1159mishrajeev wants to merge 1 commit into
mishrajeev wants to merge 1 commit into
Conversation
Adds regex-based extraction support for Salesforce Apex — a Java-like language used for server-side logic on the Salesforce platform. No tree-sitter-apex grammar exists on PyPI, so this follows the same regex pattern used for Pascal, Razor, and .NET project files. Extracts from .cls files: - Classes (public/global/private, with/without sharing, abstract, virtual) - Inner interfaces and enums - Methods at all access levels, including annotated methods (@AuraEnabled, @future, @InvocableMethod, @istest) - Inheritance: extends → `extends` edge, implements → `implements` edge - SOQL queries: [SELECT ... FROM SObject] → `uses` edge to the SObject - DML operations: insert/update/delete/upsert/merge/undelete → `uses` edges Extracts from .trigger files: - Trigger declaration name + the SObject it fires on → `uses` edge Changes: - graphify/extract.py: add extract_apex(); register .cls/.trigger in _DISPATCH - graphify/detect.py: add .cls and .trigger to CODE_EXTENSIONS - tests/fixtures/sample.cls: Apex class fixture covering all extracted constructs - tests/fixtures/sample.trigger: Apex trigger fixture on Account SObject - tests/test_languages.py: 12 new tests (class, enum, interface, method, contains/method relations, SOQL uses edge, DML uses edge, file node, trigger extraction, trigger SObject link, missing-file safety, no-dangling-edges invariant) - README.md: add .cls and .trigger to the supported extensions table All 12 tests pass. No regressions in existing suite.
safishamsi
added a commit
that referenced
this pull request
Jun 7, 2026
… features) #1118 — prune stale AST nodes on full re-extraction (#1116) Stamps every AST-extracted node with _origin="ast" in extract(). On a full rebuild _rebuild_code drops any AST-marked node absent from the fresh output even when its source file survives, fixing stale symbols. Backward-compat: marker-less nodes from pre-1118 graphs survive one cycle then self-heal. #1110 — stop reading images and PDFs as garbage in headless extract Images route through per-backend vision payloads (base64/data-URI/bytes for claude/openai/bedrock); non-vision backends get _strip_pixels for graceful degradation. PDFs reuse pypdf. 5MB cap, 20-image chunk limit. #1159 — Salesforce Apex extractor (.cls, .trigger) Regex-based extractor: classes, interfaces, enums, methods, triggers, SOQL/DML edges. No new dependency. Dispatched as .cls and .trigger. #1107 — Azure OpenAI Service backend (--backend azure) Uses AzureOpenAI SDK client (from existing openai package). Auto-detects when AZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINT both set. Uses max_completion_tokens (not deprecated max_tokens). #1103 — live PostgreSQL introspection (--postgres DSN) graphify extract --postgres "postgresql://..." introspects tables, views, routines, and FK relations via information_schema (SERIALIZABLE READ ONLY). Credentials sanitized on error. New graphify[postgres] extra (psycopg3). Union-resolved llm.py conflict: Azure functions + bedrock images= param. Fixed test_image_vision.py mock to accept timeout= kwarg (our #1112). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
Landed in 7467c1b. What it adds: Regex-based AST extractor for Salesforce Apex ( 12 tests pass on real fixtures. No new dependencies. 1910 passed, 0 failures. |
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.
Adds regex-based extraction support for Salesforce Apex — a Java-like language used for server-side logic on the Salesforce platform. No tree-sitter-apex grammar exists on PyPI, so this follows the same regex pattern used for Pascal, Razor, and .NET project files.
Extracts from .cls files:
extendsedge, implements →implementsedgeusesedge to the SObjectusesedgesExtracts from .trigger files:
usesedgeChanges:
All 12 tests pass. No regressions in existing suite.