Skip to content

fix: add Objective-C support for .m/.mm files - #556

Open
VBS2004 wants to merge 1 commit into
Egonex-AI:mainfrom
VBS2004:fix/objc-support-554
Open

fix: add Objective-C support for .m/.mm files#556
VBS2004 wants to merge 1 commit into
Egonex-AI:mainfrom
VBS2004:fix/objc-support-554

Conversation

@VBS2004

@VBS2004 VBS2004 commented Jul 7, 2026

Copy link
Copy Markdown

Fixes #554

Problem

.m and .mm files had no tree-sitter grammar or extractor, causing the file-analyzer to produce empty summaries like "contains 0 function definitions" for every Objective-C file. The scanner also mapped .m to the raw extension string "m" instead of "objective-c" via the language registry.

Changes

  1. Language config (objectivec.ts) — extensions .m/.mm, tree-sitter-objc grammar, ObjC-specific concepts
  2. ObjcExtractor — full tree-sitter structural extraction:
    • @interface / @implementation → classes (merged)
    • @protocol → surfaced as class entries
    • @property → properties with proper name extraction
    • Instance/class methods with multi-part selectors
    • #import / #include → imports
    • Message sends ([recv selector:arg]) → call graph
    • C-style calls (NSLog, dispatch_*) → call graph
  3. Scanner fix.m and .mm added to LANGUAGE_BY_EXTobjective-c
  4. Dependenciestree-sitter-objc@3.0.2 + allowBuild
  5. Tests — 51 tests across 4 suites (22 unit + 8 regression + 19 registry + 2 compat)
  6. Fixtures — 7 real .h/.m/.mm test files covering typical iOS patterns

Verification

✓ 51/51 tests pass (objc-extractor, objc-reproduction, language-registry, cpp-objc-compat)
✓ scan-project.mjs maps .m/.mm → objective-c (was "m")

Add tree-sitter-objc grammar and language extractor so .m/.mm files
produce meaningful structural analysis instead of empty summaries.

- Add objectivec.ts language config (extensions: .m, .mm)
- Add ObjcExtractor: @interface/@implementation classes, @Property,
  @protocol, multi-part selectors, message sends, call graph
- Register config + extractor in index files
- Map .m/.mm -> objective-c in scan-project.mjs LANGUAGE_BY_EXT
- Add tree-sitter-objc@3.0.2 dependency + allowBuild
- Add 49 tests (22 unit + 8 regression + 19 registry + 2 compat)
- Add 7 ObjC test fixture files covering typical iOS project patterns

Fixes: Egonex-AI#554
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.

bug: No Objective-C support

1 participant