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

Don't Add Default () When Tab Completing Method Name as Callable Parameter #10185

Closed
iiMidknightii opened this issue Jul 12, 2024 · 2 comments
Closed

Comments

@iiMidknightii
Copy link

Describe the project you are working on

Any project that uses GDScript.

Describe the problem or limitation you are having in your project

When I type method names into any built in function expecting a Callable, such as Signal's connect, disconnect, is_connected, etc. the text editor adds parentheses by default. In pretty much every case, I don't actually want the parentheses there. This also causes a problem where backspacing twice will delete one of the surrounding method parentheses, e.g. connect's, thereby adding more keystrokes and annoyance.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I propose a mechanism in GDScript and the text editor where it will intelligently defer creating parentheses whenever a method name is tab completed inside a method call expecting a Callable argument. If the user then types a method of Callable, such as bind, then the parentheses can be tab completed just fine. In addition, if possible, you could even extend this behavior to assigning variables that have been typed as Callable, meaning assigning the variable would also not auto-complete the parentheses.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Pretty simple in concept, not sure about the execution: just don't add () at the end of a tab completed method name when that method is being placed into a variable/method parameter that is expected to be of type Callable.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I don't know of any way this behavior could be added to the text editor or GDScript itself.

Is there a reason why this should be core and not an add-on in the asset library?

I think this is a built-in part of how the text editor and GDScript interact with each other.

@iiMidknightii
Copy link
Author

Also, I don't think I've ever had to type the word parentheses so many times in one place.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 13, 2024

Duplicate of #6728
If the other proposal is missing any details please leave a comment there.

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
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

3 participants