Skip to content

VScode+fortls: #include not recongnized #495

@tommy-engels

Description

@tommy-engels

I have a problem that seems to be benign, yet I could not figure out the solution myself.

My FORTRAN code uses

#include "file.f90"

directives, rather than the fortran-build-in

include("file.f90")

because the latter does not feature preprocessor directives.
However, if I open the code in visual studio code, I get many "problem" messages that are related to fortls not understanding these include statements.

In particular, I have a module:

module hello
...
integer :: global_variable
...
#include "file.f90"
...
end module

and if I edit the file file.f90, VS studio complains that global_variable is not defined in the file.

I believe that fortls should be capable of dealing with this, but it seems that this feature is not implemented or a bug prevents it from working correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions