### 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
} else if (cofs > 0 && line[cofs - 1] == ' ') {
		int ofs = cofs - 1;
		while (ofs > 0 && line[ofs] == ' ') {
			ofs--;
		}
		prev_is_word = !is_symbol(line[ofs]);
		
	} else {
		int start_cofs = cofs;
		while (cofs > 0 && line[cofs - 1] > 32 && (line[cofs - 1] == '/' || !is_symbol(line[cofs - 1]))) {
			cofs--;
		}
		string_to_complete = line.substr(cofs, start_cofs - cofs);
	}
	
	
	bool prev_is_prefix = false;
	if (cofs > 0 && code_completion_prefixes.has(line[cofs - 1])) {
		prev_is_prefix = true;
	} else if (cofs > 1 && line[cofs - 1] == ' ' && code_completion_prefixes.has(line[cofs - 2])) {
		prev_is_prefix = true;
	}
	if (!prev_is_word && string_to_complete.is_empty() && (cofs == 0 || !prev_is_prefix)) {
		cancel_code_completion();
		return;
	}
	
	
	bool single_quote = in_string != -1 && first_quote_col > 0 && delimiters[in_string].start_key == "'";
	code_completion_options.clear();