fortls
fortls copied to clipboard
Signature help with nested parentheses displays wrong argument from argument list
Highlighting of current paramter in signature help is broken.
This is happening only when the paramters are provided a way that involves a ,
.
In this case by accessing a value of an array.
subroutine foo(arg1, arg2, arg3)
implicit none
integer(4), intent(in) :: arg1, arg2, arg3
write(*, *) arg1, arg2, arg3
end subroutine foo
subroutine bar()
implicit none
integer(4) :: arr(4, 4)
arr = 0
call foo(arr(2, 3), ...) ! results in the below image, the comma in `arr(2, 3)` is causing the problem
end subroutine bar
This is part of the Signature help feature and I agree it needs work. The problem is that understanding literal nested scopes i.e. [2, 4, 5] or ar(1, 3) is a bit problematic. A while back I fixed this for simple literals (with the exception of complex numbers i think), but nesting them seems to be a big issue.
I have functions that are aimed at figuring these things out but robustly doing so is a bit of an issue.
@gnikit ,
I couldn't reproduce the bug in fortls 2.13.1.dev166+g1f54125
which I install with pip install git+https://github.com/fortran-lang/fortls.git
BUT, it is reproducable in fortls v2.13.0
So, could you advise me how to set unittest or set special flag to see both lines ( vriable and argument)?
@folk85 you can trigger the signature help, when you are typing the arguments of a function/subroutine and press ,
. You would then be able to see the procedure's signature, and what argument you are meant to be typing.
Yes, i see the signature help during typing, but i could not understand how generate unittest for this bug in dev build
Might want to have a look here to get some ideas https://github.com/fortran-lang/fortls/blob/master/test/test_server_signature_help.py