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 methods from custom script for override #393

Closed
KoBeWi opened this issue Jan 19, 2020 · 5 comments
Closed

Autocomplete methods from custom script for override #393

KoBeWi opened this issue Jan 19, 2020 · 5 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Jan 19, 2020

Describe the project you are working on:
A game with lots of script inheritance going.

Describe the problem or limitation you are having in your project:
When you write func, you get a nice autocompletion list for virtual methods ready to be overriden. However these are only built-in methods. When inheriting a custom script, there's no list at all and there's no way to make the custom methods appear in the override list.

I have e.g. an Enemy class with lots of callbacks. Not only I have to remember them all, I have to write them perfectly, otherwise the override will have no effect. The meh workaround is copy-pasting them from my Enemy script.

Describe how this feature / enhancement will help you overcome this problem or limitation:
It would be immensely useful for productivity if we could have autocomplete for custom "virtual" methods, from inherited user script. It could suggest all methods or methods starting with _, any way would be useful.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
image

Describe implementation detail for your proposal (in code), if possible:
Just fill the func name autocompletion list with methods from inherited custom classes, not only built-in ones.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
You can't write Script Editor plugins.

Is there a reason why this should be core and not an add-on in the asset library?:
You can't write Script Editor plugins. And even if you could, it's a rather obvious usability thing to have.

@hamoom
Copy link

hamoom commented Jan 26, 2020

I agree. I don't know why I dont get autocomplete from inherited scripts.

@Jummit
Copy link

Jummit commented Jan 26, 2020

Isn't this more of a bug report?

@KoBeWi
Copy link
Member Author

KoBeWi commented Jan 26, 2020

No, this is just not implemented. Probably because there's no way to mark a method in GDScript as "virtual" (while it is possible with core methods). Either "virtual" methods should be implemented or we could just use the underscore convention.

@KoBeWi
Copy link
Member Author

KoBeWi commented Mar 29, 2022

Now that GDScript has annotations, we could have an explicit @virtual annotation that makes a method show in autocompletion.

@KoBeWi
Copy link
Member Author

KoBeWi commented Dec 4, 2022

Closing in favor of #5896

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2022
@KoBeWi KoBeWi added the archived label Dec 4, 2022
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