### Godot version

v4.1.2.rc.custom_build [f2c8eea60]

### System information

Godot v4.1.2.rc (f2c8eea60) - Arch Linux #1 SMP PREEMPT_DYNAMIC Wed, 06 Sep 2023 21:01:01 +0000 - Wayland - Vulkan (Compatibility) - AMD Radeon Graphics (renoir, LLVM 16.0.6, DRM 3.54, 6.5.2-arch1-1) () - AMD Ryzen 5 4600H with Radeon Graphics (12 Threads)

### Issue description

I am trying to use the `GDScriptLanguageProtocol` singleton in order to generate API documentation for my project and was able to track down a bug where the engine will crash when dumping the script api from a script with two signals, where one signal had one or more signal arguments:

E.g.
```gdscript
extends Node

## Signal with no argument
signal bar
## Signal with argument
signal foo(arg1: String)
```

Tracking this down, it appears that `i` is being used when it should be `j` in `gdscript_extend_parser.cpp`:
https://github.com/godotengine/godot/blob/3ed4497113fa10611b90290ce22a751fb9d26e2e/modules/gdscript/language_server/gdscript_extend_parser.cpp#L974-L976

I can provide a simple follow-up PR to resolve this issue.

### Steps to reproduce

Create a script that has 2 signals, and one contains arguments:

**with_signals.gd**
```gdscript
extends Node

## Signal with no argument
signal bar
## Signal with argument
signal foo(arg1: String)
```

Create a script that will use the `GDScriptLanguageProtocol` singleton to dump the script api:

**docs.gd**
```gdscript
@tool
extends SceneTree

func _init() -> void:
        get_reference("res://with_signals.gd")


## Parses a list of GDScript files and returns a list of dictionaries with the
## code reference data.
func get_reference(file: String) -> Dictionary:
        var workspace = Engine.get_singleton('GDScriptLanguageProtocol').get_workspace()
        workspace.parse_local_script(file)
        var symbols: Dictionary = workspace.generate_script_api(file)
        return symbols
```

Run the script to dump the script api documentation:

```bash
godot \
        --editor \
        --path $(pwd) \
        --quit \
        --headless \
        --script res://docs.gd
```

### Minimal reproduction project

[docs-bug.zip](https://github.com/godotengine/godot/files/12592238/docs-bug.zip)

Dictionary class_api;
	ERR_FAIL_NULL_V(p_class, class_api);
	class_api["name"] = p_class->identifier != nullptr ? String(p_class->identifier->name) : String();
	class_api["path"] = path;
	Array extends_class;
	for (int i = 0; i < p_class->extends.size(); i++) {
		extends_class.append(String(p_class->extends[i]->name));
	}
	class_api["extends_class"] = extends_class;
	class_api["extends_file"] = String(p_class->extends_path);
	class_api["icon"] = String(p_class->icon_path);
	if (const lsp::DocumentSymbol *symbol = get_symbol_defined_at_line(LINE_NUMBER_TO_INDEX(p_class->start_line))) {
		class_api["signature"] = symbol->detail;
		class_api["description"] = symbol->documentation;
	}
	Array nested_classes;
	Array constants;
	Array class_members;
	Array signals;
	Array methods;
	Array static_functions;
	for (int i = 0; i < p_class->members.size(); i++) {
		const ClassNode::Member &m = p_class->members[i];
		switch (m.type) {