Skip to content

fix: don't flag Vide event handlers as unknown props - #5

Open
WaleedAmer wants to merge 1 commit into
ericplane:mainfrom
WaleedAmer:fix/vide-events-unknown-prop
Open

fix: don't flag Vide event handlers as unknown props#5
WaleedAmer wants to merge 1 commit into
ericplane:mainfrom
WaleedAmer:fix/vide-events-unknown-prop

Conversation

@WaleedAmer

Copy link
Copy Markdown

Closes #4.

Vide passes events as plain table keys (Activated = function() … end, MouseButton1Down = …). completion.ts already merges flattenClassEvents into the prop list when the alias's framework has eventsAsProps, but the unknown-prop diagnostic in diagnostics.ts seeded its known set from flattenClassProps alone, so every Vide event handler on a host class was warned about as Unknown property.

This mirrors the completion gate in the diagnostic: when findFrameworkForAlias(call.alias)?.eventsAsProps is true, union the class's events into known. React/Roact/Fusion spell events as computed keys, which the entry scanner never yields, so they're unaffected. Direct instance calls (TextButton({ … })) never reach this block since isStringLiteralName is false for them.

Verified with npm run compile + npm run lint (no new warnings on the touched lines) and by installing the packaged .vsix over a Vide project — Activated / MouseEnter / MouseLeave / MouseButton1Down / MouseButton1Up on a create "TextButton" { … } no longer warn, while a genuine typo still gets the did-you-mean.

🤖 Generated with Claude Code

Vide passes events as plain table keys (`Activated = function() … end`,
`MouseButton1Down = …`). The completion provider already merges
`flattenClassEvents` into the prop list for frameworks with
`eventsAsProps`, but the unknown-prop diagnostic seeded its known set
from `flattenClassProps` alone, so every event handler on a host class
was warned about as `Unknown property`.

Mirror the completion gate in the diagnostic: when the matched alias
belongs to an `eventsAsProps` framework, union the class's events into
the known set. React/Roact/Fusion spell events as computed keys, which
the entry scanner never yields, so they are unaffected.

Closes ericplane#4
@ericplane ericplane self-assigned this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vide events (Activated, MouseButton1Down, …) flagged as luix.unknown-prop — diagnostic never consults flattenClassEvents

2 participants