Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete Input.get_axis StringName parameter suddenly switches from action name to symbols while typing #89785

Open
hsandt opened this issue Mar 22, 2024 · 1 comment

Comments

@hsandt
Copy link
Contributor

hsandt commented Mar 22, 2024

Tested versions

  • Reproducible in v4.2.1.stable.official [b09f793]

System information

Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - GLES3 (Compatibility) - Mesa Intel(R) HD Graphics 4600 (HSW GT2) () - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

Issue description

When filling the StringName parameters for Input.get_axis(...), after typing the bracket ( or forcing autocomplete with Ctrl+space, the list of action names will appear as expected for negative_action: StringName.

image

However, if you type the action name start like "mo" for "move_left", it will quickly switch to symbols starting with "mo" instead.

In order to enforce action name listing, you need to type an opening single/double quote ' " first.

image

This is OK to distinguish strings from symbols, however my issue is that the autocomplete popup switches from strings to symbols while user is in the middle of typing.

Godot 4 2 1 - Autocomplete Input get_axis string changes to var

This is disturbing as it feels like you can select the action name, if you're fast enough you can even start pressing up/down to navigate the results and suddenly the popup refreshes and sends you back to the top, with unrelated results. It should either:
a. show all matching results, both strings and symbols, to let user decide
b. or, from the moment the user types a non-quote letter, it switches to symbols. I assume it takes some loading time which explains the delay, but then we could just close the popup temporarily until we actually get the new results with symbols

I would go with a. personally as I often type names without quotes, but I'm also okay with b. which has the advantage of not showing strings if user really wants a variable, and user can always type a quote to show explicitly they want an action name.

Steps to reproduce

  1. Make sure to add some actions to Project Settings, such as "move_left"
  2. Create a script (I use extends CharacterBody2D to get some members starting in mo ready like motion_mode. Then Enter code in script:
func _physics_process(delta: float):
	var move_x_intention := Input.get_axis(
  1. After typing opening bracket, watch autocomplete popup open (if you missed it, retrigger with Ctrl+space)
  2. Start typing the name of an action, e.g. "mo"
  3. Notice how the action name list is replaced with symbols like "motion_mode"

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Mar 22, 2024

I'd say this is appropriate, it can suggest a variable too, and it isn't checking for type compatibility, if you type without quotes you'd want without quotes, otherwise it'd be annoying when you actually want a variable or constant

If you had:

func move_helper(move_left, move_right, move_up, move_down) -> Vector2:
    return Input.get_vector(move_

Wouldn't it be worse if it suggests "move_left"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants