fortls icon indicating copy to clipboard operation
fortls copied to clipboard

incorrect indication with `block` as variable or label

Open folk85 opened this issue 1 year ago • 0 comments

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 avatar Jun 17 '23 10:06 folk85