GDScript Quality of Life

Download at asset store: GDScript Quality of Life - Godot Asset Library
Or at github: GitHub - Herbherth/GDScript-Quality-of-Life: Bring some quality of life features for gdscript inside godot code editor

GDScript Quality of Life (or GDSQoL) brings to you more quality of life and speed while programming in Godot.

For now, only Godot 4.2+!

Here is a list of features from this plugin:

  • Type var_name = value to var var_name: Type = value
  • var_number++ to var_number += 1 (also works with --)
  • var_number++ 2 to var_number += 2 (also works with -- and any float)
  • var_bool! to var_bool = !var_bool
  • class? to if class:
  • class?method() to if class: class.method()
  • method() cd to method.call_deferred()
  • my_var = value sd to set_deferred("my_var", value)
  • await 1 to await get_tree().create_timer(1).timeout (any float is valid)
  • Declare multiple variables in the same line
  • Auto correct indentation from pasted blocks to match the line above
  • Auto replace set keywords to any line set by you at Editor -> Editor Settings -> GDScript QoL -> Change To
  • Auto remove one indentation after return, break and continue
  • On delete line, auto remove remaining indentation from middle of the line
  • Auto add : at the end of if statements if they are not closed
  • Auto find if above to match indentation when write else or elif
  • Auto complete match with enum list if any
  • Auto complete methods if write func method_name
  • Optionally you can write the method return type and/or parameters, like func name(param) Type
  • Auto create method from selection when shortcut is pressed (default is Ctrl + M)
  • Update the line when Enter or the shortcut is pressed (default shortcut is Ctrl + U)

You may change or disable some of these settings at Editor -> Editor Settings -> GDScript QoL

For a full tutorial, please visit the github page.

If you like it, and wish to buy me a piece of cake (I don't drink coffee), it would be greatly appreciated, thank you!

Here's some examples:





8 Likes

This looks great. I am going to try it out.

1 Like

Hey, I have updated the code and solved an annoying bug pretty easy to happen, so if you have installed it, make sure to update.

I tried to edit the first post but as I am a new user it seems I have some limited features in what I can or can not do, 'cause of that I am posting a reply with the changelog.

I’m not the type that’s going to spam though, I am only posting again because it is really an important update ;D

Thank you!

Check the changelog for more info!

Hey, using the latest version I cannot get ChangeTo to work anymore.
I tried a number of different key/value pairs but the keys are just ignored and no changes made.
This was working in the previous version.

Oh, I don’t have time today to see it, but tomorrow I will give a look.
But that’s awkward, I myself am using this plugin in the latest version in Godot 4.3 and Change To is looking to work just fine.

One thing that happened to me before is to “add” a key and value, but forget to click the “add key” button or something like it

Can you tell me what version of Godot are you using? Also, what version of the plugin?
Can you provide a screenshot from the plugin settings where it shows the dictionary of Change To?
Also, can you show me one line of you trying to use the key that is not changing?

It will help me to narrow down where the problem might be, thank you :smiley:


implement
GODOT v4.3.stable.official [77dcf97d8]
Ubuntu 22.04.4 LTS
Quality Of Life 1.0.4

Is it possible for the Change To feature of creating new macros to be able to detect and reuse Strings as parameters?

For example
New key: emit testingthis
New Value: MainClass.testingthis.emit()
It takes the second argument as string parameter and then reuses it for the new value

Oh, that’s for sure strange. I am using the same version of godot and plugin as you (I am on a windows, but this shouldn’t matter), tried the same key/value pairs as you, but here everything is working as it should =/
Does the other features still work? If you type “int my_int” will it be updated?

Can you try to open another script from the list <<< and re-focus on that one and try again?

Also, have you installed any other plugin with new godot?

Oh, will note this idea for future updates, thank you :smiley:

int my_int works and produces var my_int: int
I have not tried any other plug in with this new version of GODOT.

Can you try to open another script

I switched to another script file and ‘change to’ worked normally.
I switched back to the original script file and I could not reproduce the problem I had originally.
Very strange.
I will test this on a new project and see if it happens again. Apart from that, I don’t think you need put much more effort into finding a solution as this problem might be hard to track down on your end.