fortran-language-server: preprocessor conditional code causing problems

The following is a valid code excerpt from a project:

#ifndef USE_PYQT
        select case(message%value1)
#else
        select case(message)
#endif

However, it seems fortls is simply ignoring the preprocessor directives and treating the second select case as a nested select, which is causing parsing problems/lot of unexpected end of scope diagnostic errors.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 19 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@emanspeaks Go ahead and upgrade to 1.2.0, it is the most up to date. Also, note that I changed the way preprocessor variables are defined in the .fortls file to a dictionary to allow setting values not just defined/undefined. See the README for more info.