Skip to content

Type fields or methods are not detected if spaces are used around % #286

Closed
@hheinzer

Description

Describe the bug
To gfortran, it does not make a difference, if I use spaces around the % operator. However, if I use them, fortls is unable to find the symbol (jump to it's definition).

To Reproduce
In the following program, if you try to jump to the definition of a, it works. If you try to jump to the definition of b, it does not work. The code compiles and runs find, without any error or warnings under gfortran 13.1.1.

program test

    type :: some_type
        integer :: a
        real :: b
    end type some_type

    type(some_type) :: t

    t = some_type(1, 2.0)

    print *, t%a, t % b

end program test

I am using fortls 2.13.0 through neovim lsp. My configuration is

require('lspconfig').fortls.setup({
    on_attach = on_attach,
    flags = lsp_flags,
    capabilities = capabilities,
    cmd = {
        'fortls',
        '--notify_init',
        '--sort_keywords',
        '--lowercase_intrinsics',
        '--hover_signature',
        '--use_signature_help',
    },
})

Expected behavior
The cursor should jump to the definition of b, the same way it does for a.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions