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

Minor annoyances around $Node/Paths in scripts #77586

Closed
trollusk opened this issue May 28, 2023 · 5 comments · Fixed by #77722
Closed

Minor annoyances around $Node/Paths in scripts #77586

trollusk opened this issue May 28, 2023 · 5 comments · Fixed by #77722

Comments

@trollusk
Copy link

Godot version

4.0.2

System information

Windows 11

Issue description

Double clicking on $MyNode in the script editor will select the whole name including the "$".

But double clicking on %MyNode (unique name) will select the name but will not include the "%".

Dragging a node from the scene tree into the script editor brings up the property/method hint list, even though a "." has not been typed. Pressing enter appends "new()" even though this makes no sense as there is no period so it is just appending it directly to the node name: $MyNodenew()

Steps to reproduce

Type %MyNode in a script and double click on it.

Type @onready var x = in a script, drag a node from the scene tree, then press enter.

Minimal reproduction project

N/A

@KoBeWi
Copy link
Member

KoBeWi commented May 28, 2023

Double clicking on $MyNode in the script editor will select the whole name including the "$".
But double clicking on %MyNode (unique name) will select the name but will not include the "%".

Tracked in #56402

Type @onready var x = in a script, drag a node from the scene tree, then press enter.

You can drag node with Ctrl to add onready var.

Still, dropping something should cancel current autocompletion.

@PeanutButterRat
Copy link
Contributor

So is the intended behavior that $ should not be selected when double-clicking a node path in the editor? Has this been handled already by #46721 or does the default behavior still needed to be changed?

I would love to tackle this one but I'm not sure where to start.

@KoBeWi
Copy link
Member

KoBeWi commented May 31, 2023

IMO either double-clicking node path should not select $ or it should select % (i.e. it should be consistent). Note that this is discussed in #56402

As for where to start, it's probably somewhere in CodeEdit code or ScriptEditorPlugin.

@PeanutButterRat
Copy link
Contributor

PeanutButterRat commented Jun 1, 2023

I think I was able to fix the bug mentioned above with the autocompletion not canceling when dragging and dropping into the editor. Should that be pushed as a separate PR before tackling the '$' selection issue?

@KoBeWi
Copy link
Member

KoBeWi commented Jun 1, 2023

Yes.

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

Successfully merging a pull request may close this issue.

4 participants