C#: Is there no built in cache for input action names?

Godot Version

4.2.1

Question

For many things where Godot requires strings, there are caches that can be used instead of typing strings by hand. Like SignalName or MethodName. But I haven’t found one for action names. Is it true that there is none?

no IntelliSense in Godot Editor for C#,
If you want something lightweight you can use Visual Studio Code with C# plugins.

Check out InputMap.GetActions()

It won’t provide intellisense, but it can be used to get an action name list.

gdscript:

func _ready():
	var _res = InputMap.get_actions();
	for _act in _res:
		print (".gd: Action: '", _act, "'");

c#:

    public override void _Ready() {
        var _allActions = Godot.InputMap.GetActions();
        foreach (var _act in _allActions) {
            GD.Print(".cs: Action: '", _act, "'"); } }
2 Likes

I am using Visual Studio Code with several Godot extensions. Is there one that provides cached input actions from Godot’s input map?