godotjs / javascript

Javascript binding for godotengine
https://godotjs.github.io/
MIT License
980 stars 82 forks source link

Fixed declaration file errors #135

Closed poohcom1 closed 2 years ago

poohcom1 commented 2 years ago

Currently, the godot.d.ts declaration file generated by the editor have syntax errors. These are:

  1. The term push_*/pop in the documentation terminating multi-line comments due to the */ token. This is fixed by replacing all */ with * /.

  2. KeyModifierMask.KEY_MASK_CMD not having a value due to the doc having "platform-dependent" as a value instead of an integer. This is fixed by adding a manual check for this specific enum to replace the value with the correct one.

I'm happy to discuss alternative solutions or any other comments you might have. I also think having unit tests to detect these errors might be helpful, as future changes to the documentations could result in new errors.

Geequlim commented 2 years ago

Thanks for your contribution. It would be better if you use enum values ​​or constants instead of hardcoding value.

poohcom1 commented 2 years ago

Thanks for the comment! Somehow it didn't occur to me to just use the actual enum values; I've fixed it with the latest commit.

Please tell me if there are any other things you need me to change.

Geequlim commented 2 years ago

Thanks