fortran-language-server icon indicating copy to clipboard operation
fortran-language-server copied to clipboard

Support for implicit types?

Open hckiang opened this issue 4 years ago • 0 comments

Hi, I am currently working on a project which uses a lot of old-style implicit variable types. For example:

module oumods
  use, intrinsic :: iso_c_binding
  implicit integer(c_int) (i-k), integer(c_int) (m,n), &
       & real(c_double) (a-h), real(c_double) (l), real(c_double) (o-z)
contains
  subroutine zI12(t,c,alpha,beta,r)
    complex(c_double_complex) c,r,    x,y,z
     z = c*t
     y = exp(z)
     x = (2.0_c_double * cosh((z - cmplx(0._c_double,3.14159265358979324_c_double, kind(1._c_double))) &
          & /2._c_double )) / (c / exp((z + cmplx(0._c_double,3.14159265358979324_c_double,kind(1._c_double)))/2._c_double))
     r = beta*r+alpha*((t*y - x)/c)
  end subroutine
end module

Currently the server seems unable to tell the type of variables t, alpha and beta.

I know ideally I should simply add explicit type declarations, but the existing code base is pretty large and complex so I'd rather not mess with it too much... It would be an very useful feature for the IDE to be able to display the types of them so the programmer doesn't need to "mentally calculate" the types.

hckiang avatar Jul 02 '21 12:07 hckiang