You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For nested "select type" statements the syntax highlighting in vscode seems off. The code after the first "end select" is not highlighted anymore until the 2nd "end select".
This is an example code
program main
implicit none
type parent
integer:: i
end type
type, extends(parent) :: child
real:: r
end type
class(parent), allocatable :: a, b
allocate (parent :: a, b)
select type (x => a)
type is (parent)
select type (y => b)
class is (parent)
type is (child)
class default
end select
type is (child) ! not highlighted
class default ! not highlighted
end select ! not highlighted
end program
This is the debug output of the language server
$ fortls --debug_parser --debug_filepath=main.f90
Testing parser
File = "main.f90"
Detected format: free
=========
Parser Output
=========
=== No PreProc ===
program main !!! PROGRAM statement(1)
implicit none !!! IMPLICIT statement(2)
type parent !!! TYPE statement(4)
integer :: i !!! VARIABLE statement(5)
end type!!! END "TYPE" scope(6)
type, extends(parent) :: child !!! TYPE statement(8)
real :: r !!! VARIABLE statement(9)
end type!!! END "TYPE" scope(10)
class(parent), allocatable :: a, b !!! VARIABLE statement(12)
selecttype (x => a) !!! SELECT statement(16)
type is (parent) !!! SELECT statement(17)
selecttype (y => b) !!! SELECT statement(18)
class is (parent) !!! SELECT statement(19)
type is (child) !!! SELECT statement(20)
class default !!! SELECT statement(21)
end select!!! END "SELECT" scope(22)
type is (child) ! not highlighted !!! SELECT statement(23)
class default ! not highlighted !!! SELECT statement(24)
end select! not highlighted !!! END "SELECT" scope(25)
end program !!! END "PROGRAM" scope(27)
=========
Object Tree
=========
1: main
4: main::parent
6: main::parent::i
4: main::child
6: main::child::r
6: main::a
6: main::b
10: main::#select1
10: main::#select1::#select2
6: main::#select1::#select2::x
10: main::#select1::#select2::#select3
6: main::#select1::#select2::#select3::x
10: main::#select1::#select2::#select3::#select4
6: main::#select1::#select2::#select3::#select4::y
10: main::#select1::#select2::#select3::#select4::#select5
6: main::#select1::#select2::#select3::#select4::#select5::y
10: main::#select1::#select2::#select3::#select4::#select5::#select6
6: main::#select1::#select2::#select3::#select4::#select5::#select6::y
10: main::#select1::#select7
6: main::#select1::#select7::x
10: main::#select1::#select7::#select8
6: main::#select1::#select7::#select8::x
4: main::parent
6: main::parent::i
4: main::child
6: main::child::r
10: main::#select1
10: main::#select1::#select2
6: main::#select1::#select2::x
10: main::#select1::#select2::#select3
6: main::#select1::#select2::#select3::x
10: main::#select1::#select2::#select3::#select4
6: main::#select1::#select2::#select3::#select4::y
10: main::#select1::#select2::#select3::#select4::#select5
6: main::#select1::#select2::#select3::#select4::#select5::y
10: main::#select1::#select2::#select3::#select4::#select5::#select6
6: main::#select1::#select2::#select3::#select4::#select5::#select6::y
10: main::#select1::#select7
6: main::#select1::#select7::x
10: main::#select1::#select7::#select8
6: main::#select1::#select7::#select8::x
10: main::#select1::#select2
6: main::#select1::#select2::x
10: main::#select1::#select2::#select3
6: main::#select1::#select2::#select3::x
10: main::#select1::#select2::#select3::#select4
6: main::#select1::#select2::#select3::#select4::y
10: main::#select1::#select2::#select3::#select4::#select5
6: main::#select1::#select2::#select3::#select4::#select5::y
10: main::#select1::#select2::#select3::#select4::#select5::#select6
6: main::#select1::#select2::#select3::#select4::#select5::#select6::y
10: main::#select1::#select2::#select3::#select4
6: main::#select1::#select2::#select3::#select4::y
10: main::#select1::#select2::#select3::#select4::#select5
6: main::#select1::#select2::#select3::#select4::#select5::y
10: main::#select1::#select2::#select3::#select4::#select5::#select6
6: main::#select1::#select2::#select3::#select4::#select5::#select6::y
10: main::#select1::#select7
6: main::#select1::#select7::x
10: main::#select1::#select7::#select8
6: main::#select1::#select7::#select8::x
=========
Exportable Objects
=========
1: main
The text was updated successfully, but these errors were encountered:
@PaulXiCao I think what you are experiencing is because the Modern Fortran package has a few bugs when it comes to syntax highlighting. There is a PR open and ready to merge addressing this issue, see fortran-lang/vscode-fortran-support#201
For nested "select type" statements the syntax highlighting in vscode seems off. The code after the first "end select" is not highlighted anymore until the 2nd "end select".
This is an example code
This is the debug output of the language server
The text was updated successfully, but these errors were encountered: