### 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
}
				}
			}
			bool code_completion_below = false;
			if (caret_visible && code_completion_active && code_completion_options.size() > 0) {
				const int code_completion_options_count = code_completion_options.size();
				const int lines = MIN(code_completion_options_count, theme_cache.code_completion_max_lines);
				const Size2 icon_area_size(row_height, row_height);
				code_completion_rect.size.width = code_completion_longest_line + theme_cache.code_completion_icon_separation + icon_area_size.width + 2;
				code_completion_rect.size.height = lines * row_height;
				const Point2 caret_pos = get_caret_draw_pos();
				const int total_height = theme_cache.code_completion_style->get_minimum_size().y + code_completion_rect.size.height;
				const bool can_fit_completion_above = (caret_pos.y - row_height > total_height);
				const bool can_fit_completion_below = (caret_pos.y + row_height + total_height <= get_size().height);
				if (!can_fit_completion_below && can_fit_completion_above) {
					code_completion_rect.position.y = (caret_pos.y - total_height - row_height) + theme_cache.line_spacing;
				} else {
					code_completion_rect.position.y = caret_pos.y + (theme_cache.line_spacing / 2.0f);
					code_completion_below = true;
				}
				const int scroll_width = code_completion_options_count > theme_cache.code_completion_max_lines ? theme_cache.code_completion_scroll_width : 0;
				const int code_completion_base_width = theme_cache.font->get_string_size(code_completion_base, HORIZONTAL_ALIGNMENT_LEFT, -1, theme_cache.font_size).width;
				if (caret_pos.x - code_completion_base_width + code_completion_rect.size.width + scroll_width > get_size().width) {
					code_completion_rect.position.x = get_size().width - code_completion_rect.size.width - scroll_width;
				} else {
					code_completion_rect.position.x = caret_pos.x - code_completion_base_width;
				}
				draw_style_box(theme_cache.code_completion_style, Rect2(code_completion_rect.position - theme_cache.code_completion_style->get_offset(), code_completion_rect.size + theme_cache.code_completion_style->get_minimum_size() + Size2(scroll_width, 0)));
				if (theme_cache.code_completion_background_color.a > 0.01) {
					RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(code_completion_rect.position, code_completion_rect.size + Size2(scroll_width, 0)), theme_cache.code_completion_background_color);