Closed farfalk closed 10 months ago
As an easy workaround, it's possible to add:
if (('func @' in type_with_text) and ('_setter(' in type_with_text)):
# This is a setter of a variable. Trim!
type_with_text = "var " + type_with_text.trim_prefix('func @').trim_suffix('_setter(')
here: https://github.com/Maran23/script-ide/blob/aba268f58cc397e59bd3762332a5e45384c9b5bc/addons/script-ide/plugin.gd#L387 like this:
[...]
var type_with_text: String = type + " " + text
if (type == "func"):
type_with_text = type_with_text + "("
if (('func @' in type_with_text) and ('_setter(' in type_with_text)):
# This is a setter of a variable. Trim!
type_with_text = "var " + type_with_text.trim_prefix('func @').trim_suffix('_setter(')
var source_code: String = script.get_source_code()
[...]
Interesting, I did not tested it with inline getter or setters yet.
I'm always using e.g. set = set_speed, get = get_speed
.
I will check this out soon, thanks for the report!
Hi, thank you for your work!
The issue happens with all setters associated with exported properties. I will give an easy to replicate example.
The code:
The setter is shown as
@max_height_setter
with a green tag in the lateral panel.The error, when clicking on
@max_height_setter
:My system: Windows 10 latest update, Godot 4.2.1 stable