fix: add .m extension to EXT_TABLE for content-based disambiguation#306
Open
KuaaMU wants to merge 1 commit intoDeusData:mainfrom
Open
fix: add .m extension to EXT_TABLE for content-based disambiguation#306KuaaMU wants to merge 1 commit intoDeusData:mainfrom
KuaaMU wants to merge 1 commit intoDeusData:mainfrom
Conversation
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
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.
Problem
.mfiles (MATLAB, Objective-C, Magma) are silently ignored by the indexer.detect_file_languagereturnsCBM_LANG_COUNTbefore the content-based disambiguation logic (cbm_disambiguate_m) can run, because.mis missing fromEXT_TABLE.Root Cause
In
src/discover/language.c,EXT_TABLEincludes.matlaband.mlxbut omits.m. The lookup incbm_language_for_filenamereturns Unknown, causingdetect_file_languageto abort early.Fix
Add
{".m", CBM_LANG_MATLAB}toEXT_TABLEin the MATLAB section. The initial mapping to MATLAB is safe because the subsequentcbm_disambiguate_mcall (already indetect_file_language) will correctly overwrite it by reading file contents.Fixes #296