You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings aren't found by the language server, when all arguments are spread over multiple lines.
Default parameters that are a variable, aren't displayed with a type in the returned documentation.
The documentation returned for .new() calls, is the one from GDScript.new(). This is useless, instead it should be the documentation from the _init() in the instantiated class. Or how else are you supposed to know what parameters the constructor takes?
Steps to reproduce
I'm using neovim with lspconfig, but i don't think that has anything to do with the documentation returned by the godot language server.
1.
# test docstringfunctest(a : int, b := [], c:= defaults) ->void:
works
func test(a: int, b: Array, c) -> null
test docstring
# test docstringfunctest(a : int,
b := [],
c:= defaults
) ->void:
works
func test(a: int, b: Array, c) -> null
test docstring
BUT
# test docstringfunctest(
a : int,
b := [],
c:= defaults
) ->void:
doesn't return the docstring any longer. This is especially unfortunate, because gdformat from the gdtoolkit (the only gdscript formater i found) formats long function definitions like this.
functest(a : int, b := [], c:= defaults) ->void:
gives func test(a: int, b: Array, c) -> null as documentation returned by the language server.
However defaults is a Dictionary with inferred type, so it should be possible to at least display the type. But displaying the default values as well would be really nice i think.
Node.new()
Hover gives me this:
func GDScript.new(...) -> Variant
Returns a new instance of the script.
For example:
var MyClass = load("myclass.gd")var instance = MyClass.new()assert(instance.get_script() == MyClass)func NativeScript.new(...) -> Variant
Constructs a new object of the base type with a script of this type already attached.
*Note*: Any arguments passed to this function will be ignored and not passed to the native constructor function. This will change with in a future API extension.
func PluginScript.new(...) -> Variant
Returns a new instance of the script.
Function signature this:
func GDScript.new(...) -> Variant
────────────────────────────────────────────
func GDScript.new(...) -> Variant
Returns a new instance of the script.
For example:
var MyClass = load("myclass.gd")var instance = MyClass.new()assert(instance.get_script() == MyClass)
Thanks a lot for the great work <3
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
Correction: 2 is fixed in 4.0 as far as showing the variable type for the default variable, but it doesn't show that there's a variable in it (and in fact reports it as null, which is wrong.)
I've issued fixes to 1 and 3. I'm not sure where to start to fix 2, however, as it's outside the scope of the LSP and into the GDScript parser proper.
Godot version
3.3.2.stable
System information
Ubuntu 20.04, Intel HD graphics, GLES3
Issue description
EDIT: Added 3.
Steps to reproduce
I'm using neovim with lspconfig, but i don't think that has anything to do with the documentation returned by the godot language server.
1.
works
works
BUT
doesn't return the docstring any longer. This is especially unfortunate, because gdformat from the gdtoolkit (the only gdscript formater i found) formats long function definitions like this.
gives
func test(a: int, b: Array, c) -> null
as documentation returned by the language server.However
defaults
is a Dictionary with inferred type, so it should be possible to at least display the type. But displaying the default values as well would be really nice i think.Hover gives me this:
Function signature this:
Thanks a lot for the great work <3
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: