Super Checker - Plugint to push warning if there is no super in inherited funcs

Thumbnail

Super Checker

Godot 4 plugin. Pushes the warning if there is no super called in inherited functions.

You can download it from the Godot Asset Store or on GitLab.

About

I often forget to call super in overridden methods within my derived classes. Especiall overridden built-in virtual methods! Countless times, I have added a new method to a base class, only to find out (usually a day later), that one of derived classes already had it and was now overriding it. And unexpected behavior, that I was trying to trace for hours, was just that. Well not anymore!

This plugin pushes a warning with a clickable link to any overridden function that doesn’t contain super anywhere in it. Commented out #super and strings with "super" word don’t count, so you don’t have to worry!

Highlights screenshot

The plugin also changes the color of the “method override” icon (displayed in the gutter) for any overridden method. So you could easily distinguish virtual methods from overridden inherent ones.

It would be extremely useful for beginners and especially extremely for advanced users, who already have a ton of inheritance in their code! Though you might need to add an #@override tag/annotation here and there (to be honest, in quite a few places), but warnings will guide you through with a clickable links. And your new setup will totally pay off in a long term.

Also, the plugin has plenty of settings, so you can customize it for your liking:

Settings screenshot

Installation

Project Settings

  1. Download the plugin and move the addons folder to your project
  2. Enable the plugin in Project Settings > Plugins (it the tab bar)
  3. Close Project Settings and open them again
  4. Go to Project Settings > General > Mishamol > Super Checker to access the plugin settings

Export Settings

  1. Go to Project > Export...
  2. For every preset go to Resources > Filter to exclude files/folders from project
  3. Add this text: addons/mishamol_super_checker/* to that field

Things I tried, but failed to do

  1. Highlight #@override with custom color
    • Solution: add it (without #@ part) to Editor Settings > Text Editor > Theme > Notice Color
  2. Push the warning in this script (editor plugin), but make it look like it originated from another script (where super wasn’t used)
    • Solution: push the warning and then print rich clickable url

License

MIT License

(post deleted by author)

(post deleted by author)