Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin fails when using overload interface #95

Open
LecrisUT opened this issue May 2, 2023 · 1 comment
Open

Plugin fails when using overload interface #95

LecrisUT opened this issue May 2, 2023 · 1 comment

Comments

@LecrisUT
Copy link
Contributor

LecrisUT commented May 2, 2023

Issue

When using overload inteface, e.g.

    interface my_func
        module procedure my_funca
        module procedure my_funcb
    end interface my_func

the plugin completely freaks out and cannot locate any other subroutine/interfaces, e.g. cannot jump to any other interface (although can jump to the the main overload interface)

Minimum working example

MWE
module my_mod
    implicit none
    private
    public :: my_func, my_funca, my_funcb, test
    interface my_func
        module procedure my_funca
        module procedure my_funcb
    end interface my_func
    interface
        module subroutine my_funca(a)
            integer, intent(in) :: a
        end subroutine my_funca
        module subroutine my_funcb(a)
            real, intent(in) :: a
        end subroutine my_funcb
        module subroutine test()
        end subroutine test
    end interface
contains
    module procedure my_funca
        print *, 'Debug message'
    end procedure my_funca
    module procedure my_funcb
        print *, 'Debug message'
    end procedure my_funcb
    module procedure test
        print *, 'Debug message'
    end procedure test
end module my_mod

program mwe_fortran_interface
    use my_mod
    implicit none

    integer a
    real b

    call my_funca(a)
    call my_funcb(b)
    call my_func(a)
    call my_func(b)
    call test()
end program

Here I cannot navigate to test, my_funca or my_funcb. What works is my_func though.


Related to: #66

@LecrisUT
Copy link
Contributor Author

LecrisUT commented May 3, 2023

Well navigating this plugin's code is quite challenging. At least I've found a difference when I use interface my_func or not.

is FortranEntityDecl ->
FortranEntityDeclFindUsagesHandler(element, this)
is FortranDataPath ->
FortranDataPathFindUsagesHandler(element, this)

When it works correctly the element is detected as FortranEntityDecl, but with interface my_func it becomes FortranDataPath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant