Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMEdit

A high-end code editor for all things GameMaker · By YellowAfterlife

JSDoc-param types in status bar

A topic by Carlcadium created Apr 13, 2023 Views: 248 Replies: 7
Viewing posts 1 to 5

Hi!

Is there any way to have the JSDoc-param types show up in the status bar? It seems to be able to type check it correctly.
I have 'Show argument types in status bar' checked in preferences.

Writing _fisk:int works well, but it would be nice to be able to have it more consistent with the gamemaker IDE.



Developer(+1)

Added this for the next release - it’ll now show fisk(_fisk:int) with ‘Show argument types in status bar’ enabled.

Terrific!


I hope you don't mind me asking another question:

In o_player2's create event, I have a struct called CAnimator. I've also added '/// @interface {o_player2}' at the beginning of this event.
In a separate script, there's a struct named AGreatStruct that implements this interface. This struct also contains a variable named 'parent', which is a reference to o_player2.
All methods and constructor within this struct successfully auto-complete CAnimator.properties.
Using 'with(o_player2) { //code }' properly changes the scope to o_player2 without requiring the interface implementation.
However, using 'with(parent) { }' disrupts the scope of the implemented interface, and I'm unable to make 'with()' recognize that the parent is an o_player2 instance.
I've attempted to use 'var theParent : o_player2 = o_player2' and pass it to 'with()', but it made no difference.

Is there a workaround for this issue or a way to modify the behavior of 'with()' in this context?


Note: I've tried some different iterations of this struct, _parent was previous set to parent and run in a method that was in the struct etc, but no difference.



Developer(+1)

Fixed that for the next release as well (well, mostly).

If you have enabled “warn about missing fields”, you’ll get warning about typos when saving, but auto-completion is a bunch dumber since it has to quickly find what you are trying to access - it’s generally not cheap to back-track through the whole file whenever the user presses .

Ah that makes sense, but that update sounds very nice.

One last thing, not sure if it’s just me but it seems like struct auto completion is broken in the current version (compiled 12 mars 2023). At least I think it worked in earlier versions?


Developer (1 edit) (+1)

Auto-completion for structs works if

  • It’s a local variable, which is handled by the (smarter, slower) linter instead of project-wide indexer

  • It’s a new ConstructorName, inside of which you’ve set your variables

  • You’ve specified the type yourself via

    /// @hint {int} ImportantStruct:x
    /// @hint {int} ImportantStruct:y
    t = { /// @is {ImportantStruct}
        x: 1,
        y: 2
    }
    

Thank you! Using @hint and @is works great.
The struct does however not seem to autocomplete if it’s local: (not a big problem though as the other method works.)

Developer(+1)

You’ll generally have to save for new variable layout to be picked up