### Godot version

4.0.2

### System information

Windows 11

### Issue description

Double clicking on `$MyNode` in the script editor will select the whole name including the "$".

But double clicking on `%MyNode` (unique name) will select the name but will not include the "%".

Dragging a node from the scene tree into the script editor brings up the property/method hint list, even though a "." has not been typed. Pressing enter appends "new()" even though this makes no sense as there is no period so it is just appending it directly to the node name: `$MyNodenew()`


### Steps to reproduce

Type `%MyNode` in a script and double click on it.

Type `@onready var x =` in a script, drag a node from the scene tree, then press enter.


### Minimal reproduction project

N/A
return (code_completion_active) ? code_completion_current_selected : -1;
}
void CodeEdit::set_code_completion_selected_index(int p_index) {
	if (!code_completion_active) {
		return;
	}
	ERR_FAIL_INDEX(p_index, code_completion_options.size());
	code_completion_current_selected = p_index;
	code_completion_force_item_center = -1;
	queue_redraw();
}
void CodeEdit::confirm_code_completion(bool p_replace) {
	if (!is_editable() || !code_completion_active) {
		return;
	}
	if (GDVIRTUAL_CALL(_confirm_code_completion, p_replace)) {
		return;
	}
	char32_t caret_last_completion_char = 0;
	begin_complex_operation();
	Vector<int> caret_edit_order = get_caret_index_edit_order();
	for (const int &i : caret_edit_order) {
		int caret_line = get_caret_line(i);
		const String &insert_text = code_completion_options[code_completion_current_selected].insert_text;
		const String &display_text = code_completion_options[code_completion_current_selected].display;
		if (p_replace) {