### 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)

case ClassNode::Member::CLASS:
				nested_classes.push_back(dump_class_api(m.m_class));
				break;
			case ClassNode::Member::CONSTANT: {
				Dictionary api;
				api["name"] = m.constant->identifier->name;
				api["value"] = m.constant->initializer->reduced_value;
				api["data_type"] = m.constant->get_datatype().to_string();
				if (const lsp::DocumentSymbol *symbol = get_symbol_defined_at_line(LINE_NUMBER_TO_INDEX(m.constant->start_line))) {
					api["signature"] = symbol->detail;
					api["description"] = symbol->documentation;
				}
				constants.push_back(api);
			} break;
			case ClassNode::Member::ENUM_VALUE: {
				Dictionary api;
				api["name"] = m.enum_value.identifier->name;
				api["value"] = m.enum_value.value;
				api["data_type"] = m.get_datatype().to_string();
				if (const lsp::DocumentSymbol *symbol = get_symbol_defined_at_line(LINE_NUMBER_TO_INDEX(m.enum_value.line))) {
					api["signature"] = symbol->detail;
					api["description"] = symbol->documentation;
				}
				constants.push_back(api);
			} break;
			case ClassNode::Member::ENUM: {
				Dictionary enum_dict;
				for (int j = 0; j < m.m_enum->values.size(); j++) {
					enum_dict[m.m_enum->values[j].identifier->name] = m.m_enum->values[j].value;
				}