You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(lsp): widget property typos surface as real-time diagnostics
Wires widget property validation into the LSP's on-keystroke diagnostic
publisher so unknown property keys on pluggable widgets appear as
squiggles while the author types — not only when they save and trigger
`mxcli check`.
Implementation:
- `ValidateWidgetPropertiesForStatement(stmt, registry)` exposed as a
per-statement entry so the LSP can attach per-statement line numbers
(instead of dumping all violations at line 0).
- `LoadWidgetRegistry(projectPath)` extracted so callers can manage
registry lifetime — the LSP loads once via `ensureWidgetRegistry()`
rather than rebuilding it per keystroke.
- `runSemanticValidation` promoted to a method on `*mdlServer` so it
can reuse `s.widgetRegistry`. Nil-safe — widget checks are skipped
when the registry hasn't loaded (e.g. no project context).
- Consolidated the two duplicate `widgetCompletionsOnce.Do` blocks in
lsp_completion.go into a single `ensureWidgetRegistry()` helper.
Fixes a latent bug where `s.widgetRegistry` was nil if the first
Once caller was the completion path (only the second block set it).
Tests:
- `TestWidgetPropertyDiagnostics` covers create-page, alter-page-insert,
and the happy path (no false positives on valid properties).
Verified end-to-end against test5-app: `combobox cb1
(optionsSourcType: 'enumeration')` produces
`MDL-WIDGET01: widget cb1 (combobox) has no property optionsSourcType —
did you mean optionsSourceType?` through the same code path the LSP
now fires inline.
Issue: #540
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments