### 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
if (index > next_index) {
						Vector<Pair<int, int>> new_matches = subsequence_matches;
						new_matches.push_back({ index, 1 });
						next_subsequence_matches.push_back(new_matches);
					}
				}
			}
			all_possible_subsequence_matches = next_subsequence_matches;
		}
		
		if (all_possible_subsequence_matches.size() > 0) {
			option.matches = all_possible_subsequence_matches[0];
			option.get_option_characteristics(string_to_complete);
			all_possible_subsequence_matches = all_possible_subsequence_matches.slice(1);
			if (all_possible_subsequence_matches.size() > 0) {
				CodeCompletionOptionCompare compare;
				ScriptLanguage::CodeCompletionOption compared_option = option;
				compared_option.clear_characteristics();
				for (Vector<Pair<int, int>> &matches : all_possible_subsequence_matches) {
					compared_option.matches = matches;
					compared_option.get_option_characteristics(string_to_complete);
					if (compare(compared_option, option)) {
						option = compared_option;
						compared_option.clear_characteristics();
					}
				}
			}
			code_completion_options.push_back(option);
			if (theme_cache.font.is_valid()) {
				max_width = MAX(max_width, theme_cache.font->get_string_size(option.display, HORIZONTAL_ALIGNMENT_LEFT, -1, theme_cache.font_size).width + offset);