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

}
				api["arguments"] = pars;
				if (const lsp::DocumentSymbol *symbol = get_symbol_defined_at_line(LINE_NUMBER_TO_INDEX(m.signal->start_line))) {
					api["signature"] = symbol->detail;
					api["description"] = symbol->documentation;
				}
				signals.push_back(api);
			} break;
			case ClassNode::Member::FUNCTION: {
				if (m.function->is_static) {
					static_functions.append(dump_function_api(m.function));
				} else {
					methods.append(dump_function_api(m.function));
				}
			} break;
			case ClassNode::Member::GROUP:
				break; 
			case ClassNode::Member::UNDEFINED:
				break; 
		}
	}
	class_api["sub_classes"] = nested_classes;
	class_api["constants"] = constants;
	class_api["members"] = class_members;
	class_api["signals"] = signals;
	class_api["methods"] = methods;
	class_api["static_functions"] = static_functions;
	return class_api;
}
Dictionary ExtendGDScriptParser::generate_api() const {