### Godot version

4.0.2

### System information

Ubuntu 22.04.1 LTS

### Issue description

So far I've found these ones:

![Screenshot from 2023-05-10 17-56-42](https://github.com/godotengine/godot/assets/85438892/b161b14a-cb7d-46fe-8398-816bf354a929)
![Screenshot from 2023-05-10 18-01-02](https://github.com/godotengine/godot/assets/85438892/b0fefcfb-4246-4ebb-ae7b-dd798d7a1d63)

But there are likely more like them. They are invalid, at least in the context I encountered them here (at the beginning of a regular line of script)

### Steps to reproduce

Type `Anchor` in the code editor.

### Minimal reproduction project

N/A
}
			StringName class_name = native_type.native_type;
			if (!ClassDB::class_exists(class_name)) {
				break;
			}
			bool use_type_hint = EditorSettings::get_singleton()->get_setting("text_editor/completion/add_type_hints").operator bool();
			List<MethodInfo> virtual_methods;
			ClassDB::get_virtual_methods(class_name, &virtual_methods);
			{
				
				MethodInfo static_init("_static_init");
				static_init.return_val.type = Variant::NIL;
				static_init.flags |= METHOD_FLAG_STATIC | METHOD_FLAG_VIRTUAL;
				virtual_methods.push_back(static_init);
			}
			for (const MethodInfo &mi : virtual_methods) {
				String method_hint = mi.name;
				if (method_hint.contains(":")) {
					method_hint = method_hint.get_slice(":", 0);
				}
				method_hint += "(";
				if (mi.arguments.size()) {
					for (int i = 0; i < mi.arguments.size(); i++) {
						if (i > 0) {
							method_hint += ", ";
						}
						String arg = mi.arguments[i].name;
						if (arg.contains(":")) {
							arg = arg.substr(0, arg.find(":"));
						}