### 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
line_folding_enabled = p_enabled;
	_set_hiding_enabled(p_enabled);
}
bool CodeEdit::is_line_folding_enabled() const {
	return line_folding_enabled;
}
bool CodeEdit::can_fold_line(int p_line) const {
	ERR_FAIL_INDEX_V(p_line, get_line_count(), false);
	if (!line_folding_enabled) {
		return false;
	}
	if (p_line + 1 >= get_line_count() || get_line(p_line).strip_edges().size() == 0) {
		return false;
	}
	if (_is_line_hidden(p_line) || is_line_folded(p_line)) {
		return false;
	}
	
	int in_comment = is_in_comment(p_line);
	int in_string = (in_comment == -1) ? is_in_string(p_line) : -1;
	if (in_string != -1 || in_comment != -1) {
		if (get_delimiter_start_position(p_line, get_line(p_line).size() - 1).y != p_line) {
			return false;