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

}
				} else {
					value_text = default_value.to_json_string();
				}
				if (!value_text.is_empty()) {
					symbol.detail += " = " + value_text;
				}
				r_symbol.children.push_back(symbol);
			} break;
			case ClassNode::Member::SIGNAL: {
				lsp::DocumentSymbol symbol;
				symbol.name = m.signal->identifier->name;
				symbol.kind = lsp::SymbolKind::Event;
				symbol.deprecated = false;
				symbol.range = range_of_node(m.signal);
				symbol.selectionRange = range_of_node(m.signal->identifier);
				symbol.documentation = m.signal->doc_data.description;
				symbol.uri = uri;
				symbol.script_path = path;
				symbol.detail = "signal " + String(m.signal->identifier->name) + "(";
				for (int j = 0; j < m.signal->parameters.size(); j++) {
					if (j > 0) {
						symbol.detail += ", ";
					}
					symbol.detail += m.signal->parameters[j]->identifier->name;
				}
				symbol.detail += ")";
				for (GDScriptParser::ParameterNode *param : m.signal->parameters) {
					lsp::DocumentSymbol param_symbol;
					param_symbol.name = param->identifier->name;