-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Add editor setting to toggle automatic code completion #68140
Conversation
I'm on board with the idea. Code LGTM, can't think of anything that could possibly go wrong (famous last words) |
I mean, sure! The editor setting makes sense on its own, but... quoting the issue:
the fact that the autocompletion in 4.0 is SO ATROCIOUSLY invasive users may want to outright disable it unless manually brought up is quite damning evidence that perhaps something more should be... done about it.
|
Rather then adding a new setting, would it be worth making a delay of |
@Paulb23 that doesn't sound very intuitive to me. Is it possible to set it to a negative value? That'd map much better, but it may still be less user-friendly than a plain toggle. |
060d324
to
3ee8176
Compare
synced with master |
Some notes based on comments here and in the issue: Improving the suggestions themselves is a worthy endeavour, but it is a separate one. The fact that the suggestions pop up automatically is the issue. It doesn't matter how good the suggestions are. I don't think overloading the delay setting (i.e. allowing an out of range or practically infinite value) is a good way to go. It's messy and less obvious than a dedicated setting. |
I support adding this. I'm not sure about the name of the setting though. I'd suggest maybe While at it, could you add |
3ee8176
to
ddcbf3e
Compare
I've made the suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor changes needed, but looks great otherwise.
ddcbf3e
to
8f21db7
Compare
Done and done! (Not sure if I'll ever get used to in-class initialisers...) |
Sorry for the CI failure, it's not an issue with your code. But you need to do a rebase against master and force-push again. |
8f21db7
to
68c24f9
Compare
Done! |
@@ -837,6 +837,9 @@ | |||
<member name="text_editor/completion/code_complete_delay" type="float" setter="" getter=""> | |||
The delay in seconds after which autocompletion suggestions should be displayed when the user stops typing. | |||
</member> | |||
<member name="text_editor/completion/code_complete_enabled" type="bool" setter="" getter=""> | |||
If [code]true[/code], code completion will be triggered automatically after [member text_editor/completion/code_complete_delay]. If [code]false[/code], you can still trigger completion manually by pressing [kbd]Ctrl + Space[/kbd] ([kbd]Cmd + Space[/kbd] on macOS). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for a late review, but since this is configurable we should mention that this is only true by default.
If [code]true[/code], code completion will be triggered automatically after [member text_editor/completion/code_complete_delay]. If [code]false[/code], you can still trigger completion manually by pressing [kbd]Ctrl + Space[/kbd] ([kbd]Cmd + Space[/kbd] on macOS). | |
If [code]true[/code], code completion will be triggered automatically after [member text_editor/completion/code_complete_delay]. If [code]false[/code], you can still trigger completion with a shortcut (by default, [kbd]Ctrl + Space[/kbd] on Linux and Windows, [kbd]Cmd + Space[/kbd] on macOS). |
This adds a boolean editor setting (
text_editor/completion/auto_code_complete
) and implementation in the code editor to allow automatic code completion to be disabled. It's a pretty small, straightforward change, I think -- but I don't know what I did wrong yet!Fixes #68139.