### Godot version

Godot 4.0.1.stable

### System information

Windows 10, Forward+

### Issue description

Example code:

```gdscript
@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):
```

the warning is ignored by pressing [ignore] in the warnings panel.

pressing it multiple times results in:
```gdscript
@warning_ignore("shadowed_global_identifier", "shadowed_global_identifier")
```


### Steps to reproduce

Shadowing a global function with a method of script:

```gdscript
@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):
```


### Minimal reproduction project

```gdscript
@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):
    pass
```
AnnotationNode *last_annotation = annotation_stack.back()->get();
		if (last_annotation->applies_to(p_target)) {
			annotations.push_front(last_annotation);
			annotation_stack.pop_back();
		} else {
			push_error(vformat(R"(Annotation "%s" cannot be applied to a %s.)", last_annotation->name, p_member_kind));
			clear_unused_annotations();
		}
#ifdef TOOLS_ENABLED
		if (last_annotation->start_line == doc_comment_line) {
			doc_comment_line--;
		}
#endif 
	}
	T *member = (this->*p_parse_function)(p_is_static);
	if (member == nullptr) {
		return;
	}
	for (AnnotationNode *&annotation : annotations) {
		member->annotations.push_back(annotation);
	}
#ifdef TOOLS_ENABLED
	
	class_doc_line = MIN(class_doc_line, doc_comment_line - 1);
	
	if (has_comment(previous.start_line, true)) {
		member->doc_description = get_doc_comment(previous.start_line, true);
	} else if (has_comment(doc_comment_line, true)) {
		if constexpr (std::is_same_v<T, ClassNode>) {
			get_class_doc_comment(doc_comment_line, member->doc_brief_description, member->doc_description, member->doc_tutorials, true);