Modern Fortran Release v3.1.0 is finally out!
You will note that we had to release v3.1.0 instead of v3.0.0, due to some semver ordering issues.
- If you like the extension consider leaving a VS Marketplace review
- If you have any questions about the extension feel free to open a Q&A in our Discussion Board
- If you want to get involved feel free to reach out to me, either here or on GitHub. General Contributing instructions can be found here
A summary of the changes can be found below:
What’s New
Linting
The linting diagnostics have been improved, with supported being added for
the Intel’s compilers, allowing custom compiler root paths and additional
diagnostic messages such as preprocessor warnings.
Intel OneAPI compilers
Intel compilers are now supported set the following options in settings.json:
{
"fortran.linter.compiler": "ifort",
"fortran.linter.compilerPath": "/path/to/intel/compilers/bin/ifort" // or ifx
}
Preprocessor warnings
Preprocessor warnings and errors are now properly supported during linting
Language Server fortls
A lot of the higher level features like Hover, Go-To, Peeking definitions and
finding References are provided by Language Servers. Modern Fortran now natively
supports the fortls
Language Server.
Modern Fortran will prompt you to install fortls
with pip
upon initialization if
not detected in your system.
You can select a custom path to a fortls
installation by setting the setting
{
"fortran.fortls.path": "/path/to/fortls"
}
Some options for fortls
have explicit settings through Modern Fortran settings,
like fortran.fortls.notifyInit
and fortran.fortls.incrementalSync
. You can
find a complete list of the explicit options in the Feature Contributions
tab
of the Modern Fortran extension.
In case there is no explicit setting for a fortls
option, you can pass the
option to fortls
through
{
"fortran.fortls.extraArgs": ["--nthreads=8", "--autocomplete_name_only"]
}
For more information about fortls
configuration options see the
fortls
Documentation
Multi Workspace and Single file support
It is now possible to have Language Server support with fortls
for multiple
workspaces and single files. Simply open a standalone Fortran file and fortls
or add a
folder to the workspace.
Configuration file watcher
There are 2 ways of passing options to fortls
either through the VS Code
settings.json
or through the fortls
configuration file.
fortls
is listening for changes on both types of files and will pass them to the server
without having to restart.
Warning: This feature is experimental if changes do not take effect you
can always restartfortls
through the Command Palette.
Commands
Two convenience commands have been added, accessible from the Command Palette with
the prefix Fortran:
- Fortran: Restart the Fortran Language Server
- Fortran: Rescan Linter paths
Debug Hovering
Debugging functionality was previously limited when it came to nested
user-defined types and hovering. This issue has been resolved and full
information about an object can be shown in the hover messages while debugging.
Deprecations
Visual Studio Code Extensions
Due to the plethora of changes to the Modern Fortran extension the following
VS Code extensions are redundant and no longer compatible with Modern Fortran:
-
FORTRAN IntelliSense: provided an interface for a now deprecated Language Server. It has been superseeded by
fortls
nad its native integration with Modern Fortran. - Fortran Breakpoint Support: is redundant and deprecated, Modern Fortran has native breaking point support.
- fortran: is redundant and deprecated, Modern Fortran has native support for Syntax Highlighting.
- External Formatters like vscode-modern-fortran-formatter are redundant and deprecated, Modern Fortran has native formatter support for
fprettify
andfindent
.
Visual Studio Code Settings
The following settings have been deprecated are replaced by the following:
-
includePaths
in favour oflinter.includePaths
-
gfortranExecutable
in favour oflinter.compilerPath
-
linterEnabled
in favour oflinter.compiler == Disabled
-
linterExtraArgs
in favour oflinter.extraArgs
-
linterModOutput
in favour oflinter.modOutput
-
ProvideSymbols
in favour ofprovide.symbols
symbols
-
provideHover
in favour ofprovide.hover
-
provideCompletion
in favour ofprovide.autocomplete
Other
There are a number of other bug fixes, feature enhancements and minor
improvements that have taken place in both the extension and the syntax highlighting. A brief list is shown below:
- Changed need for matching begin-end scope names, in the following constructs:
Functions, Modules, Programs, Module Procedures, Subroutines, Submodules.
For a more detailed explanation as to why see the issue
(#278) - Changed
linter.compilerPath
to use the full path to the compiler instead of the root
(#500) - Merged Language Server’s log channel to Modern Fortran’s log channel
- Fixed
error stop variable
syntax highlighting
(#486) - Fixed issue with linter cache containing outdated folders
(#464) - Fixed slow performance of very long lines by using a different solution for
(#207)
(#309) - Fixes linter activation from
Disabled
to some compilerX
without having
to restart the extension
(#296) - Fixes nopass pointer erroneous syntax highlighting
(#318) - Fixes
%
accessor highlighting for type-bound subroutines
(#325) - Fixes
fortls
not spawning whenignoreWarning
was set to true
(#365) - Fixes formatting on Windows (needed .exe extension)
(#354) - Fixes
onSave
formatting errors
(#364)