### 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
code_completion_base = string_to_complete;
	
	if (code_completion_base.is_numeric()) {
		cancel_code_completion();
		return;
	}
	int max_width = 0;
	String string_to_complete_lower = string_to_complete.to_lower();
	for (ScriptLanguage::CodeCompletionOption &option : code_completion_option_sources) {
		option.matches.clear();
		if (single_quote && option.display.is_quoted()) {
			option.display = option.display.unquote().quote("'");
		}
		int offset = option.default_value.get_type() == Variant::COLOR ? line_height : 0;
		if (in_string != -1) {
			String quote = single_quote ? "'" : "\"";
			option.display = option.display.unquote().quote(quote);
			option.insert_text = option.insert_text.unquote().quote(quote);
		}
		if (option.display.length() == 0) {
			continue;
		}
		if (string_to_complete.length() == 0) {
			option.get_option_characteristics(string_to_complete);
			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);
			}
			continue;
		}