Skip to content

Pre Release

gnikit edited this page Oct 26, 2022 · 1 revision

What's New (PRE RELEASE)

πŸŽ‰ Modern Fortran Release Nightly πŸŽ‰!

Linter

fypp support

Adds some initial support for fypp when using gfortran. More compilers will follow soon!

image

Improved diagnostics for GNU Fortran

Added support for parsing plain text diagnostics from gfortran v11+ thus allowing the display of multiline diagnostics

module err_mod
    private
    implicit none   ! <- Error here previously not shown
    contains
        subroutine foo(arg1, arg2)
            integer, intent(in) :: arg1, arg2
            print*, 'arg1:', arg1, 'arg2:', arg2
        end subroutine foo
        subroutine proc_with_err()
            call foo()
        end subroutine proc_with_err
end module err_mod

image

LFortran Linter support

The LFortran linter is now available in the extension. It can be enabled by setting the fortran.linter.compiler setting to lfortran.

Persistent Cache

By default, now the linter uses a unique VS Code, workspace specific persistent cache directory to store all output files generated by the linter. This should prevent any unexpected behaviour where the linter produces unwanted .mod files that are then picked up by the build system.

You can clean the cache by running the Fortran: Clean Linter generated files command, see Commands for more details.

Commands

A series of new commands have been added, see New Commands section for more details.

  • Fortran: Initialize Fortran Linter
  • Fortran: Clean Linter generated files
  • Fortran: Clean All Linter Diagnostics

User Interface (UI)

Run and Debug individual files

You can now run and debug individual files. This is useful for debugging small snippets of code. To do this, right-click on the file and select Run File or Debug File from the context menu.

Log Channel improvements

The Modern Fortran log channel has had a small revamp. Logs are now colourized to make reading them easier

image

Setting verbosity level

You can now choose the verbosity level of the extension by setting the following option in the settings

{
  "fortran.logging.level": "Error"
}

Added Fortran Logo icon

Added a new icon for the Fortran Language files

image

Added relative path resolution for fortls and formatters

It is now possible to define the path to fortls or the formatters using relative paths to the top-most workspace folder.

"fortran.fortls.path": "./venv/bin/fortls"

Added variable resolution support for fortls

Previously, internal VS Code variables like ${workspaceFolder} were not resolved when defining the path to fortls. This has now been fixed.

"fortran.fortls.path": "${workspaceFolder}/venv/bin/fortls"

Added fpm.toml schema validation

Leveraging the support for schemas from the Even Better TOML extension, Modern Fortran now provides a schema for fpm.toml file validation and autocompletion.

fpm-toml-validation

Improved Installation of dependencies using VS Code Tasks

The extension dependencies are now installed using Visual Studio Code's Tasks. That means that the commands are run from within the VS Code terminal, inheriting any environment variables already present. Particularly useful when using Python virtual environments.

New Commands

A series of new commands have been added for the linter

Fortran: Initialize Fortran Linter

Runs a naive mock compilation of all the Fortran source files found in the project in order to generate the .mod and .smod files necessary for the linter. This also generates all the Diagnostics for the project.

Fortran: Clean Linter generated files

Cleans all the .mod and .smod files generated by the linter that are placed in the persistent cache storage of VS Code for this workspace.

Fortran: Clean All Linter Diagnostics

Cleans all the diagnostics generated by the linter.

New Settings

Hide Release Notes fortran.notifications.releaseNotes

Hide release notes when the extension in being installed or updated.

"fortran.notifications.releaseNotes": true

Linter Initialization fortran.linter.initialize

An option, by default true that will attempt to initialize the linter with all the Fortran source files found in the workspace upon the extension activation.

Performs the same task as the Fortran: Initialize Fortran Linter command.

Cleaning Diagnostics fortran.experimental.keepInitDiagnostics

An option to keep or discard all the diagnostics generated by running the initialization process of the linter.

Log Channel Verbosity fortran.logging.level

An option to set the verbosity level of the extension log channel.

Other Changes

Improved performance of the linter

Converted the linter into using asynchronous processes, which should improve the overall performance and responsiveness of the diagnostics.

Update native symbol provider

The native symbol provider (one used when fortls is not present) has been updated to use the new VS Code API.

Changed Linter glob resolution module to glob from fast-glob

The fast-glob module was causing issues with the linter when using the ** glob pattern. The parent directory would not be included in the results see, https:/mrmlnc/fast-glob/issues/47.

This was problematic since users had to define the include directories twice, once with the glob pattern and once without it. We have switched to the glob, which is slower but does not suffer from this issue.

The cache used by the linter should help mitigate any performance issues.

πŸ› Bug Fixes πŸ›

  • Fixed bug where the linter's internal cache directory would not always exist (#698)