Repository: godotengine/godot
File: editor/script/script_text_editor.cpp (C++)

Code before:
	return false;
}

void ScriptTextEditor::set_drop_info_text(const Dictionary &p_info) const {
	String text;
	String c = keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL);

	static const String single_resource_text = TTR("Drag and drop to copy the file path to the script.") +
			"\n" + vformat(TTR("Hold %s when dropping to add a const var, preloading the resource at that path."), c) +
			"\n" + TTR("Hold Shift to switch between referencing the resource by UID/file path.") +
			"\n" + TTR("Hold Alt when dropping to add an @export var pointing to the resource.");

	static const String multiple_resources_text = TTR("Drag and drop to copy the file paths to the script.") +
			"\n" + vformat(TTR("Hold %s when dropping to add const vars, preloading the resources at those paths."), c) +
			"\n" + TTR("Hold Shift to switch between referencing the resources by UID/file path.") +
			"\n" + TTR("Hold Alt when dropping to add @export vars pointing to the resources.");

	static const String single_node_text = TTR("Drag and drop to copy the node path to the script.") +
			"\n" + vformat(TTR("Hold %s when dropping to add an @onready var pointing to the node path."), c) +
			"\n" + TTR("Hold Alt when dropping to add an @export var pointing to the node.");

	static const String multiple_nodes_text = TTR("Drag and drop to copy the node paths to the script.") +
			"\n" + vformat(TTR("Hold %s when dropping to add @onready vars pointing to the node paths."), c) +
			"\n" + TTR("Hold Alt when dropping to add @export vars pointing to the nodes.");

	String type = String(p_info["type"]);

	if (type == "files" || type == "files_and_dirs") {
		Array files = p_info["files"];
		text = files.size() > 1 ? multiple_resources_text : single_resource_text;
	} else if (type == "nodes") {
		Array nodes = p_info["nodes"];
		text = nodes.size() > 1 ? multiple_nodes_text : single_node_text;
	} else if (type == "resource") {
		text = single_resource_text;
	} else if (type == "obj_property") {
		text = TTR("Drag and drop to copy the property path to the script.");
	}

	drag_info_label->show();
	drag_info_label->set_text(text);
	drag_info_label->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_RIGHT, Control::PRESET_MODE_MINSIZE, 20 * EDSCALE);
}

static Node *_find_script_node(Node *p_current_node, const Ref<Script> &script) {
	if (p_current_node->get_script() == script) {
		return p_current_node;
	}

	for (int i = 0; i < p_current_node->get_child_count(); i++) {
		Node *n = _find_script_node(p_current_node->get_child(i), script);

Review comment (suggestion):
```suggestion
	const String type = p_info.get("type", "");
```

Code after:
				} else {
					text_to_drop += vformat("@onready var %s = %c%s", variable_name, is_unique ? '%' : '$', path);
				}
				if (i < nodes.size() - 1) {
					text_to_drop += "\n";
				}
			}

			if (is_empty_line || drop_at_column == 0) {
				text_to_drop += "\n";
			}
		} else if (export_drop_modifier_pressed) {
			Vector<ObjectID> obj_ids = _get_objects_for_export_assignment();

			for (int i = 0; i < nodes.size(); i++) {
				NodePath np = nodes[i];
				Node *node = get_node(np);
				if (!node) {
					continue;
				}

				String variable_name = String(node->get_name()).to_snake_case().validate_unicode_identifier();
				StringName class_name = node->get_class_name();
				Ref<Script> node_script = node->get_script();
				if (node_script.is_valid()) {
					StringName global_node_script_name = node_script->get_global_name();
					if (!global_node_script_name.is_empty()) {
						class_name = global_node_script_name;
					}
				}

				text_to_drop += vformat("@export var %s: %s\n", variable_name, class_name);
				for (ObjectID obj_id : obj_ids) {
					pending_dragged_exports.push_back(DraggedExport{ obj_id, variable_name, node, class_name });
				}
			}
		} else {
			for (int i = 0; i < nodes.size(); i++) {
				if (i > 0) {
					text_to_drop += ", ";
				}

				NodePath np = nodes[i];
				Node *node = get_node(np);
				if (!node) {
					continue;
				}

				bool is_unique = node->is_unique_name_in_owner() && (node->get_owner() == sn || node->get_owner() == sn->get_owner());
				String path = is_unique ? String(node->get_name()) : String(sn->get_path_to(node));
				for (const String &segment : path.split("/")) {