1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Autocompletion: Remove additional brace from utility function options

This commit is contained in:
HolonProduction
2025-04-15 13:25:28 +02:00
parent e5ccaa79e2
commit 3f0ff0417c
4 changed files with 66 additions and 58 deletions

View File

@@ -1524,7 +1524,6 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
for (const StringName &util_func_name : utility_func_names) { for (const StringName &util_func_name : utility_func_names) {
ScriptLanguage::CodeCompletionOption option(util_func_name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION); ScriptLanguage::CodeCompletionOption option(util_func_name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
option.insert_text += "(";
if (p_add_braces) { if (p_add_braces) {
option.insert_text += "("; option.insert_text += "(";
option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here. option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.

View File

@@ -1,25 +1,28 @@
scene="res://completion/get_node/get_node.tscn" scene="res://completion/get_node/get_node.tscn"
[output] [output]
include=[ include=[
; Node ; Utility Functions
{"display": "add_child(…)"}, {"display": "print(…)", "insert_text": "print("},
{"display": "owner"},
{"display": "child_entered_tree"},
; GDScript: class_a.notest.gd ; Node
{"display": "property_of_a"}, {"display": "add_child(…)"},
{"display": "func_of_a()"}, {"display": "owner"},
{"display": "signal_of_a"}, {"display": "child_entered_tree"},
; GDScript: identifiers.gd ; GDScript: class_a.notest.gd
{"display": "test_signal_1"}, {"display": "property_of_a"},
{"display": "test_signal_2"}, {"display": "func_of_a()"},
{"display": "test_var_1"}, {"display": "signal_of_a"},
{"display": "test_var_2"},
{"display": "test_func_1(…)"}, ; GDScript: identifiers.gd
{"display": "test_func_2(…)"}, {"display": "test_signal_1"},
{"display": "test_parameter_1"}, {"display": "test_signal_2"},
{"display": "test_parameter_2"}, {"display": "test_var_1"},
{"display": "local_test_var_1"}, {"display": "test_var_2"},
{"display": "local_test_var_2"}, {"display": "test_func_1(…)"},
{"display": "test_func_2(…)"},
{"display": "test_parameter_1"},
{"display": "test_parameter_2"},
{"display": "local_test_var_1"},
{"display": "local_test_var_2"},
] ]

View File

@@ -1,25 +1,28 @@
scene="res://completion/get_node/get_node.tscn" scene="res://completion/get_node/get_node.tscn"
[output] [output]
include=[ include=[
; Node ; Utility Functions
{"display": "add_child(…)"}, {"display": "print(…)", "insert_text": "print("},
{"display": "owner"},
{"display": "child_entered_tree"},
; GDScript: class_a.notest.gd ; Node
{"display": "property_of_a"}, {"display": "add_child(…)"},
{"display": "func_of_a()"}, {"display": "owner"},
{"display": "signal_of_a"}, {"display": "child_entered_tree"},
; GDScript: identifiers.gd ; GDScript: class_a.notest.gd
{"display": "test_signal_1"}, {"display": "property_of_a"},
{"display": "test_signal_2"}, {"display": "func_of_a()"},
{"display": "test_var_1"}, {"display": "signal_of_a"},
{"display": "test_var_2"},
{"display": "test_func_1(…)"}, ; GDScript: identifiers.gd
{"display": "test_func_2(…)"}, {"display": "test_signal_1"},
{"display": "test_parameter_1"}, {"display": "test_signal_2"},
{"display": "test_parameter_2"}, {"display": "test_var_1"},
{"display": "local_test_var_1"}, {"display": "test_var_2"},
{"display": "local_test_var_2"}, {"display": "test_func_1(…)"},
{"display": "test_func_2(…)"},
{"display": "test_parameter_1"},
{"display": "test_parameter_2"},
{"display": "local_test_var_1"},
{"display": "local_test_var_2"},
] ]

View File

@@ -1,25 +1,28 @@
scene="res://completion/get_node/get_node.tscn" scene="res://completion/get_node/get_node.tscn"
[output] [output]
include=[ include=[
; Node ; Utility Functions
{"display": "add_child(…)"}, {"display": "print(…)", "insert_text": "print("},
{"display": "owner"},
{"display": "child_entered_tree"},
; GDScript: class_a.notest.gd ; Node
{"display": "property_of_a"}, {"display": "add_child(…)"},
{"display": "func_of_a()"}, {"display": "owner"},
{"display": "signal_of_a"}, {"display": "child_entered_tree"},
; GDScript: identifiers.gd ; GDScript: class_a.notest.gd
{"display": "test_signal_1"}, {"display": "property_of_a"},
{"display": "test_signal_2"}, {"display": "func_of_a()"},
{"display": "test_var_1"}, {"display": "signal_of_a"},
{"display": "test_var_2"},
{"display": "test_func_1(…)"}, ; GDScript: identifiers.gd
{"display": "test_func_2(…)"}, {"display": "test_signal_1"},
{"display": "test_parameter_1"}, {"display": "test_signal_2"},
{"display": "test_parameter_2"}, {"display": "test_var_1"},
{"display": "local_test_var_1"}, {"display": "test_var_2"},
{"display": "local_test_var_2"}, {"display": "test_func_1(…)"},
{"display": "test_func_2(…)"},
{"display": "test_parameter_1"},
{"display": "test_parameter_2"},
{"display": "local_test_var_1"},
{"display": "local_test_var_2"},
] ]