### 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
const String line = get_line(caret_line);
			int caret_col = get_caret_column(i);
			int caret_remove_line = caret_line;
			bool merge_text = true;
			int in_string = is_in_string(caret_line, caret_col);
			if (in_string != -1) {
				Point2 string_end = get_delimiter_end_position(caret_line, caret_col);
				if (string_end.x != -1) {
					merge_text = false;
					caret_remove_line = string_end.y;
					caret_col = string_end.x - 1;
				}
			}
			if (merge_text) {
				for (; caret_col < line.length(); caret_col++) {
					if (is_symbol(line[caret_col])) {
						break;
					}
				}
			}
			
			remove_text(caret_line, get_caret_column(i) - code_completion_base.length(), caret_remove_line, caret_col);
			adjust_carets_after_edit(i, caret_line, caret_col - code_completion_base.length(), caret_remove_line, caret_col);
			set_caret_column(get_caret_column(i) - code_completion_base.length(), false, i);
			insert_text_at_caret(insert_text, i);
		} else {
			
			const String line = get_line(caret_line);
			int caret_col = get_caret_column(i);