### 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
Vector2(end - begin, font_height));
						draw_rect(highlight_rect, theme_cache.code_hint_color * Color(1, 1, 1, 0.2));
					}
					yofs += theme_cache.line_spacing;
				}
			}
		} break;
	}
}
void CodeEdit::_update_theme_item_cache() {
	TextEdit::_update_theme_item_cache();
	
	theme_cache.code_folding_color = get_theme_color(SNAME("code_folding_color"));
	theme_cache.can_fold_icon = get_theme_icon(SNAME("can_fold"));
	theme_cache.folded_icon = get_theme_icon(SNAME("folded"));
	theme_cache.folded_eol_icon = get_theme_icon(SNAME("folded_eol_icon"));
	theme_cache.breakpoint_color = get_theme_color(SNAME("breakpoint_color"));
	theme_cache.breakpoint_icon = get_theme_icon(SNAME("breakpoint"));
	theme_cache.bookmark_color = get_theme_color(SNAME("bookmark_color"));
	theme_cache.bookmark_icon = get_theme_icon(SNAME("bookmark"));
	theme_cache.executing_line_color = get_theme_color(SNAME("executing_line_color"));
	theme_cache.executing_line_icon = get_theme_icon(SNAME("executing_line"));
	theme_cache.line_number_color = get_theme_color(SNAME("line_number_color"));
	
	theme_cache.code_completion_style = get_theme_stylebox(SNAME("completion"));
	theme_cache.code_completion_icon_separation = get_theme_constant(SNAME("h_separation"), SNAME("ItemList"));
	theme_cache.code_completion_max_width = get_theme_constant(SNAME("completion_max_width"));
	theme_cache.code_completion_max_lines = get_theme_constant(SNAME("completion_lines"));
	theme_cache.code_completion_scroll_width = get_theme_constant(SNAME("completion_scroll_width"));
	theme_cache.code_completion_scroll_color = get_theme_color(SNAME("completion_scroll_color"));