backup: uncommitted changes from MAC-M9FQ0900T3 2026-05-17 15:52:31
This commit is contained in:
@@ -130,6 +130,19 @@ class _ProxySession:
|
||||
mod_name = last_mod.group(1)
|
||||
mod_ver = last_mod.group(2)
|
||||
|
||||
# Array item context: cursor inside [...] for an array param.
|
||||
# Must be checked BEFORE value_m, since array lines also match
|
||||
# the value pattern (e.g. `additionalAccess: ['`).
|
||||
array_m = re.search(r"^\s*(\w+):\s*\[", current)
|
||||
if array_m and current.count("[") > current.count("]"):
|
||||
return {
|
||||
"type": "param_array_item",
|
||||
"module": mod_name,
|
||||
"version": mod_ver,
|
||||
"param": array_m.group(1),
|
||||
"has_open_quote": bool(re.search(r"'[^']*$", current)),
|
||||
}
|
||||
|
||||
# Check if cursor is after 'paramname: ' on the current line
|
||||
# (value context — inject enum/allowed values)
|
||||
value_m = re.search(r"^\s*(\w+):\s*('?)([^'{}]*)$", current)
|
||||
@@ -197,11 +210,18 @@ def _inject_completions(msg: dict[str, Any], context: dict | None = None) -> byt
|
||||
context["param"],
|
||||
context.get("has_open_quote", False),
|
||||
)
|
||||
elif ctx_type == "param_array_item":
|
||||
lru_items = BicepModuleCatalog.param_array_item_completion_items(
|
||||
context["module"],
|
||||
context["version"],
|
||||
context["param"],
|
||||
context.get("has_open_quote", False),
|
||||
)
|
||||
else:
|
||||
# Default: module name completions
|
||||
lru_items = BicepModuleCatalog.as_completion_items()
|
||||
|
||||
if ctx_type in ("version", "param", "param_value"):
|
||||
if ctx_type in ("version", "param", "param_value", "param_array_item"):
|
||||
# Always replace LS completions for private-registry contexts — the
|
||||
# Bicep LS doesn't know about our ACR, so anything it returns is noise.
|
||||
# Even if lru_items is empty (no enum values for a param), suppress LS.
|
||||
|
||||
Reference in New Issue
Block a user