ronantakizawa/codereview-bench huggingface dataset:
Repository: godotengine/godot
File: scene/resources/animation.cpp (C++)

Code before:
		if (track_is_compressed(i)) {
			continue; //not possible to optimize compressed track
		}
		if (tracks[i]->type == TYPE_POSITION_3D) {
			_position_track_optimize(i, p_allowed_linear_err, p_allowed_angular_err);
		} else if (tracks[i]->type == TYPE_ROTATION_3D) {
			_rotation_track_optimize(i, p_allowed_angular_err, p_max_optimizable_angle);
		} else if (tracks[i]->type == TYPE_SCALE_3D) {
			_scale_track_optimize(i, p_allowed_linear_err);
		} else if (tracks[i]->type == TYPE_BLEND_SHAPE) {
			_blend_shape_track_optimize(i, p_allowed_linear_err);
		}
	}
}

#define print_animc(m_str)
//#define print_animc(m_str) print_line(m_str);

struct AnimationCompressionDataState {
	enum {
		MIN_OPTIMIZE_PACKETS = 5,
		MAX_PACKETS = 16
	};

	uint32_t components = 3;
	LocalVector<uint8_t> data; //commited packets
	struct PacketData {
		int32_t data[3] = { 0, 0, 0 };
		uint32_t frame = 0;
	};

	float split_tolerance = 1.5;

	LocalVector<PacketData> temp_packets;

	//used for rollback if the new frame does not fit
	int32_t validated_packet_count = -1;

	static int32_t _compute_delta16_signed(int32_t p_from, int32_t p_to) {
		int32_t delta = p_to - p_from;
		if (delta > 32767) {
			return delta - 65536; // use wrap around
		} else if (delta < -32768) {
			return 65536 + delta; // use wrap around
		}
		return delta;
	}

	static uint32_t _compute_shift_bits_signed(int32_t p_delta) {
		if (p_delta == 0) {
			return 0;

Review comment (suggestion):
```suggestion
	LocalVector<uint8_t> data; // Committed packets.
```

Code after:
		if (track_is_compressed(i)) {
			continue; //not possible to optimize compressed track
		}
		if (tracks[i]->type == TYPE_POSITION_3D) {
			_position_track_optimize(i, p_allowed_linear_err, p_allowed_angular_err);
		} else if (tracks[i]->type == TYPE_ROTATION_3D) {
			_rotation_track_optimize(i, p_allowed_angular_err, p_max_optimizable_angle);
		} else if (tracks[i]->type == TYPE_SCALE_3D) {
			_scale_track_optimize(i, p_allowed_linear_err);
		} else if (tracks[i]->type == TYPE_BLEND_SHAPE) {
			_blend_shape_track_optimize(i, p_allowed_linear_err);
		}
	}
}

#define print_animc(m_str)
//#define print_animc(m_str) print_line(m_str);

struct AnimationCompressionDataState {
	enum {
		MIN_OPTIMIZE_PACKETS = 5,
		MAX_PACKETS = 16
	};

	uint32_t components = 3;
	LocalVector<uint8_t> data; // Committed packets.
	struct PacketData {
		int32_t data[3] = { 0, 0, 0 };
		uint32_t frame = 0;
	};

	float split_tolerance = 1.5;

	LocalVector<PacketData> temp_packets;

	//used for rollback if the new frame does not fit
	int32_t validated_packet_count = -1;

	static int32_t _compute_delta16_signed(int32_t p_from, int32_t p_to) {
		int32_t delta = p_to - p_from;
		if (delta > 32767) {
			return delta - 65536; // use wrap around
		} else if (delta < -32768) {
			return 65536 + delta; // use wrap around
		}
		return delta;
	}

	static uint32_t _compute_shift_bits_signed(int32_t p_delta) {
		if (p_delta == 0) {
			return 0;
Repository: godotengine/godot
File: modules/mono/csharp_script.h (C/C++)

Code before:
class CSharpScript : public Script {
	GDCLASS(CSharpScript, Script);

public:
	struct SignalParameter {
		String name;
		Variant::Type type;
		bool nil_is_variant = false;
	};

	struct EventSignal {
		GDMonoField *field = nullptr;
		GDMonoMethod *invoke_method = nullptr;
		Vector<SignalParameter> parameters;
	};

private:
	friend class CSharpInstance;
	friend class CSharpLanguage;
	friend struct CSharpScriptDepSort;

	bool tool = false;
	bool valid = false;
	bool reload_invalidated = false;

	bool builtin;

	GDMonoClass *base = nullptr;
	GDMonoClass *native = nullptr;
	GDMonoClass *script_class = nullptr;

	Ref<CSharpScript> base_cache; // TODO what's this for?

	Set<Object *> instances;

#ifdef GD_MONO_HOT_RELOAD
	struct StateBackup {
		// TODO
		// Replace with buffer containing the serialized state of managed scripts.
		// Keep variant state backup to use only with script instance placeholders.
		List<Pair<StringName, Variant>> properties;
		List<Pair<StringName, Array>> event_signals;
	};

	Set<ObjectID> pending_reload_instances;
	Map<ObjectID, StateBackup> pending_reload_state;
	StringName tied_class_name_for_reload;
	StringName tied_class_namespace_for_reload;
#endif

	String source;

Review comment (suggestion):
This actually seems unused, so it should be removed. No reference to it in the `.cpp`, and it's private.

Code after:
class CSharpScript : public Script {
	GDCLASS(CSharpScript, Script);

public:
	struct SignalParameter {
		String name;
		Variant::Type type;
		bool nil_is_variant = false;
	};

	struct EventSignal {
		GDMonoField *field = nullptr;
		GDMonoMethod *invoke_method = nullptr;
		Vector<SignalParameter> parameters;
	};

private:
	friend class CSharpInstance;
	friend class CSharpLanguage;
	friend struct CSharpScriptDepSort;

	bool tool = false;
	bool valid = false;
	bool reload_invalidated = false;

	GDMonoClass *base = nullptr;
	GDMonoClass *native = nullptr;
	GDMonoClass *script_class = nullptr;

	Ref<CSharpScript> base_cache; // TODO what's this for?

	Set<Object *> instances;

#ifdef GD_MONO_HOT_RELOAD
	struct StateBackup {
		// TODO
		// Replace with buffer containing the serialized state of managed scripts.
		// Keep variant state backup to use only with script instance placeholders.
		List<Pair<StringName, Variant>> properties;
		List<Pair<StringName, Array>> event_signals;
	};

	Set<ObjectID> pending_reload_instances;
	Map<ObjectID, StateBackup> pending_reload_state;
	StringName tied_class_name_for_reload;
	StringName tied_class_namespace_for_reload;
#endif

	String source;
	StringName name;
Repository: godotengine/godot
File: scene/animation/animation_tree.h (C/C++)

Code before:
private:
	struct TrackCache {
		bool root_motion = false;
		uint64_t setup_pass = 0;
		uint64_t process_pass = 0;
		Animation::TrackType type = Animation::TrackType::TYPE_ANIMATION;
		Object *object = nullptr;
		ObjectID object_id;

		TrackCache() {
		}
		virtual ~TrackCache() {}
	};

	struct TrackCacheTransform : public TrackCache {
#ifndef _3D_DISABLED
		Node3D *node_3d = nullptr;
		Skeleton3D *skeleton = nullptr;
#endif // _3D_DISABLED
		int bone_idx = -1;
		bool loc_used = false;
		bool rot_used = false;
		bool scale_used = false;
		Vector3 loc;
		Quaternion rot;
		real_t rot_blend_accum = 0.0;
		Vector3 scale;

		TrackCacheTransform() {
			type = Animation::TYPE_POSITION_3D;
		}
	};

	struct TrackCacheBlendShape : public TrackCache {
		MeshInstance3D *mesh_3d = nullptr;
		float value = 0;
		int shape_index = -1;
		TrackCacheBlendShape() { type = Animation::TYPE_BLEND_SHAPE; }
	};

	struct TrackCacheValue : public TrackCache {
		Variant value;
		Vector<StringName> subpath;
		TrackCacheValue() { type = Animation::TYPE_VALUE; }
	};

	struct TrackCacheMethod : public TrackCache {
		TrackCacheMethod() { type = Animation::TYPE_METHOD; }
	};

	struct TrackCacheBezier : public TrackCache {

Review comment (suggestion):
I wondered if `Quaternion init_rot_accum` was necessary as a member, but since `init_rot.log()` calculation is required for this every time at line 1164 of animation_tree.cpp, I defined it to reduce the calculation cost. Also, `Quaternion init_rot` is required to determine flips and it should avoid to need `init_rot_accum.exp()` more.

Code after:
private:
	struct TrackCache {
		bool root_motion = false;
		uint64_t setup_pass = 0;
		uint64_t process_pass = 0;
		Animation::TrackType type = Animation::TrackType::TYPE_ANIMATION;
		Object *object = nullptr;
		ObjectID object_id;

		TrackCache() {
		}
		virtual ~TrackCache() {}
	};

	struct TrackCacheTransform : public TrackCache {
#ifndef _3D_DISABLED
		Node3D *node_3d = nullptr;
		Skeleton3D *skeleton = nullptr;
#endif // _3D_DISABLED
		int bone_idx = -1;
		bool loc_used = false;
		bool rot_used = false;
		bool scale_used = false;
		Vector3 init_loc = Vector3(0, 0, 0);
		Quaternion ref_rot = Quaternion(0, 0, 0, 1);
		Quaternion init_rot = Quaternion(0, 0, 0, 0);
		Vector3 init_scale = Vector3(1, 1, 1);
		Vector3 loc;
		Quaternion rot;
		Vector3 scale;

		TrackCacheTransform() {
			type = Animation::TYPE_POSITION_3D;
		}
	};

	struct TrackCacheBlendShape : public TrackCache {
		MeshInstance3D *mesh_3d = nullptr;
		float value = 0;
		int shape_index = -1;
		TrackCacheBlendShape() { type = Animation::TYPE_BLEND_SHAPE; }
	};

	struct TrackCacheValue : public TrackCache {
		Variant value;
		Vector<StringName> subpath;
		TrackCacheValue() { type = Animation::TYPE_VALUE; }
	};

	struct TrackCacheMethod : public TrackCache {
		TrackCacheMethod() { type = Animation::TYPE_METHOD; }
Repository: godotengine/godot
File: scene/resources/resource_format_text.cpp (C++)

Code before:
			}

			f->store_line("]");
		}

		Vector<NodePath> editable_instances = state->get_editable_instances();
		for (int i = 0; i < editable_instances.size(); i++) {
			if (i == 0) {
				f->store_line("");
			}
			f->store_line("[editable path=\"" + editable_instances[i].operator String() + "\"]");
		}
	}

	if (f->get_error() != OK && f->get_error() != ERR_FILE_EOF) {
		f->close();
		return ERR_CANT_CREATE;
	}

	f->close();

	return OK;
}

Error ResourceFormatSaverText::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
	if (p_path.ends_with(".sct") && p_resource->get_class() != "PackedScene") {
		return ERR_FILE_UNRECOGNIZED;
	}

	ResourceFormatSaverTextInstance saver;
	return saver.save(p_path, p_resource, p_flags);
}

bool ResourceFormatSaverText::recognize(const RES &p_resource) const {
	return true; // all recognized!
}

void ResourceFormatSaverText::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const {
	if (p_resource->get_class() == "PackedScene") {
		p_extensions->push_back("tscn"); //text scene
	} else {
		p_extensions->push_back("tres"); //text resource
	}
}

ResourceFormatSaverText *ResourceFormatSaverText::singleton = nullptr;
ResourceFormatSaverText::ResourceFormatSaverText() {
	singleton = this;
}


Review comment (bug):
This actually fixes a bug, `.sct` is not a valid extension.

Code after:
			}

			f->store_line("]");
		}

		Vector<NodePath> editable_instances = state->get_editable_instances();
		for (int i = 0; i < editable_instances.size(); i++) {
			if (i == 0) {
				f->store_line("");
			}
			f->store_line("[editable path=\"" + editable_instances[i].operator String() + "\"]");
		}
	}

	if (f->get_error() != OK && f->get_error() != ERR_FILE_EOF) {
		f->close();
		return ERR_CANT_CREATE;
	}

	f->close();

	return OK;
}

Error ResourceFormatSaverText::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
	if (p_path.ends_with(".tscn") && !Ref<PackedScene>(p_resource).is_valid()) {
		return ERR_FILE_UNRECOGNIZED;
	}

	ResourceFormatSaverTextInstance saver;
	return saver.save(p_path, p_resource, p_flags);
}

bool ResourceFormatSaverText::recognize(const RES &p_resource) const {
	return true; // All resources recognized!
}

void ResourceFormatSaverText::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const {
	if (Ref<PackedScene>(p_resource).is_valid()) {
		p_extensions->push_back("tscn"); // Text scene.
	} else {
		p_extensions->push_back("tres"); // Text resource.
	}
}

ResourceFormatSaverText *ResourceFormatSaverText::singleton = nullptr;
ResourceFormatSaverText::ResourceFormatSaverText() {
	singleton = this;
}
Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.h (C/C++)

Code before:
	Point2 _point_to_screen(const Vector3 &p_point);
	Transform3D _get_camera_transform() const;
	int get_selected_count() const;
	void cancel_transform();

	Vector3 _get_camera_position() const;
	Vector3 _get_camera_normal() const;
	Vector3 _get_screen_to_space(const Vector3 &p_vector3);

	void _select_region();
	bool _transform_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only = false);
	void _transform_gizmo_apply(Node3D *p_node, const Transform3D &p_transform, bool p_local);

	void _nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);

	float get_znear() const;
	float get_zfar() const;
	float get_fov() const;

	ObjectID clicked;
	Vector<_RayResult> selection_results;
	bool clicked_wants_append;

	PopupMenu *selection_menu;

	enum NavigationZoomStyle {
		NAVIGATION_ZOOM_VERTICAL,
		NAVIGATION_ZOOM_HORIZONTAL
	};

	enum NavigationMode {
		NAVIGATION_NONE,
		NAVIGATION_PAN,
		NAVIGATION_ZOOM,
		NAVIGATION_ORBIT,
		NAVIGATION_LOOK
	};
	enum TransformMode {
		TRANSFORM_NONE,
		TRANSFORM_ROTATE,
		TRANSFORM_TRANSLATE,
		TRANSFORM_SCALE

	};
	enum TransformPlane {
		TRANSFORM_VIEW,
		TRANSFORM_X_AXIS,
		TRANSFORM_Y_AXIS,

Review comment (suggestion):
This should be given a default value (likely `false`).

Code after:
	Point2 _point_to_screen(const Vector3 &p_point);
	Transform3D _get_camera_transform() const;
	int get_selected_count() const;
	void cancel_transform();

	Vector3 _get_camera_position() const;
	Vector3 _get_camera_normal() const;
	Vector3 _get_screen_to_space(const Vector3 &p_vector3);

	void _select_region();
	bool _transform_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only = false);
	void _transform_gizmo_apply(Node3D *p_node, const Transform3D &p_transform, bool p_local);

	void _nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);
	void _nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative);

	float get_znear() const;
	float get_zfar() const;
	float get_fov() const;

	ObjectID clicked;
	Vector<_RayResult> selection_results;
	bool clicked_wants_append;
	bool selection_in_progress = false;

	PopupMenu *selection_menu;

	enum NavigationZoomStyle {
		NAVIGATION_ZOOM_VERTICAL,
		NAVIGATION_ZOOM_HORIZONTAL
	};

	enum NavigationMode {
		NAVIGATION_NONE,
		NAVIGATION_PAN,
		NAVIGATION_ZOOM,
		NAVIGATION_ORBIT,
		NAVIGATION_LOOK
	};
	enum TransformMode {
		TRANSFORM_NONE,
		TRANSFORM_ROTATE,
		TRANSFORM_TRANSLATE,
		TRANSFORM_SCALE

	};
	enum TransformPlane {
		TRANSFORM_VIEW,
		TRANSFORM_X_AXIS,
Repository: godotengine/godot
File: platform/android/os_android.cpp (C++)

Code before:
		SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop);
		if (scene_tree) {
			scene_tree->quit();
		}
		main_loop->finish();
	}
}

void OS_Android::main_loop_focusout() {
	if (main_loop) {
		main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
	}
	audio_driver_android.set_pause(true);
}

void OS_Android::main_loop_focusin() {
	if (main_loop) {
		main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
	}
	audio_driver_android.set_pause(false);
}

void OS_Android::process_accelerometer(const Vector3 &p_accelerometer) {
	input->set_accelerometer(p_accelerometer);
}

void OS_Android::process_gravity(const Vector3 &p_gravity) {
	input->set_gravity(p_gravity);
}

void OS_Android::process_magnetometer(const Vector3 &p_magnetometer) {
	input->set_magnetometer(p_magnetometer);
}

void OS_Android::process_gyroscope(const Vector3 &p_gyroscope) {
	input->set_gyroscope(p_gyroscope);
}

bool OS_Android::has_touchscreen_ui_hint() const {
	return true;
}

bool OS_Android::has_virtual_keyboard() const {
	return true;
}

int OS_Android::get_virtual_keyboard_height() const {
	return godot_io_java->get_vk_height();
}

void OS_Android::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, bool p_multiline, int p_max_input_length, int p_cursor_start, int p_cursor_end) {

Review comment (suggestion):
Extremely nitpicky but we tend to use C-style cast like this instead:
```suggestion
		godot_io_java->show_vk(p_existing_text, (int)p_type, p_max_input_length, p_cursor_start, p_cursor_end);
```

Code after:
		SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop);
		if (scene_tree) {
			scene_tree->quit();
		}
		main_loop->finish();
	}
}

void OS_Android::main_loop_focusout() {
	if (main_loop) {
		main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
	}
	audio_driver_android.set_pause(true);
}

void OS_Android::main_loop_focusin() {
	if (main_loop) {
		main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
	}
	audio_driver_android.set_pause(false);
}

void OS_Android::process_accelerometer(const Vector3 &p_accelerometer) {
	input->set_accelerometer(p_accelerometer);
}

void OS_Android::process_gravity(const Vector3 &p_gravity) {
	input->set_gravity(p_gravity);
}

void OS_Android::process_magnetometer(const Vector3 &p_magnetometer) {
	input->set_magnetometer(p_magnetometer);
}

void OS_Android::process_gyroscope(const Vector3 &p_gyroscope) {
	input->set_gyroscope(p_gyroscope);
}

bool OS_Android::has_touchscreen_ui_hint() const {
	return true;
}

bool OS_Android::has_virtual_keyboard() const {
	return true;
}

int OS_Android::get_virtual_keyboard_height() const {
	return godot_io_java->get_vk_height();
}

void OS_Android::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, VirtualKeyboardType p_type, int p_max_input_length, int p_cursor_start, int p_cursor_end) {
Repository: godotengine/godot
File: scene/gui/line_edit.cpp (C++)

Code before:
		if (p_enabled) {
			caret_blink_timer->start();
		} else {
			caret_blink_timer->stop();
		}
	}

	draw_caret = true;
}

float LineEdit::cursor_get_blink_speed() const {
	return caret_blink_timer->get_wait_time();
}

void LineEdit::cursor_set_blink_speed(const float p_speed) {
	ERR_FAIL_COND(p_speed <= 0);
	caret_blink_timer->set_wait_time(p_speed);
}

void LineEdit::_reset_caret_blink_timer() {
	if (caret_blink_enabled) {
		draw_caret = true;
		if (has_focus()) {
			caret_blink_timer->stop();
			caret_blink_timer->start();
			update();
		}
	}
}

void LineEdit::_toggle_draw_caret() {
	draw_caret = !draw_caret;
	if (is_visible_in_tree() && has_focus() && window_has_focus) {
		update();
	}
}

void LineEdit::delete_char() {
	if ((text.length() <= 0) || (cursor_pos == 0)) {
		return;
	}

	Ref<Font> font = get_font("font");
	if (font != nullptr) {
		cached_width -= font->get_char_size(pass ? secret_character[0] : text[cursor_pos - 1]).width;
	}

	text.erase(cursor_pos - 1, 1);

	set_cursor_position(get_cursor_position() - 1);


Review comment (suggestion):
Just a style/consistency suggestion (same below):
```suggestion
			OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), (OS::VirtualKeyboardType)virtual_keyboard_type, max_length, selection.begin, selection.end);
```

Code after:
		}
	}

	draw_caret = true;
}

float LineEdit::cursor_get_blink_speed() const {
	return caret_blink_timer->get_wait_time();
}

void LineEdit::cursor_set_blink_speed(const float p_speed) {
	ERR_FAIL_COND(p_speed <= 0);
	caret_blink_timer->set_wait_time(p_speed);
}

void LineEdit::_reset_caret_blink_timer() {
	if (caret_blink_enabled) {
		draw_caret = true;
		if (has_focus()) {
			caret_blink_timer->stop();
			caret_blink_timer->start();
			update();
		}
	}
}

void LineEdit::_toggle_draw_caret() {
	draw_caret = !draw_caret;
	if (is_visible_in_tree() && has_focus() && window_has_focus) {
		update();
	}
}

void LineEdit::delete_char() {
	if ((text.length() <= 0) || (cursor_pos == 0)) {
		return;
	}

	Ref<Font> font = get_font("font");
	if (font != nullptr) {
		cached_width -= font->get_char_size(pass ? secret_character[0] : text[cursor_pos - 1]).width;
	}

	text.erase(cursor_pos - 1, 1);

	set_cursor_position(get_cursor_position() - 1);

	if (align == ALIGN_CENTER || align == ALIGN_RIGHT) {
		scroll_offset = CLAMP(scroll_offset - 1, 0, MAX(text.length() - 1, 0));
	}
Repository: godotengine/godot
File: platform/javascript/js/libs/library_godot_display.js (JavaScript)

Code before:
			GodotDisplayVK.updateSize();
			const elem = multiline ? GodotDisplayVK.textarea : GodotDisplayVK.textinput;
			elem.readonly = false;
			elem.disabled = false;
			elem.value = text;
			elem.style.display = 'block';
			elem.focus();
			elem.setSelectionRange(start, end);
		},
		hide: function () {
			if (!GodotDisplayVK.textinput || !GodotDisplayVK.textarea) {
				return;
			}
			[GodotDisplayVK.textinput, GodotDisplayVK.textarea].forEach(function (elem) {
				elem.blur();
				elem.style.display = 'none';
				elem.value = '';
			});
		},
		updateSize: function () {
			if (!GodotDisplayVK.textinput || !GodotDisplayVK.textarea) {
				return;
			}
			const rect = GodotConfig.canvas.getBoundingClientRect();
			function update(elem) {
				elem.style.left = `${rect.left}px`;
				elem.style.top = `${rect.top}px`;
				elem.style.width = `${rect.width}px`;
				elem.style.height = `${rect.height}px`;
			}
			update(GodotDisplayVK.textinput);
			update(GodotDisplayVK.textarea);
		},
		clear: function () {
			if (GodotDisplayVK.textinput) {
				GodotDisplayVK.textinput.remove();
				GodotDisplayVK.textinput = null;
			}
			if (GodotDisplayVK.textarea) {
				GodotDisplayVK.textarea.remove();
				GodotDisplayVK.textarea = null;
			}
		},
	},
};
mergeInto(LibraryManager.library, GodotDisplayVK);

/*
 * Display server cursor helper.
 * Keeps track of cursor status and custom shapes.
 */

Review comment (suggestion):
As in the `master` PR:
```suggestion
				// Password input mode is being considered in a future spec
				// https://github.com/whatwg/html/issues/4875
				elem.inputmode = 'text';
```

Code after:
			GodotDisplayVK.updateSize();

			let elem = GodotDisplayVK.textinput;
			switch (type) {
			case 0: // KEYBOARD_TYPE_DEFAULT
				elem.type = 'text';
				elem.inputmode = '';
				break;
			case 1: // KEYBOARD_TYPE_MULTILINE
				elem = GodotDisplayVK.textarea;
				break;
			case 2: // KEYBOARD_TYPE_NUMBER
				elem.type = 'text';
				elem.inputmode = 'numeric';
				break;
			case 3: // KEYBOARD_TYPE_NUMBER_DECIMAL
				elem.type = 'text';
				elem.inputmode = 'decimal';
				break;
			case 4: // KEYBOARD_TYPE_PHONE
				elem.type = 'tel';
				elem.inputmode = '';
				break;
			case 5: // KEYBOARD_TYPE_EMAIL_ADDRESS
				elem.type = 'email';
				elem.inputmode = '';
				break;
			case 6: // KEYBOARD_TYPE_PASSWORD
				elem.type = 'password';
				elem.inputmode = '';
				break;
			case 7: // KEYBOARD_TYPE_URL
				elem.type = 'url';
				elem.inputmode = '';
				break;
			default:
				elem.type = 'text';
				elem.inputmode = '';
				break;
			}
			elem.readonly = false;
			elem.disabled = false;
			elem.value = text;
			elem.style.display = 'block';
			elem.focus();
			elem.setSelectionRange(start, end);
		},
		hide: function () {
			if (!GodotDisplayVK.textinput || !GodotDisplayVK.textarea) {
				return;
			}
Repository: godotengine/godot
File: modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs (C#)

Code before:
using System;

namespace Godot
{
    [AttributeUsage(AttributeTargets.Method)]
    public class AnyPeerAttribute : Attribute { }

    [AttributeUsage(AttributeTargets.Method)]
    public class AuthorityAttribute : Attribute { }
}


Review comment (suggestion):
This definition seems to be describing the `AttributeUsage` attribute instead of the `AnyPeerAttribute`.

Code after:
using System;

namespace Godot
{
    /// <summary>
    /// Constructs a new AnyPeerAttribute instance. Members with the AnyPeerAttribute are given authority over their own player.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class AnyPeerAttribute : Attribute { }

    /// <summary>
    /// Constructs a new AuthorityAttribute instance. Members with the AuthorityAttribute are given authority over the game.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class AuthorityAttribute : Attribute { }
}