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

Display type icons for properties/methods in the script editor's autocompletion box #3291

Open
ImInLoveWithProgramming opened this issue Sep 12, 2021 · 4 comments

Comments

@ImInLoveWithProgramming

Describe the project you are working on

I'm working on a game inspired of Kirby Returns To Dreamlands, it's a 2.5D platformer game with a very fantasy style and with enemies (in multiple levels) and bosses and to defends yourself you will have to use super-powers like (laser , explosive , lava...) .I'm planning on publishing it on Nintendo Switch with the publisher gotm.io

Describe the problem or limitation you are having in your project

The auto-completion can be very confusing because i don't know the kind of variable type it is requesting me to use.

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

I think Godot engine could implements little icon next to the variable name to show the type. It would be useful to see which type it is to be more efficient and to prevent from getting errors.

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

The way it will work is having a little icon , instead of having the .P icon , we could have a icon little .Bool or .Float
I think there is something like that in Godot's Visual Scripting solution and that's could be cool to have this on the code edtior.
image

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

I don't think it can. I didn't tried tho.

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

Because this is a very important features. A lot , if not all of them show which type of variable it is to make the user more efficent and to prevent his code from having impossible convertions.

@Calinou Calinou changed the title Having a icon / a way to know which type of variable the auto-completion is showing. Display type icons for properties/methods in the script editor's autocompletion box Sep 12, 2021
@Calinou
Copy link
Member

Calinou commented Sep 12, 2021

For reference, this is how Visual Studio Code displays type information in the autocompletion box (by also displaying the function signature on the right):

image

It also works for properties:

image

I would prefer this as it won't be limited to primitive (non-object) types.

@AaronRecord
Copy link

Somewhat related: #99

@ImInLoveWithProgramming
Copy link
Author

ImInLoveWithProgramming commented Sep 13, 2021

For reference, this is how Visual Studio Code displays type information in the autocompletion box (by also displaying the function signature on the right):

image

It also works for properties:

image

I would prefer this as it won't be limited to primitive (non-object) types.

Yes, but in the auto-completion's box , it shows you the type of variable it will use , Godot doesn't display that (ex: erand48 is a double and N is a List)

@EricEzaM
Copy link

Related: godotengine/godot#38449

This PR of mine was closed as the Text/Code editor were in a state of flux at the time. Now that the API has settled a bit, it might be a good time to revisit.

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

4 participants