Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System for GDScript warnings #18271

Closed
vnen opened this issue Apr 18, 2018 · 2 comments
Closed

System for GDScript warnings #18271

vnen opened this issue Apr 18, 2018 · 2 comments

Comments

@vnen
Copy link
Member

vnen commented Apr 18, 2018

The GDScript editor shows errors very clearly, but there's no system in place to show warnings. I believe it would be very beneficial and help find some bugs in user code. For instance, some examples of what could be caught:

With a static typing system is also possible to catch other problems:

  • Integer division (such as 3 / 7, which becomes zero).
  • Narrowing conversion (passing a float to a function that uses int).
  • Discarding the return value of a function call.

And probably other stuff I can't think of right now.

It should show warnings in editor, when possible, and runtime warnings as well. Turning them of on a case might be needed too (sometimes you do want to make an integer division).

@chanon
Copy link
Contributor

chanon commented Jun 4, 2018

I think Godot might need a separate errors/warnings bottom panel to support easy viewing and double clicking on each of them similar to Visual Studio C++ 'Error List'. It would be kind of like a todo list.

@vnen
Copy link
Member Author

vnen commented Jun 22, 2018

I'm not sure about how to do the interface. Bottom panel sounds fine at first, but it should be easily relatable to the current open script. Warnings will only be caught when parsing so that means it's only meaningful for the edited script, since that's the one still being parsed (also, it should be easy to see the warnings in the current script). It also could show in the console when running the game.

Major problem with bottom panel is that it's hard to add from the script editor plugin. It should remain self-contained. A hidable panel in the editor itself is probably better.

Any suggestions on the interface are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants