YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Allow using @desc annotation for variables #5919

Open Alphish opened 5 months ago

Alphish commented 5 months ago

Is your feature request related to a problem?

In my libraries, I tend to make various structs with their own variables, and I'd like a way to provide a description for them which would appear for the user when hovered over the variable. Currently, the text doesn't appear on hover.

image

Describe the solution you'd like

Make it so that when @desc annotation is used on a struct or instance variable, the description will be shown when hovering the variable, in a similar way @desc works for custom function or for some built-in variables like fps_real.

To avoid a storm of conflicting definitions, it may be limited to the first JSDoc-ed occurrence of a variable in the constructor body and the first JSDoc-ed occurrence of the variable in the Create event. Whatever method of resolving conflicting definitions would be chosen, it should be consistent with other potentially conflicting annotations (like @type from FR #3018).

Describe alternatives you've considered

No response

Additional context

No response

tinkerer-red commented 2 weeks ago

I do like this, one alternative is using getter/setter functions and JSDocing those, however I see the bloat there getting out of hand. given that /// @ignore already works on variables it would make sense this could too.