fortran-lang / vscode-fortran-support

Fortran language support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran
MIT License
221 stars 30 forks source link

bug(syntax): Syntax Problem between Freeform and Fixedform #1131

Closed zhongxiang117 closed 2 months ago

zhongxiang117 commented 3 months ago

Is there an existing issue for this?

Description

I noticed that "the configuration of the selection language mode" does not work between FortranFreeform and FortranFixedform, if the unusual file extension is used.

For my seeing, the output info for both of them are:

["INFO" - 11:25:36 AM] using linter: gfortran located in: /usr/bin/gfortran
["INFO" - 11:25:36 AM] Linter.arguments:
-Wall
-ffree-line-length-none
-ffixed-line-length-none

It is not correct, instead, for FortranFreeform, the Linter.arguments should be -ffree-form.

Screenshots

image

Code Example

! file should be with extension `.fpp` or any others, but not `.f90`

! shoud be freeform
program test
    print*, 'good'
end

Fortran Version (Free/Fixed Form)

Free Form e.g. F90+

Version of Modern Fortran

v3.2.0

Version of Visual Studio Code

v1.85.0

Platform and Architecture

Linux (Ubuntu)

Additional Information

gfortran version v9.4.0 & v11.4.0

Possible Solution:

Add "builtin" argument -ffree-form when language mode FortranFreeform is selected.

image