godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.08k stars 69 forks source link

Smart code assistant #9731

Open JekSun97 opened 2 months ago

JekSun97 commented 2 months ago

Describe the project you are working on

Doesn't matter)

Describe the problem or limitation you are having in your project

It often happens to me that I rewrite a function for example "var gen = ClassGen.generated_text("bla bla")", but the ClassGen class has three more similar functions for example generated_text_simple and generated_image, I start erasing all the text, leaving parentheses and argument, then I add a dot so that a hint appears, I select the function and get additional empty parentheses “var gen = ClassGen.generated_text_simple()(“bla bla”)”, which is very annoying.

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

I propose to do this - so that when we select a function from the tooltips, the code editor reads all the characters on the right, before the tab, and if a parenthesis is not found there, it would add two parentheses, otherwise, if a parenthesis is found, it would not add two brackets.

It would also be convenient to see hints not only when we add a period at the end, but also when we erase the text or write a new one, but this is a different sentence.

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

read the characters on the right after selecting a function

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

No

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

No

Calinou commented 2 months ago

When you accept an autocompletion result, whether you press Tab or Enter will lead to different outcomes as described in https://github.com/godotengine/godot-proposals/issues/9528. Can you try both in your particular scenario?

kitbdev commented 2 months ago

Looks like a duplicate of:

Also if you want to see autocomplete suggestions at any time, you can use the shortcut ui_text_completion_query (Ctrl+Space).