fortls icon indicating copy to clipboard operation
fortls copied to clipboard

Overloaded functions

Open gnikit opened this issue 2 years ago • 2 comments

From the original repo See: https://github.com/hansec/fortran-language-server/issues/135

The solution that I have in mind is to use the function's/subroutine's signature help (--use_signature_help) to distinguish between different instances of an interface.

  • When typing the function/subroutine name it should show the number of "overloads"
  • When typing the argument list it should be able to filter through the overloads available throughout the project
  • When hovering over the fully typed expression it should show only a single definition, matching to the function/subroutine
  • Ideally we should be able to show the hover message with those little arrows that allow you to navigate between different defs
  • TODO: make sure that the autocomplete of an overloaded interface will autocomplete to the interfaces name and not the name of the function/subroutine chosen from within the interface

gnikit avatar Dec 21 '21 19:12 gnikit

Potential issue related to overloading: https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/22

gnikit avatar Feb 11 '23 16:02 gnikit

Hi @gnikit,

I was going to report this issue, but discovered this GitHub issue. I noticed this feature seemed to be missing; something I took for granted over in CodeBlocks (cbfortran).

I've attached an example that has a slight twist in that I define a class and a generic interface named the same as the class. The interface is to a variety of constructor functions for the class.

Feel free to use. If there is any way I can help, I'd love to.

fortls-overloaded-functions-issue-6.zip

jeffhole avatar Nov 30 '23 17:11 jeffhole