From 5c52a004311aa2c5adfa2e179721761f9b7419e0 Mon Sep 17 00:00:00 2001 From: Totopo27 <35828647+Totopo27@users.noreply.github.com> Date: Thu, 8 Oct 2026 18:33:34 -0600 Subject: [PATCH] fix(discover): map jinja and jinja2 in userconfig language table Signed-off-by: Totopo27 <35828647+Totopo27@users.noreply.github.com> --- src/discover/userconfig.c | 2 ++ tests/test_userconfig.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/discover/userconfig.c b/src/discover/userconfig.c index 8f906ef07..8671d08fd 100644 --- a/src/discover/userconfig.c +++ b/src/discover/userconfig.c @@ -164,6 +164,8 @@ static const lang_name_entry_t LANG_NAME_TABLE[] = { {"form", CBM_LANG_FORM}, {"magma", CBM_LANG_MAGMA}, {"wolfram", CBM_LANG_WOLFRAM}, + {"jinja2", CBM_LANG_JINJA2}, + {"jinja", CBM_LANG_JINJA2}, }; #define LANG_NAME_TABLE_SIZE (sizeof(LANG_NAME_TABLE) / sizeof(LANG_NAME_TABLE[0])) diff --git a/tests/test_userconfig.c b/tests/test_userconfig.c index a9c3b4a5e..10eacec1b 100644 --- a/tests/test_userconfig.c +++ b/tests/test_userconfig.c @@ -39,7 +39,7 @@ TEST(userconfig_project_basic) { char proj[512]; snprintf(proj, sizeof(proj), "%s/.codebase-memory.json", dir); ASSERT_EQ( - write_json(proj, "{\"extra_extensions\":{\".blade.php\":\"php\",\".mjs\":\"javascript\"}}"), + write_json(proj, "{\"extra_extensions\":{\".blade.php\":\"php\",\".mjs\":\"javascript\",\".html\":\"jinja2\"}}"), 0); cbm_userconfig_t *cfg = cbm_userconfig_load(dir); @@ -47,6 +47,7 @@ TEST(userconfig_project_basic) { ASSERT_EQ(cbm_userconfig_lookup(cfg, ".blade.php"), CBM_LANG_PHP); ASSERT_EQ(cbm_userconfig_lookup(cfg, ".mjs"), CBM_LANG_JAVASCRIPT); + ASSERT_EQ(cbm_userconfig_lookup(cfg, ".html"), CBM_LANG_JINJA2); ASSERT_EQ(cbm_userconfig_lookup(cfg, ".go"), CBM_LANG_COUNT); /* not in user config */ cbm_userconfig_free(cfg);