Skip to content

feat: include Salesforce Apex files in default patterns#199

Closed
roian6 wants to merge 1 commit into
cocoindex-io:mainfrom
roian6:feat/cocoindex-code-175-apex-default-patterns
Closed

feat: include Salesforce Apex files in default patterns#199
roian6 wants to merge 1 commit into
cocoindex-io:mainfrom
roian6:feat/cocoindex-code-175-apex-default-patterns

Conversation

@roian6

@roian6 roian6 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Salesforce Apex files are not indexed by default because .cls class files and .trigger trigger files are missing from DEFAULT_INCLUDED_PATTERNS.

This keeps the change scoped to default file matching and docs. detect_code_language() already recognizes .cls and .trigger files as apex.

Changes

  • Add **/*.cls and **/*.trigger to the default include patterns.
  • Document Apex in the README supported languages table.
  • Add a focused regression test for the default include patterns.

Closes #175

Verification

  • uv run pytest tests/test_settings.py::test_default_project_settings -q
  • uv run pytest tests/test_settings.py -q
  • uv run ruff check src/cocoindex_code/settings.py tests/test_settings.py
  • uv run mypy src/cocoindex_code/settings.py tests/test_settings.py
  • git diff --check
  • uv run prek run --all-files — non-pytest hooks passed (ruff, ruff-format, uv-lock, mypy, and basic file checks); the pytest hook is blocked in this local environment by sqlite_vec/vec0.so: wrong ELF class: ELFCLASS32 and a local HuggingFace cache permission issue.

@badmonster0 badmonster0 requested a review from georgeh0 June 24, 2026 19:36
@badmonster0

Copy link
Copy Markdown
Member

thanks a lot @roian6 , @georgeh0 can help take a look!

@georgeh0

Copy link
Copy Markdown
Member

Hi @roian6,

Thanks for creating the PR. .cls and .trigger files are proprietary file formats and they may also mean something else (e.g. when searching .cls file on Google Search we got a lot of different results).

included_patterns can be customized by editing .cocoindex_code/settings.yml for each project folder. I'm wondering if this works for your case? If not, I would like to understand what else we can improve to make you customize more easily without updating the default pattern list.

Thanks!

@roian6

roian6 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look — that concern makes sense. I agree .cls is ambiguous enough that adding it to the global default include list may be too broad.

My intent was to address #175 from the first-run Apex project discovery angle, but the per-project .cocoindex_code/settings.yml path covers this for users who know to configure it:

include_patterns:
  - "**/*.cls"
  - "**/*.trigger"

language_overrides:
  - ext: cls
    lang: java
  - ext: trigger
    lang: java

Given your point about avoiding broader defaults, I’ll close this PR rather than push the default pattern change further. If you’d like, I can open a separate docs-only PR later with a small Apex settings example instead.

@roian6 roian6 closed this Jun 26, 2026
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.

Support for Salesforce Apex language

3 participants