From 5cb3e04b6eea4ba35e289722ff187e627333e18b Mon Sep 17 00:00:00 2001 From: Henrik Jess Nielsen Date: Mon, 11 May 2026 11:41:35 +0200 Subject: [PATCH] fix(modules): case-insensitive module ref lookup Catalog stores lowercase paths (e.g. modules/keyvault) but .bicep files may use camelCase (e.g. modules/keyVault). Make get_module_by_ref case-insensitive so completions work regardless of casing. --- ilsp/bicep_lsp/modules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ilsp/bicep_lsp/modules.py b/ilsp/bicep_lsp/modules.py index 588dd65..a98841f 100644 --- a/ilsp/bicep_lsp/modules.py +++ b/ilsp/bicep_lsp/modules.py @@ -129,9 +129,11 @@ class BicepModuleCatalog: Matches both new-style ('modules/appservice', 'util/types') and old-style bare names ('appservice') so completions work regardless of module version. + Case-insensitive to handle catalog lowercase vs. camelCase in .bicep files. """ + ref_lower = ref_path.lower() for mod in cls._modules: - if mod["ref_path"] == ref_path or mod["name"] == ref_path: + if mod["ref_path"].lower() == ref_lower or mod["name"].lower() == ref_lower: return mod return None