Language Server crashes Editor for classes with more static functions than methods
Created by: Razoric480
Godot version: 11d28b2d10f904c8fa1336c5e4c50e952cb5d068
OS/device including version: Windows 10, 10.0.18362
Issue description: When calling generate_script_api from the GDScriptLanguageProtocol's singleton workspace to parse a class that has more static functions than methods (such as a class with nothing but static methods,) Godot will hard crash. Even if it does not crash, the output is wrong.
The reason is that the loop that iterates over static functions is actually calling the class' regular functions array.
Array static_functions;
for (int i = 0; i < p_class->static_functions.size(); ++i) {
static_functions.append(dump_function_api(p_class->functions[i])); //should be static_functions
}
Steps to reproduce:
#StaticFunctionScript.gd
#docstring
static func pure_static():
pass
var symbols: Dictionary = workspace.generate_script_api("res://StaticFunctionScript.gd") #hard crash