Commit Graph

8 Commits

Author SHA1 Message Date
Henrik Jess Nielsen
0025043999 backup: uncommitted changes from MAC-M9FQ0900T3 2026-05-17 15:52:31 2026-05-17 15:52:31 +02:00
Henrik Jess Nielsen
445ccb5769 fix(bicep): detect param context when module ref has empty version
All checks were successful
Build and Deploy iLSP / test (push) Successful in 21s
Build and Deploy iLSP / build-and-deploy (push) Successful in 1m24s
The lookback regex used ([^']+) requiring one or more version chars,
so 'br/modules:modules/keyvault:' (no version yet) silently fell through
to the unknown context and injected all module names instead of params.

Change + to * to allow empty version string. The param_completion_items
fallback already handles empty version by picking the closest schema.
2026-05-11 11:20:54 +02:00
Henrik Jess Nielsen
e7471e5dfd fix(bicep): replace LS completions entirely for version/param/param_value contexts
All checks were successful
Build and Deploy iLSP / test (push) Successful in 22s
Build and Deploy iLSP / build-and-deploy (push) Successful in 1m24s
For specific LRU contexts (version, param, param_value), the Bicep LS was
appending its own random/irrelevant completions alongside the LRU catalog
items. The LS has no knowledge of the private ACR registry, so its suggestions
in these positions are noise.

Now the LS items are discarded entirely for these three contexts. LS items
are still kept (below LRU items) for module_path and unknown contexts.
2026-05-11 11:08:47 +02:00
Henrik Jess Nielsen
ef3535048b fix: Bicep module ref path — strip bicep/ prefix, lookup by ref_path
All checks were successful
Build and Deploy iLSP / build-and-deploy (push) Successful in 1m29s
Build and Deploy iLSP / test (push) Successful in 24s
Two bugs fixed in BicepModuleCatalog:

1. as_completion_items() generated 'br/modules:bicep/modules/appservice:...'
   but bicepconfig modulePath='bicep' means Bicep prepends 'bicep/' automatically.
   Fix: store ref_path = path.removeprefix('bicep/') and use it in insertText.
   Correct output: 'br/modules:modules/appservice:2.3.x'

2. version/param lookups used get_module_by_name() which only matches the last
   path segment ('appservice'). New-style refs capture 'modules/appservice' from
   the regex, so lookup returned empty. Fix: add get_module_by_ref() that matches
   both ref_path and bare name.

Also fixes _iac_param_map to strip path prefix so IAC source descriptions
still enrich completions for 'modules/appservice' refs.

All 63 tests pass.
2026-05-10 16:10:36 +02:00
Henrik Jess Nielsen
b93aa84737 feat: param_value context — enum/allowed completions for principalType, environmentType etc.
All checks were successful
Build and Deploy iLSP / test (push) Successful in 20s
Build and Deploy iLSP / build-and-deploy (push) Successful in 1m20s
- Add _KNOWN_ENUMS dict (principalType, principalObjectType, environmentType fallbacks)
- Add param_value_completion_items() to BicepModuleCatalog
- Detect 'param_value' context in _detect_context() (cursor after 'param: ' inside params block)
- Wire param_value into _inject_completions()
- 9 new unit tests (context detection, catalog allowed, known enum fallback, injection)
- Fix modules.py edit regression (param_completion_items was orphaned)
- All 35 tests pass
2026-05-10 15:30:31 +02:00
Henrik Jess Nielsen
27947e4f7f feat: context-aware Bicep completions (version + param injection)
Some checks failed
Build and Deploy iLSP / test (push) Failing after 27s
Build and Deploy iLSP / build-and-deploy (push) Has been skipped
- ProxySession tracks open documents per TCP connection
- _detect_context() identifies version, param, and module_path contexts
- version context: autocomplete versions for 'br/modules:NAME:' cursor positions
- param context: autocomplete params for specific module+version (with version fallback)
- modules.py: added get_module_by_name(), version_completion_items(), param_completion_items()
- 28/28 tests passing
2026-05-10 15:04:11 +02:00
Henrik Jess Nielsen
44da791f5a fix: update tests to match thread-based proxy API (_frame, _inject_completions)
All checks were successful
Build and Deploy iLSP / build-and-deploy (push) Successful in 2m6s
Build and Deploy iLSP / test (push) Successful in 19s
BicepProxy class and _ContentLengthFramer no longer exist after rewrite.
Tests now call module-level functions directly.
2026-05-10 13:35:40 +02:00
Henrik Jess Nielsen
cd17e9bfaa Add unit tests, smoke test script, fix CI to debian-host + test job
Some checks failed
Build and Deploy iLSP / test (push) Successful in 19s
Build and Deploy iLSP / build-and-deploy (push) Failing after 29s
- tests/test_catalog.py: 5 unit tests for PypiCatalog (fetch, cache, sort prefix, completions)
- tests/test_proxy.py: 5 unit tests for BicepProxy (framing, injection, list result, passthrough)
- tests/conftest.py: pytest asyncio_mode=auto config
- scripts/smoke_test.sh: end-to-end TCP + health smoke test script
- .gitea/workflows/ci.yml: split into test + build-and-deploy jobs (test blocks deploy)
  - runs-on: debian-host (was ubuntu-latest = broken)
  - test job installs deps + runs pytest before building image
- pyproject.toml: [project.optional-dependencies] dev = pytest + pytest-asyncio
2026-05-10 12:38:41 +02:00