You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So you'd highlight a function via highlighting it with your mouse and then hit something like F6 (or maybe right click its name, whatever) and then you'd be prompted in the terminal to input the values of all the arguments and it would show you what the function returned as well as outputted (etc.). Useful debugging feature.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
def coinToss (color, amount, speed):
CODE HERE
the terminal would be prompt me for all parameters (someone else can figure out if we should make the user define the variable type while inputting too)
Insert color:
Insert amount:
Insert speed:
and it would then show the outputs of all variables and what returned.
if the function is recursive it would display each recursuions values and if the function had args (undefined amount of parameters) the terminal would ask how many you want to put in
or maybe have it just display return output, or have it as an option for the user. general idea. maybe for handling of recursive functions or functions with an undefined amount of parameters, etc. we just show recursion graphs and have a certain string to stop inputting?
If this enhancement will not be used often, can it be worked around with a few lines of script?
no this is integral
Is there a reason why this should be core and not an add-on in the asset library?
it's a core debugging tool
The text was updated successfully, but these errors were encountered:
This question doesn't ask if the exact feature can be worked around, but if you can achieve something sufficient
For this the answer is very simple, yes, with an editor script calling the method
The main issue I see here is this: other than static methods this requires an instance to run on, your proposal doesn't mention this at all, how do you call a method that's on, for example, the Player.gd script? What instance is it called on?
If it's not a matter of such a method it's simple to do this with an editor script, if not the way to achieve it needs to be explained
There should be some addons out there that allow you to swiftly test pieces of code. I have definitely seen them, but I cannot provide them currently.
If you want to run a function from the Editor you could write a EditorScript, too. For your use-cases it would probably require some copy-pasting, but it is not easily avoidable.
It's important to note that GDScript is primarily based on classes, objects, instances... The result of a function can greatly vary depending on the instance calling it. The proposal you suggest may not be feasible because how would the Script Editor know what instance is supposed to call the method?
Describe the project you are working on
Irrelevent
Describe the problem or limitation you are having in your project
Slow debugging of functions that can be made more swift
Describe the feature / enhancement and how it helps to overcome the problem or limitation
zed-industries/zed#8344 (comment)
So you'd highlight a function via highlighting it with your mouse and then hit something like F6 (or maybe right click its name, whatever) and then you'd be prompted in the terminal to input the values of all the arguments and it would show you what the function returned as well as outputted (etc.). Useful debugging feature.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
def coinToss (color, amount, speed):
CODE HERE
the terminal would be prompt me for all parameters (someone else can figure out if we should make the user define the variable type while inputting too)
Insert color:
Insert amount:
Insert speed:
and it would then show the outputs of all variables and what returned.
if the function is recursive it would display each recursuions values and if the function had args (undefined amount of parameters) the terminal would ask how many you want to put in
or maybe have it just display return output, or have it as an option for the user. general idea. maybe for handling of recursive functions or functions with an undefined amount of parameters, etc. we just show recursion graphs and have a certain string to stop inputting?
If this enhancement will not be used often, can it be worked around with a few lines of script?
no this is integral
Is there a reason why this should be core and not an add-on in the asset library?
it's a core debugging tool
The text was updated successfully, but these errors were encountered: