script-ide icon indicating copy to clipboard operation
script-ide copied to clipboard

Added virtual methods track

Open CodeNameTwister opened this issue 11 months ago • 2 comments

Added virtual functions track

Features:

  • Virtual functions are visible now (functions name in parent script begin with underscore)
  • Can create virtual function if not exist in the current script (Save for refresh and sync the script-ide panel)

Example:

image

In the parent example: image

Example of virtual functions

# parent_script.gd with virtual functions

func _my_function2override_by_child(args : Variant) -> void: pass
func _my_another_func() -> String: return ""

...

CodeNameTwister avatar Mar 07 '25 14:03 CodeNameTwister

Thanks for the PR. The idea is interesting but pretty much out of scope for this kind of plugin. What I mean by that is:

  • We do not do any parsing ourself. We simply just retrieve all variables/methods from the opened GDScript via the methods Godot provides
  • We also do not do any code generation, so writing to a GDScript instance
  • Checking other applications, the Outline typically shows only what is inside the corresponding file, not what may can be used from superclasses or interfaces. We follow that principle.

All that is done by design, to keep this plugin small, fast performance wise and without anything you may would not expect from an IDE. I follow leading IDEs like IntelliJ and VSCode and their functionality.

An interesting idea however is the ability to override method from the superclass, that are not already overridden. Very similar to IntelliJ, where you can press: ALT+INSERT to open a dialog where you can choose to override methods from the superclass. This might be an interesting idea and proposal for this plugin and does not clutter the Outline. image

Maran23 avatar Mar 26 '25 14:03 Maran23

Okey that's a good idea too. I'll work from the current master branch to incorporate that functionality into a popup.

CodeNameTwister avatar Mar 28 '25 18:03 CodeNameTwister

Closing, as https://github.com/Maran23/script-ide/pull/101 is merged now!

Maran23 avatar May 02 '25 19:05 Maran23