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

incorrect indication with block as variable or label #292

Open
folk85 opened this issue Jun 17, 2023 · 1 comment
Open

incorrect indication with block as variable or label #292

folk85 opened this issue Jun 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@folk85
Copy link
Contributor

folk85 commented Jun 17, 2023

Describe the bug
If we define the label or variable with name block, then it would indicate end of routine as incorrect end.

To Reproduce
If I use the following command fortls --debug_filepath test_rename_block.f90 --debug_rootpath . --debug_full_result --debug_log I get info:

DEBUG:fortls.constants:REQUEST None None
INFO:fortls.constants:fortls - Fortran Language Server 0.1.dev986+g8f11b57 Initialized

The example of code:

module test_rename_block
    implicit none
contains

    subroutine block_test01()
        integer :: i 
        block: do i = 1, 1 
            write(*, *) "use label with name block : ", i  
        end do block
    end subroutine block_test01

    subroutine block_test02()
        integer :: block 
        do block = 1, 1 
            write(*, *) "use index name block :", block 
        end do
    end subroutine block_test02

end module test_rename_block

program driver
    use test_rename_block 
    implicit none
    call block_test01()
    call block_test02()
end program driver

Expected behavior
If we use variable or label name as block the fortls won't expect end block part and must show end of subroutine/function correctly.

Screenshots & Animations
image

Setup information (please complete the following information):

  • OS: Windows10
  • Python Version Python 3.11.4
  • fortls Version 0.1.dev986+g8f11b57
  • Code editor 1.79.2
  • the Fortran extension for the code editor and its version [Modern Fortran v3.2.0]
@folk85 folk85 added the bug Something isn't working label Jun 17, 2023
@byornski
Copy link

Can confirm this bug. We've hit this with some code with variable names like block_data and it breaks the scoping for every routine after this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants