Version: 1.5.2 (Marketplace, also v1.5.2 tag) · VS Code on Windows · luix.frameworks default · Vide via create "X" { … }
What happens
Every event passed the Vide way (a plain table key) on a host class is flagged by the unknown-prop diagnostic:
local create = require(game.ReplicatedStorage.Packages.vide).create
create "TextButton" {
Text = "Buy",
Activated = function() end, -- Unknown property `Activated` on `TextButton`. luix(luix.unknown-prop)
MouseEnter = function() end, -- same
MouseLeave = function() end, -- same
MouseButton1Down = function() end, -- same
MouseButton1Up = function() end, -- same
}
This is Vide's documented event syntax and the code runs fine. The README says Vide events are supported as plain keys ("Vide — events are plain table keys; Luix already merges the class's events into the prop suggestion list for you"), and completion does offer them — but the diagnostic contradicts the completion.
Where it comes from
src/diagnostics.ts (v1.5.2), unknown-prop block:
// ---- Unknown / wrong-enum (Roblox host class only) ----
if (call.isStringLiteralName && defaultPropsMap[call.className]) {
const known = new Set(flattenClassProps(call.className)); // line 551 — properties only
for (const entry of entries) {
if (known.has(entry.key)) { … continue; }
if (isFrameworkSpecialKey(entry.key)) continue; // only Children / key / ref
if (isDeprecatedValidProp(call.className, entry.key)) continue;
… push UnknownProp
known is seeded from flattenClassProps only. flattenClassEvents is never imported into diagnostics.ts (it's only used by completion.ts and elementSnippets.ts), so GuiButton.events / GuiObject.events in data.ts — which do list Activated, MouseButton1Down, MouseEnter, … — never reach the check. The escape hatch isFrameworkSpecialKey only knows Children/key/ref.
The completion provider handles this correctly: completion.ts ~L229–247 resolves the framework via findFrameworkForAlias(detected.alias) and, when framework.eventsAsProps is true (Vide, and direct instance calls attributed to Vide), merges flattenClassEvents(baseClass) into the prop list. The diagnostic has no equivalent gate.
Suggested fix
Mirror the completion provider's gate in the diagnostic:
const known = new Set(flattenClassProps(call.className));
const framework = call.alias && findFrameworkForAlias(call.alias);
if (framework?.eventsAsProps) {
for (const e of flattenClassEvents(call.className)) known.add(e);
}
(React/Roact/Fusion are unaffected since their events are computed keys — [React.Event.X], [OnEvent "X"] — which the entry scanner already leaves out.)
Workaround
"luix.propValidation.enabled": false — the luix.props override doesn't help since it's only read by completions, and there's no inline ignore directive.
Version: 1.5.2 (Marketplace, also
v1.5.2tag) · VS Code on Windows ·luix.frameworksdefault · Vide viacreate "X" { … }What happens
Every event passed the Vide way (a plain table key) on a host class is flagged by the unknown-prop diagnostic:
This is Vide's documented event syntax and the code runs fine. The README says Vide events are supported as plain keys ("Vide — events are plain table keys; Luix already merges the class's events into the prop suggestion list for you"), and completion does offer them — but the diagnostic contradicts the completion.
Where it comes from
src/diagnostics.ts(v1.5.2), unknown-prop block:knownis seeded fromflattenClassPropsonly.flattenClassEventsis never imported intodiagnostics.ts(it's only used bycompletion.tsandelementSnippets.ts), soGuiButton.events/GuiObject.eventsindata.ts— which do listActivated,MouseButton1Down,MouseEnter, … — never reach the check. The escape hatchisFrameworkSpecialKeyonly knowsChildren/key/ref.The completion provider handles this correctly:
completion.ts~L229–247 resolves the framework viafindFrameworkForAlias(detected.alias)and, whenframework.eventsAsPropsis true (Vide, and direct instance calls attributed to Vide), mergesflattenClassEvents(baseClass)into the prop list. The diagnostic has no equivalent gate.Suggested fix
Mirror the completion provider's gate in the diagnostic:
(React/Roact/Fusion are unaffected since their events are computed keys —
[React.Event.X],[OnEvent "X"]— which the entry scanner already leaves out.)Workaround
"luix.propValidation.enabled": false— theluix.propsoverride doesn't help since it's only read by completions, and there's no inline ignore directive.