VS Code Modern Fortran v3.0.X final Pre-Release

I am mostly done with v3.0 of Modern Fortran for VS Code. I have gone ahead and released a Pre-Release version (with our old publisher ID krvajalm, probably for the last time) for people to test. There will be an official release memo when v3.0 comes out, but nonetheless here is a summary of the main changes:

  • Added native integration with language server fortls. Allowing for access to all fortls’ options through the VS Code settings. The settings are in constant sync with the language server so changes can be propagated to server without needing to restart VS Code.
  • Added the option to restart the language server from the command pallet
  • Added single file support and multi-root workspace support with the language server.

IMPORTANT:
By default the language server will detect and then parse ALL Fortran files from the root directory. The root directory in VS Code is the directory where VS Code is opened from; in Linux and Mac the default dir is usually $HOME.

This means that if you open an empty VS Code instance and then open a single Fortran file, the language server will scan and parse your entire $HOME, which is terribly slow and very memory intensive.

There are ways to circumvent this, like setting in your settings.json

   "fortran.fortls.extraArgs": ["--source_dirs", "."],

but I am still looking for more elegant solutions that would not affect file autodiscovery in existing projects.

  • Added Linting support for Intel’s ifort
  • Fixed a critical bug that caused VS Code to crash if a line contained more than +1k characters
  • Fixed bugs on Windows that would cause our formatters to fail
  • Fixed hovering messages while debugging nested user defined variables e.g. foo%bar%dummy hovering over bar and dummy will now yield the correct output whilst debugging.

I also updated the README and the logos of the extension to match Fortran Langs style.

There are still a few minor things that need to be added like a walkthrough and some minor bug fixes, but I think in general v3.0 is mostly done. The new version will be the first release under our new publisher ID, the change should be flawless for the end user but do not be alarmed if you see fortran-lang instead of krvajalm in your extension manifest.

Have a go at the pre-Release. Let me know either here or on GitHub if you come across any bugs or if there are any features that you would like to see being added in the future.

8 Likes

Note, when I switch to pre-release, I get this warning:

Deprecated settings have been detected in your settings. 
Please update your settings to make use of the new names. 
The old names will not work.

Source: Modern Fortran (Extension)

It isn’t clear to me what settings this is referring to…

1 Like

If you open your settings.json you will see some settings starting with fortran. being underlined with yellow. These are the deprecated settings
(The settings UI shows something similar)

Might be a good idea to offer users to open their settings for edit

1 Like

Ah! Thank you! I didn’t notice that.