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

r_symbol.range = range_of_node(p_func);
	if (is_named) {
		r_symbol.selectionRange = range_of_node(p_func->identifier);
	} else {
		r_symbol.selectionRange.start = r_symbol.selectionRange.end = r_symbol.range.start;
	}
	r_symbol.documentation = p_func->doc_data.description;
	r_symbol.uri = uri;
	r_symbol.script_path = path;
	String parameters;
	for (int i = 0; i < p_func->parameters.size(); i++) {
		const ParameterNode *parameter = p_func->parameters[i];
		if (i > 0) {
			parameters += ", ";
		}
		parameters += String(parameter->identifier->name);
		if (parameter->get_datatype().is_hard_type()) {
			parameters += ": " + parameter->get_datatype().to_string();
		}
		if (parameter->initializer != nullptr) {
			parameters += " = " + parameter->initializer->reduced_value.to_json_string();
		}
	}
	r_symbol.detail += parameters + ")";
	if (p_func->get_datatype().is_hard_type()) {
		r_symbol.detail += " -> " + p_func->get_datatype().to_string();
	}
	List<GDScriptParser::SuiteNode *> function_nodes;
	List<GDScriptParser::Node *> node_stack;
	node_stack.push_back(p_func->body);