### 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
for (int i = 0; i < get_line_count(); i++) {
		fold_line(i);
	}
	queue_redraw();
}
void CodeEdit::unfold_all_lines() {
	_unhide_all_lines();
}
void CodeEdit::toggle_foldable_line(int p_line) {
	ERR_FAIL_INDEX(p_line, get_line_count());
	if (is_line_folded(p_line)) {
		unfold_line(p_line);
		return;
	}
	fold_line(p_line);
}
bool CodeEdit::is_line_folded(int p_line) const {
	ERR_FAIL_INDEX_V(p_line, get_line_count(), false);
	return p_line + 1 < get_line_count() && !_is_line_hidden(p_line) && _is_line_hidden(p_line + 1);
}
TypedArray<int> CodeEdit::get_folded_lines() const {