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

There is no way to disable automatic code completion in the text editor #68139

Closed
quinnyo opened this issue Nov 1, 2022 · 4 comments · Fixed by #68140
Closed

There is no way to disable automatic code completion in the text editor #68139

quinnyo opened this issue Nov 1, 2022 · 4 comments · Fixed by #68140

Comments

@quinnyo
Copy link
Contributor

quinnyo commented Nov 1, 2022

Godot version

4.0.dev (e675154)

System information

Arch Linux 6.0.2-arch1-1

Issue description

I find the built-in code completion to be quite aggressive/invasive. It often makes editing scripts stressful, unpleasant and time-consuming. Some points about its behaviour:

  • it changes the behaviour of useful keys (enter, cursor keys, page up/down, home/end)
  • as it appears after a delay, it can capture a keypress that was intended for its usual purpose in the text editor
  • it appears suddenly, which can be disconcerting
  • it can rapidly change as you type (flickering/flashing just outside of what you're looking at), which is distracting at best, adds to sensory & cognitive load
  • it can cover up text that you were referring to

Most of these points only become problems because it is triggered automatically. If it appeared as a result of the user requesting it, then e.g. taking keyboard focus would be reasonable to expect. I haven't found a lot of other criticism about this, so I would avoid changing the behaviour of the code completion itself.

Steps to reproduce

In the built-in script editor, type a letter on a new line in the body of a function.
Code completion triggers automatically after a delay period (set in EditorSettings).

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Nov 1, 2022

Do other code editors offer settings to disable autocompletion entirely?

Note that you can customize the code completion tooltip delay in the Editor Settings already.

As for making shortcuts less intrusive, you can change the ui_text_completion_accept shortcut in the Editor Settings to Tab instead of Enter (only in 4.0.beta). This helps a lot in my experience, and I wish more code editors defaulted to this 🙂

@quinnyo
Copy link
Contributor Author

quinnyo commented Nov 1, 2022

It's pretty common to find such a setting, in my experience. As an example, vscode has quite a lot of options to configure how its completion can be triggered, including if/how it should be triggered automatically. The main relevant setting seems to be editor.quickSuggestions which Controls whether suggestions should automatically show up while typing.

I do use the existing delay setting, but I find issues with setting it very far either side of the default. Changing the delay to be longer magnifies the issues with the popup's sudden appearance, it's less predictable. Changing the delay to be shorter makes the popup more frequently and consistently visible, as you'd expect, but this magnifies the other issues.

Thanks for the tip about the new setting, freeing up Enter would be a small but definite improvement. I have often preferred using Tab for this as well, in other editors. (although I do invariably end up wanting to insert a tab character at some point while the completion popup is visible 🫠)

@tillfalko
Copy link

Adding to this to say that all major code editor offer the ability to turn off automatic code completions. It is very distracting for some people. The In-Engine editor really has come a long way so hope this little thing gets fixed soon.

This is not even a feature that needs to be written, just raise the arbitrarily low max value of 5 in text_editor/completion/code_complete_delay, and let me enter 2^32. It's not like you can't manually trigger code completions with Ctrl+Space.

@NathanaelSpecht
Copy link

NathanaelSpecht commented Jun 15, 2023

Adding this to say I found a manual workaround to turn off Godot's autocomplete on Windows.

In File Explorer, go to "%AppData%" > Godot. Open "editor_settings-4.tres" in a text editor, then scroll down to "text_editor/completion/code_complete_delay" and set it to some arbitrary high value. (I set it to 100000.0) Save the file then restart Godot and code completion should effectively be gone.

Works for me in Godot 4.0.3.stable on Windows 10.

EDIT: I just noticed this issue is for Arch Linux. I don't know what the equivalent of "%AppData%" folder is for Linux, but I wouldn't be suprised if it's the same settings file.

TLDR: Godot's max value of 5 in "text_editor/completion/code_complete_delay" is only a limitation in the UI and can be changed in the settings file if you know where to find it.

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