From 345f09d1255e20b8980adcf70c3cb29f350a220b Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 6 Feb 2024 19:35:52 +0100 Subject: [PATCH] Enable Add Type Hints editor setting by default Now that GDScript type hints improve performance since Godot 4.0 and the community is increasingly getting used to typed GDScript, it makes sense to add type hints by default. Official demos will also be moving to type hints at some point in the future, further increasing the relevance of enabling type hints out of the box. --- doc/classes/EditorSettings.xml | 2 +- editor/editor_settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 449f5639fd2..fdf65bbba12 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -888,7 +888,7 @@ [b]Note:[/b] You can hold down [kbd]Alt[/kbd] while using the mouse wheel to temporarily scroll 5 times faster. - If [code]true[/code], adds static typing hints such as [code]-> void[/code] and [code]: int[/code] when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the [kbd]Ctrl[/kbd] key. + If [code]true[/code], adds [url=$DOCS_URL/tutorials/scripting/gdscript/static_typing.html]GDScript static typing[/url] hints such as [code]-> void[/code] and [code]: int[/code] when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the [kbd]Ctrl[/kbd] key. If [code]true[/code], newly created scripts will also automatically have type hints added to their method parameters and return types. If [code]true[/code], automatically completes braces when making use of code completion. diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 060f2054165..7a1e055ba49 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -616,7 +616,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "text_editor/completion/code_complete_delay", 0.3, "0.01,5,0.01,or_greater") _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/complete_file_paths", true); - _initial_set("text_editor/completion/add_type_hints", false); + _initial_set("text_editor/completion/add_type_hints", true); _initial_set("text_editor/completion/use_single_quotes", false); _initial_set("text_editor/completion/colorize_suggestions", true);