hansec / vscode-fortran-ls

Fortran IntelliSense for Visual Studio Code
MIT License
37 stars 7 forks source link

A connection / hover of generic procedure or linked procedure #24

Open jayaus opened 4 years ago

jayaus commented 4 years ago

From the example blow, there are some connection issues.

TYPE T_EX INTEGER :: A = 0

CONTAINS FINAL :: del_EX PROCEDURE, PRIVATE :: sub_a PROCEDURE, PRIVATE :: sub_b PROCEDURE, PRIVATE :: sub_d PROCEDURE, PUBLIC :: sub_sp => sub_c GENERIC, PUBLIC :: sub => sub_a, sub_b GENERIC, PUBLIC :: subsub => sub_d END TYPE T_EX

TYPE(T_EX) :: test CALL test%sub(...)

  1. On del_EX, sub_c, sub_c, subsub, "go to implementation" shows "no implementation found"
  2. At "CALL test%", autocomplete cannot find generic procedures like sub or subsub.
  3. On %sub, a hovering does not work. That is, arguments of subroutine cannot be shown. It would be great to see all the list of subroutines like module procedures in "interface ... end interface".

It would be really appreciated to check some expected functionalities like hovering/autocomplete/go to implementation regarding "generic" procedures.

Thanks.

hansec commented 3 years ago

Thanks for the report and sorry for the delay. Most of these issues are due to the fact that GENERIC and FINAL statements are not yet supported in the underlying Fortran language server. I have created two upstream issues #175 and #176 to track those bugs. I will work on correcting them as soon as possible.

As for sub_c, currently "go to implementation" is only supported for the procedure method (sub_sp in this case) not the bound procedure. Does "go to definition" work for sub_c in your example? It might be good for "go to implementation" to operate as a superset of "go to definition", but I want to look into how this functions for other language servers to stay consistent.