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
{{ message }}
Repository navigation
IDE: complete and validate Component.State keys in :c-* bindings #99
VS Code Citry 0.1.2 with citry-lsp 0.1.3 understands an existing valid :c-* State binding once it is written, but the attribute-name authoring path is incomplete.
Given a component with public State fields such as:
classState:
query: strtime: int
typing :c- does not offer the known State-backed attribute names. An invalid binding key also receives no diagnostic:
<input:c-querylol.debounce="refresh">
Here querylol is invalid when the owning component exposes only query and time.
Proposed solution
Extend the existing :c-* IDE contract in every template context where State binding resolution is available:
When completion is requested while writing the attribute name at or after :c-, offer the owning component's available public State fields, producing entries such as :c-query and :c-time.
Diagnose an unknown :c-* State field as an error by default when the owning State namespace is known. For :c-querylol.debounce, underline the querylol field-name segment rather than the prefix or modifiers.
Preserve the existing channel-specific modifier completion/hover and server-handler completion, hover, and navigation on the attribute value.
Keep completion and diagnostics ownership-aware for inline, standalone, and nested templates. Do not invent a closed namespace when the owning component or its State schema cannot be determined.
Acceptance examples
With State fields query and time:
:c- completion includes :c-query and :c-time.
:c-query.debounce.300ms="refresh" remains valid; query retains hover and navigation to Component.State.query, and refresh retains handler intelligence.
:c-querylol.debounce="refresh" produces an unknown-State-field error on querylol.
A modifier typo remains separate from a State-field typo and uses the existing modifier diagnostic contract.
This can ship with the next normal VS Code / citry-lsp release; it does not require an emergency republish of the current versions.
Activity