### 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
lines_edited_from = 0;
	lines_edited_to = 9999;
	_text_changed();
}
void CodeEdit::_text_changed() {
	if (lines_edited_from == -1) {
		return;
	}
	int lc = get_line_count();
	line_number_digits = 1;
	while (lc /= 10) {
		line_number_digits++;
	}
	if (theme_cache.font.is_valid()) {
		set_gutter_width(line_number_gutter, (line_number_digits + 1) * theme_cache.font->get_char_size('0', theme_cache.font_size).width);
	}
	lc = get_line_count();
	List<int> breakpoints;
	for (const KeyValue<int, bool> &E : breakpointed_lines) {
		breakpoints.push_back(E.key);
	}
	for (const int &line : breakpoints) {
		if (line < lines_edited_from || (line < lc && is_line_breakpointed(line))) {
			continue;
		}
		breakpointed_lines.erase(line);
		emit_signal(SNAME("breakpoint_toggled"), line);
		int next_line = line + lines_edited_changed;
		if (next_line > -1 && next_line < lc && is_line_breakpointed(next_line)) {