Skip to content

fix: add .m extension to EXT_TABLE for content-based disambiguation#306

Open
KuaaMU wants to merge 1 commit intoDeusData:mainfrom
KuaaMU:fix/m-files-missing
Open

fix: add .m extension to EXT_TABLE for content-based disambiguation#306
KuaaMU wants to merge 1 commit intoDeusData:mainfrom
KuaaMU:fix/m-files-missing

Conversation

@KuaaMU
Copy link
Copy Markdown

@KuaaMU KuaaMU commented Apr 30, 2026

Problem

.m files (MATLAB, Objective-C, Magma) are silently ignored by the indexer. detect_file_language returns CBM_LANG_COUNT before the content-based disambiguation logic (cbm_disambiguate_m) can run, because .m is missing from EXT_TABLE.

Root Cause

In src/discover/language.c, EXT_TABLE includes .matlab and .mlx but omits .m. The lookup in cbm_language_for_filename returns Unknown, causing detect_file_language to abort early.

Fix

Add {".m", CBM_LANG_MATLAB} to EXT_TABLE in the MATLAB section. The initial mapping to MATLAB is safe because the subsequent cbm_disambiguate_m call (already in detect_file_language) will correctly overwrite it by reading file contents.

Fixes #296

The .m extension was missing from EXT_TABLE, causing detect_file_language
to return CBM_LANG_COUNT (Unknown) before the content-based disambiguation
logic (cbm_disambiguate_m) could ever run. This made .m files invisible
to the indexer.

Add {".m", CBM_LANG_MATLAB} to EXT_TABLE so the initial lookup succeeds,
allowing the subsequent cbm_disambiguate_m call to correctly determine
whether the file is MATLAB, Objective-C, or Magma.

Fixes DeusData#296
@DeusData DeusData added bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

# Bug: .m files are ignored by the indexer (Unreachable code in discover.c)

2 participants