Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: #include seems to confuse modern_fortran and leads to false 'error' messages #1161

Open
2 tasks done
tommy-engels opened this issue Dec 7, 2024 · 0 comments
Open
2 tasks done
Labels

Comments

@tommy-engels
Copy link

tommy-engels commented Dec 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

I have tried the Pre-Release of the extension.

  • I have replicated the Issue in the latest Pre-Release

Description

I have modules that look like this:

module fantastic_module
    use other_module

    implicit none

contains

#include "a_routine.f90"

end module

and in other_module, a constant rkis defined and to be used as real kind parameter.

In vscode, if I now edit a_routine.f90, this constant rk and anything else that is imported from other_module is not recognized and reported as error in VS code. Strangely, with the latest version, it now seems to suggest "Possible objects" when hovering with the cursor over the false "error", but it still reports it as errors.

I realize that there is a difference between #include and include("file"), but I need to use the former for other reasons. As this is correct FORTRAN syntax, I don't quite understand why modern_fortran extension has trouble with it.

It is possible that this is a matter of configuration (and the source of the error is on my side of the screen), but frankly even after many attempts I cannot figure out what I need to do. Any help/pointer would be highly appreciated.

Screenshots

Image

Expected Behaviour

It should correctly parse the code and not report thousands of false errors.

Version of Modern Fortran

v3.2.0

Version of Visual Studio Code

1.95.3

Platform and Architecture

linux

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant