Closed emuell closed 4 months ago
Looks fine apart from the typo of the method being called notifer_method
.
On a related note, I think write-only fields like pressed
should be marked private
(or protected
) as they are not even write-only in the sense that you can't even write to them (only in the construction table which should be its own class anyway).
So for example after creating a button, you can't do
b = vb:button { text = "x" }
b.pressed = function() end
but the language server will happily auto-complete a function for b.pressed
right now, which will crash at runtime later.
If they were notated as
---@field private pressed ...
the editor wouldn't offer the completion and it would warn you with "pressed is private and can't be accessed..." if you were trying to assign a function to it.
Looks fine apart from the typo of the method being called
notifer_method
.
Just have fixed that, renamed it to 'notifier'. Is this what you meant?
On a related note, I think write-only fields like pressed should be marked private (or protected)
I meant typo for the missing i
, it's notifer
now instead of notifier
.
I meant typo for the missing
i
, it'snotifer
now instead ofnotifier
.
Haven't even seen that. Thanks. This is now fixed :)
@unlessgames does this look sane to you?
The {notifier, context} overloads bloat things a bit, but that's how they are implemented everywhere...