Getting red squiggly lines full of screen with vscode

When I was reviewing the code of CP2K with vscode, I encounter the the display error full of screen, and this is a screen shot of my problem: in the post
And this is my settings.json file screenshot: in the post
Thank you so much if you can help me!

The red lint lines are trying to tell you that only numeric statement numbers are allowed in columns 2-6 of a fixed format Fortran source file, where you have written USE. You are writing free format Fortran, but your file has extension .F, which is assumed to be fixed format by most compilers, and apparently by the linter you’re using.

You can change the file extension to .F90 or configure the linter to assume your file is free format.

1 Like

@Machalot is right on the money, but there is an easier solution that changing your sources.
Just set VS Code to parse .F as Free Form. Your current settings are slightly incorrect

  "files.associations": {
    "*.F": "FortranFreeForm",
  },

Also, fortls will parse .f77 by default see, you don’t have to specify anything. It will also parse each file and determine if it is fixed or free form so you also don’t have to worry about that either.

2 Likes

Thank you so, it did work!

1 Like

Thank you so much, I have put this line in my settings.json, but it seems not to work. The red hints still persist.