ShadowApex / godot-go

Go language bindings for the Godot Engine's GDNative API.
MIT License
363 stars 31 forks source link

Individual Class Files #23

Closed pastaq closed 6 years ago

pastaq commented 6 years ago

Having a single file to contain all built in classes provides extra difficulty. Namely:

  1. Text editor error checking is heavily bogged down as it needs to parse the entire classes.go file rather than the specific class or parent that is being referenced. I sometimes must wait up to 1 minute to see if a line I corrected removed a compile error.
  2. Navigating a single 120k line file is fairly obnoxious, regardless of the editor or keyboard shortcuts. This is especially true when editing/adding single lines in functions to elucidate issues during troubleshooting. If a fix is found, remembering everything that was modified to add to the template sometimes becomes difficult. For context, the entire pull request for the AMD DC into DRM-next, an effort that had been underway more than a year, was the same size.
  3. Related to the above issue, I acknowledge that these classes should be generated with generate.go and not directly modified. However; regenerating all classes for each test when troubleshooting the cause is quite absurd. It is much simpler to troubleshoot the errant class, then modify the template and regenerate once a working solution is discovered.

To solve these problems, I propose that classes.go be replaced with a directory structure such as ../godot/classes/className.go.

ShadowApex commented 6 years ago

I've been trying to implement this in a separate branch, but it might be harder than expected to implement elegantly. Right now we may or may not split these into their own package.