diff --git a/core/input/input.cpp b/core/input/input.cpp index 97d476314d..122f1681be 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -136,11 +136,8 @@ void Input::_bind_methods() { ADD_SIGNAL(MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "device"), PropertyInfo(Variant::BOOL, "connected"))); } -void Input::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { +void Input::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { #ifdef TOOLS_ENABLED - - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; - String pf = p_function; if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" || diff --git a/core/input/input.h b/core/input/input.h index de4bbd8f2d..77f9859fb7 100644 --- a/core/input/input.h +++ b/core/input/input.h @@ -126,7 +126,7 @@ class Input : public Object { virtual void action_press(const StringName &p_action, float p_strength = 1.f) = 0; virtual void action_release(const StringName &p_action) = 0; - void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; virtual bool is_emulating_touch_from_mouse() const = 0; virtual bool is_emulating_mouse_from_touch() const = 0; diff --git a/core/object/object.cpp b/core/object/object.cpp index dec91aa7e5..ed37006660 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -2059,7 +2059,7 @@ void ObjectDB::debug_objects(DebugFunc p_func) { rw_lock.read_unlock(); } -void Object::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { +void Object::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { } int ObjectDB::get_object_count() { diff --git a/core/object/object.h b/core/object/object.h index ddc415fefc..b0f0f0a68a 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -774,7 +774,7 @@ class Object { virtual void get_translatable_strings(List *p_strings) const; - virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; StringName tr(const StringName &p_message) const; // translate message (internationalization) StringName trt(const StringName &p_message, const String &p_locale) const; // translate message (translate_to) (internationalization) diff --git a/modules/cscript/cscript_editor.cpp b/modules/cscript/cscript_editor.cpp index 0cf5a80bce..837b64cea3 100644 --- a/modules/cscript/cscript_editor.cpp +++ b/modules/cscript/cscript_editor.cpp @@ -2309,7 +2309,7 @@ static void _find_call_arguments(const CScriptCompletionContext &p_context, cons Object *obj = base.operator Object *(); if (obj) { List options; - obj->get_argument_options(p_method, p_argidx, &options); + obj->get_argument_options(p_method, p_argidx, &options, quote_style); for (List::Element *F = options.front(); F; F = F->next()) { ScriptCodeCompletionOption option(F->get(), ScriptCodeCompletionOption::KIND_FUNCTION); r_result.insert(option.display, option); @@ -2611,7 +2611,7 @@ Error CScriptLanguage::complete_code(const String &p_code, const String &p_path, case CScriptParser::COMPLETION_GET_NODE: { if (p_owner) { List opts; - p_owner->get_argument_options("get_node", 0, &opts); + p_owner->get_argument_options("get_node", 0, &opts, quote_style); for (List::Element *E = opts.front(); E; E = E->next()) { String opt = E->get().strip_edges(); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index f73e5d8469..a17a88849c 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2330,7 +2330,7 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con Object *obj = base.operator Object *(); if (obj) { List options; - obj->get_argument_options(p_method, p_argidx, &options); + obj->get_argument_options(p_method, p_argidx, &options, quote_style); for (List::Element *F = options.front(); F; F = F->next()) { ScriptCodeCompletionOption option(F->get(), ScriptCodeCompletionOption::KIND_FUNCTION); r_result.insert(option.display, option); @@ -2632,7 +2632,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path case GDScriptParser::COMPLETION_GET_NODE: { if (p_owner) { List opts; - p_owner->get_argument_options("get_node", 0, &opts); + p_owner->get_argument_options("get_node", 0, &opts, quote_style); for (List::Element *E = opts.front(); E; E = E->next()) { String opt = E->get().strip_edges(); diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 553513d57d..5d3890520d 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -280,13 +280,7 @@ void SpriteFrames::_set_animations(const Array &p_animations) { } } -void AnimatedSprite::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - +void AnimatedSprite::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { if (p_idx == 0 && p_function == "play" && frames.is_valid()) { List al; frames->get_animation_list(&al); @@ -294,7 +288,7 @@ void AnimatedSprite::get_argument_options(const StringName &p_function, int p_id r_options->push_back(quote_style + String(E->get()) + quote_style); } } - Node::get_argument_options(p_function, p_idx, r_options); + Node::get_argument_options(p_function, p_idx, r_options, quote_style); } void SpriteFrames::_bind_methods() { diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index b331a6fa18..58e0a1f214 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -194,7 +194,7 @@ class AnimatedSprite : public Node2D { bool is_flipped_v() const; virtual String get_configuration_warning() const; - virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; AnimatedSprite(); }; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 80e8eee76f..9cad6cc6df 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -440,13 +440,7 @@ SpatialMaterial::BillboardMode SpriteBase3D::get_billboard_mode() const { return billboard_mode; } -void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - +void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { if (p_idx == 0 && p_function == "play" && frames.is_valid()) { List al; frames->get_animation_list(&al); @@ -454,7 +448,7 @@ void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_ r_options->push_back(quote_style + String(E->get()) + quote_style); } } - Node::get_argument_options(p_function, p_idx, r_options); + Node::get_argument_options(p_function, p_idx, r_options, quote_style); } void SpriteBase3D::_bind_methods() { diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index ce5c0b9acf..5f3bc15099 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -247,7 +247,7 @@ class AnimatedSprite3D : public SpriteBase3D { virtual Rect2 get_item_rect() const; virtual String get_configuration_warning() const; - virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; AnimatedSprite3D(); }; diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index b836af5aaf..028e7d527b 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1630,13 +1630,7 @@ NodePath AnimationPlayer::get_root() const { return root; } -void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - +void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { String pf = p_function; if (p_idx == 0 && (p_function == "play" || p_function == "play_backwards" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue")) { List al; @@ -1645,7 +1639,7 @@ void AnimationPlayer::get_argument_options(const StringName &p_function, int p_i r_options->push_back(quote_style + String(E->get()) + quote_style); } } - Node::get_argument_options(p_function, p_idx, r_options); + Node::get_argument_options(p_function, p_idx, r_options, quote_style); } #ifdef TOOLS_ENABLED diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index c2fa89251d..7a5484c9b0 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -384,7 +384,7 @@ class AnimationPlayer : public Node { void clear_caches(); ///< must be called by hand if an animation was modified after added - void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; #ifdef TOOLS_ENABLED Ref backup_animated_values(Node *p_root_override = NULL); diff --git a/scene/main/control.cpp b/scene/main/control.cpp index 26f8afbed9..b45c2a4964 100644 --- a/scene/main/control.cpp +++ b/scene/main/control.cpp @@ -2659,14 +2659,8 @@ bool Control::is_visibility_clip_disabled() const { return data.disable_visibility_clip; } -void Control::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - - Node::get_argument_options(p_function, p_idx, r_options); +void Control::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { + Node::get_argument_options(p_function, p_idx, r_options, quote_style); if (p_idx == 0) { List sn; diff --git a/scene/main/control.h b/scene/main/control.h index aad8281d1d..a345e7ff7f 100644 --- a/scene/main/control.h +++ b/scene/main/control.h @@ -519,7 +519,7 @@ class Control : public CanvasItem { void set_disable_visibility_clip(bool p_ignore); bool is_visibility_clip_disabled() const; - virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; virtual String get_configuration_warning() const; Control(); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e1fc62bb61..5bd777fa48 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -3413,12 +3413,12 @@ static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List *r_options) const { +void Node::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { String pf = p_function; if ((pf == "has_node" || pf == "get_node") && p_idx == 0) { _add_nodes_to_options(this, this, r_options); } - Object::get_argument_options(p_function, p_idx, r_options); + Object::get_argument_options(p_function, p_idx, r_options, quote_style); } void Node::clear_internal_tree_resource_paths() { diff --git a/scene/main/node.h b/scene/main/node.h index d8dbea4f10..159059b45c 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -568,7 +568,7 @@ class Node : public Object { bool is_owned_by_parent() const; - void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; void clear_internal_tree_resource_paths(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index b3bc396622..cb06632027 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -2431,7 +2431,7 @@ bool SceneTree::is_using_font_oversampling() const { return use_font_oversampling; } -void SceneTree::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { +void SceneTree::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { if (p_function == "change_scene") { DirAccessRef dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); List directories; diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 695f32f756..0b05300af4 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -441,7 +441,7 @@ class SceneTree : public MainLoop { void drop_files(const Vector &p_files, int p_from_screen = 0); void global_menu_action(const Variant &p_id, const Variant &p_meta); - void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; //network API diff --git a/scene/resources/material/material.cpp b/scene/resources/material/material.cpp index 9438981284..b2844e24ec 100644 --- a/scene/resources/material/material.cpp +++ b/scene/resources/material/material.cpp @@ -233,13 +233,7 @@ void ShaderMaterial::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader"), "set_shader", "get_shader"); } -void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - +void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const { String f = p_function.operator String(); if ((f == "get_shader_param" || f == "set_shader_param") && p_idx == 0) { if (shader.is_valid()) { @@ -250,7 +244,7 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id } } } - Resource::get_argument_options(p_function, p_idx, r_options); + Resource::get_argument_options(p_function, p_idx, r_options, quote_style); } bool ShaderMaterial::_can_do_next_pass() const { diff --git a/scene/resources/material/material.h b/scene/resources/material/material.h index 4cf399a3c5..027993b84e 100644 --- a/scene/resources/material/material.h +++ b/scene/resources/material/material.h @@ -84,7 +84,7 @@ class ShaderMaterial : public Material { static void _bind_methods(); - void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; + void get_argument_options(const StringName &p_function, int p_idx, List *r_options, const String "e_style) const; virtual bool _can_do_next_pass() const;