# Modern Fortran for VS Code v3.1.0 Release

**URL:** <https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713>\
**Category:** Announcements\
**Created:** [June 10, 2022, 2:44pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713 "2022-06-10T14:44:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [June 10, 2022, 2:44pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/1 "2022-06-10T14:44:39Z")

</div>

[Modern Fortran Release v3.1.0](https://github.com/fortran-lang/vscode-fortran-support/releases/tag/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](https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran&ssr=false#review-details)
- If you have any questions about the extension feel free to open a Q&A in our [Discussion Board](https://github.com/fortran-lang/vscode-fortran-support/discussions)
- 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](https://github.com/fortran-lang/vscode-fortran-support/blob/master/CONTRIBUTING.md)

* * *

A summary of the changes can be found below:

# What’s New

- [Linting](#linting)
  - [Intel OneAPI compilers](#intel-oneapi-compilers)
  - [Preprocessor warnings](#preprocessor-warnings)

- [Language Server `fortls`](#language-server-fortls)
  - [Multi Workspace and Single file support](#multi-workspace-and-single-file-support)
  - [Configuration file watcher](#configuration-file-watcher)

- [Commands](#commands)
- [Debug Hovering](#debug-hovering)
- [Deprecations](#deprecations)
  - [Visual Studio Code Extensions](#visual-studio-code-extensions)
  - [Visual Studio Code Settings](#visual-studio-code-settings)

- [Other](#other)

## 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:

```json
{
  "fortran.linter.compiler": "ifort",
  "fortran.linter.compilerPath": "/path/to/intel/compilers/bin/ifort" // or ifx
}

```

 ![Intel Linting Diagnostics](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/2/208b4ac16dfac6343b6d8bfb4aebbe4762d107e7.png)

### Preprocessor warnings

Preprocessor warnings and errors are now properly supported during linting

 ![Linting Diagnostics Preprocessor](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/6/6e5fab9855d99e401ac662054ce64c0f5696abe7.png)

## 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`](https://gnikit.github.io/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

```json
{
  "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

```json
{
  "fortran.fortls.extraArgs": ["--nthreads=8", "--autocomplete_name_only"]
}

```

For more information about `fortls` configuration options see the  
[`fortls` Documentation](https://gnikit.github.io/fortls/configuration.html)

### 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 restart `fortls` 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.

![Debugging Hover](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/c/ce62741254065c382b3298b322d50ddd5a4e0095.gif)

## 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](https://marketplace.visualstudio.com/items?itemName=hansec.fortran-ls): 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](https://marketplace.visualstudio.com/items?itemName=ekibun.fortranbreaker): is redundant and deprecated, _ **Modern Fortran** _ has native breaking point support.
- [fortran](https://marketplace.visualstudio.com/items?itemName=Gimly81.fortran): is redundant and deprecated, _ **Modern Fortran** _ has native support for Syntax Highlighting.
- External Formatters like [vscode-modern-fortran-formatter](https://marketplace.visualstudio.com/items?itemName=yukiuuh.vscode-modern-fortran-formatter) are redundant and deprecated, _ **Modern Fortran** _ has native formatter support for `fprettify` and `findent`.

### Visual Studio Code Settings

The following settings have been deprecated are replaced by the following:

- `includePaths` in favour of `linter.includePaths`
- `gfortranExecutable` in favour of `linter.compilerPath`
- `linterEnabled` in favour of `linter.compiler == Disabled`
- `linterExtraArgs` in favour of `linter.extraArgs`
- `linterModOutput` in favour of `linter.modOutput`
- `ProvideSymbols` in favour of `provide.symbols`
- `symbols`
- `provideHover` in favour of `provide.hover`
- `provideCompletion` in favour of `provide.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](https://github.com/fortran-lang/vscode-fortran-support/issues/278))
- Changed `linter.compilerPath` to use the full path to the compiler instead of the root  
([#500](https://github.com/fortran-lang/vscode-fortran-support/issues/500))
- Merged Language Server’s log channel to Modern Fortran’s log channel
- Fixed `error stop variable` syntax highlighting  
([#486](https://github.com/fortran-lang/vscode-fortran-support/issues/486))
- Fixed issue with linter cache containing outdated folders  
([#464](https://github.com/fortran-lang/vscode-fortran-support/issues/464))
- Fixed slow performance of very long lines by using a different solution for  
([#207](https://github.com/fortran-lang/vscode-fortran-support/issues/207))  
([#309](https://github.com/fortran-lang/vscode-fortran-support/issues/309))
- Fixes linter activation from `Disabled` to some compiler `X` without having  
to restart the extension  
([#296](https://github.com/fortran-lang/vscode-fortran-support/issues/296))
- Fixes nopass pointer erroneous syntax highlighting  
([#318](https://github.com/fortran-lang/vscode-fortran-support/issues/318))
- Fixes `%` accessor highlighting for type-bound subroutines  
([#325](https://github.com/fortran-lang/vscode-fortran-support/issues/325))
- Fixes `fortls` not spawning when `ignoreWarning` was set to true  
([#365](https://github.com/fortran-lang/vscode-fortran-support/issues/365))
- Fixes formatting on Windows (needed .exe extension)  
([#354](https://github.com/fortran-lang/vscode-fortran-support/issues/354))
- Fixes `onSave` formatting errors  
([#364](https://github.com/fortran-lang/vscode-fortran-support/issues/364))

---

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [June 10, 2022, 2:52pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/2 "2022-06-10T14:52:06Z")

</div>

Great work!!

---

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [June 10, 2022, 3:34pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/3 "2022-06-10T15:34:37Z")

</div>

Absolutely brilliant, great stuff!

---

<div class="post-metadata">

**Author:** ![Rob777](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@Rob777](https://fortran-lang.discourse.group/u/Rob777)\
**Post date:** [June 10, 2022, 4:34pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/4 "2022-06-10T16:34:02Z")

</div>

Absolutely wonderful piece of software!  
As a gnu/Linux user (open-suse) is there anything I must do to get the latest release or it will update automatically at the next package manager update?

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [June 10, 2022, 5:05pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/5 "2022-06-10T17:05:09Z")

</div>

It should autoupdate (that is the default setting in VS Code). You can however make sure that your version is v3.1.0 by doing the following (see `v3.1.0` next to the Extension name)

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/b/bdad831dddb08c89f99e9d095d1305c6f76868f7.png)

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [June 10, 2022, 6:53pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/6 "2022-06-10T18:53:56Z")

</div>

BTW if someone knows people that currently work at Intel on the Fortran side of things, could you point them to this release to notify them that we support their compilers for linting now. I don’t think they are aware.

---

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [June 10, 2022, 7:43pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/7 "2022-06-10T19:43:18Z")

</div>

Attention @greenrongreen - please see the note above by @gnikit .

---

<div class="post-metadata">

**Author:** ![greenrongreen](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/greenrongreen/32/1249_2.png) [@greenrongreen](https://fortran-lang.discourse.group/u/greenrongreen)\
**Post date:** [June 10, 2022, 7:52pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/8 "2022-06-10T19:52:41Z")

</div>

Thanks @FortranFan and @gnikit ! I’ll give it a try with VS Code on my Mac and put a reference on our User Forum.

---

<div class="post-metadata">

**Author:** ![Sideboard](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sideboard/32/779_2.png) [@Sideboard](https://fortran-lang.discourse.group/u/Sideboard)\
**Post date:** [June 16, 2022, 1:51pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/9 "2022-06-16T13:51:55Z")

</div>

> [@gnikit](#):
>
> For more information about `fortls` configuration options see the  
> [`fortls` Documentation](https://gnikit.github.io/fortls/configuration.html)

Unfortunately, the link is broken (404).

Since some time (weeks, months?) I get these messages and no pipping or configuring seem to fix it. Does anybody else have this problem?  
 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/c/c630ed6f771202d5d9446bfb774837668cb35692.png)

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [June 16, 2022, 1:58pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/10 "2022-06-16T13:58:31Z")

</div>

Then link must be old, I’ll update it, here is the working link: [Configuration options - fortls](https://gnikit.github.io/fortls/options.html#configuration-options)

As for the fortls version, it would appear that you are using an outdated version. Specifically the outdated `fortls` is the one spawned by VS Code with the option:

```json
  "fortran.fortls.path": "fortls"

```

Try and just use the default version in your global Python env (user level)

---

<div class="post-metadata">

**Author:** ![Sideboard](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sideboard/32/779_2.png) [@Sideboard](https://fortran-lang.discourse.group/u/Sideboard)\
**Post date:** [June 16, 2022, 2:05pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/11 "2022-06-16T14:05:08Z")

</div>

> [@gnikit](#):
>
> **just** use the default version

It’s unclear how this can be done. Should I delete the option? I thought this option is exactly meant to point to the system version of fortls.

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [June 16, 2022, 2:09pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/12 "2022-06-16T14:09:15Z")

</div>

You will have to provide some more info, there is a number of things that can be going on.

1. What have you set for `"fortran.fortls.path"`?
2. What OS are you on?
3. Open a new terminal and type `fortls -v` and post the output
4. If you have anything other than the default option in `"fortran.fortls.path"`, from a terminal also check the version of that custom `fortls` installation and post the output
5. Also post the _Output_ from the _Modern Fortran_ log channel in VS Code

---

<div class="post-metadata">

**Author:** ![Sideboard](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sideboard/32/779_2.png) [@Sideboard](https://fortran-lang.discourse.group/u/Sideboard)\
**Post date:** [June 16, 2022, 2:46pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/13 "2022-06-16T14:46:37Z")

</div>

Sorry, your first reply sounded like the solution was self-explanatory. That’s why I didn’t provide more info. I think I found the problem, see below.

For the sake of completeness:

1. The entry is missing from JSON, I suppose because I put the default `fortls` in the text field.
2. CentOS 8 Stream
3. Before it was `2.2.10` , now it’s `2.9.0` (see below).
4. Default
5. Cannot replicate anymore after (finally) upgrading.

### Solution

Apparently upgrading to a new version didn’t work but didn’t print an error either, while VS Code continued using the old version. And whenever I tried to uninstall, it only removed the (working or not) new version, not the old one.

```bash
$ fortls -v
2.2.10

$ python3.9 -m pip install --user --upgrade fortls
Requirement already satisfied: fortls in ./.local/lib/python3.9/site-packages (2.9.0)
Requirement already satisfied: json5 in ./.local/lib/python3.9/site-packages (from fortls) (0.9.8)
Requirement already satisfied: packaging in ./.local/lib/python3.9/site-packages (from fortls) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./.local/lib/python3.9/site-packages (from packaging->fortls) (3.0.7)

$ type fortls 
fortls is /home/u2073032/.local/bin/fortls

$ cat ~/.local/bin/fortls 
#!/usr/bin/python3.9
# -*- coding: utf-8 -*-
import re
import sys
from fortls. __init__ import main
if __name__ == ' __main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

$ pip3.9 uninstall fortls                       
Found existing installation: fortls 2.9.0
Uninstalling fortls-2.9.0:
  Would remove:
    /home/u2073032/.local/bin/fortls
    /home/u2073032/.local/lib/python3.9/site-packages/fortls-2.9.0.dist-info/*
    /home/u2073032/.local/lib/python3.9/site-packages/fortls/*
Proceed (Y/n)? y
  Successfully uninstalled fortls-2.9.0

$ pip3.9 uninstall fortls
Found existing installation: fortls 2.2.10
Uninstalling fortls-2.2.10:
  Would remove:
    /home/u2073032/.local/lib/python3.9/site-packages/fortls-2.2.10.dist-info/*
Proceed (Y/n)? y
  Successfully uninstalled fortls-2.2.10

$ pip3.9 uninstall fortls
WARNING: Skipping fortls as it is not installed.

$ pip3.9 install --user fortls 
Collecting fortls
  Using cached fortls-2.9.0-py3-none-any.whl (92 kB)
Requirement already satisfied: packaging in ./.local/lib/python3.9/site-packages (from fortls) (21.3)
Requirement already satisfied: json5 in ./.local/lib/python3.9/site-packages (from fortls) (0.9.8)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./.local/lib/python3.9/site-packages (from packaging->fortls) (3.0.7)
Installing collected packages: fortls
Successfully installed fortls-2.9.0

$ fortls -v
2.9.0

```

I had not tried to uninstall the same package twice in a row. Didn’t know that was even possible. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Christophe](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/christophe/32/1906_2.png) [@Christophe](https://fortran-lang.discourse.group/u/Christophe)\
**Post date:** [July 4, 2022, 2:56pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/14 "2022-07-04T14:56:49Z")

</div>

Hello,

I have 2 points to mention:

1/ I face difficulties to configure correctly Modern Fortran Extension :

I am building a code with cmake in a directory located in:  
$BUILD\_DIR/myCode

The modules are present in directory:  
$BUILD\_DIR/myCode/modules

I gave that information to the extension:  
Fortran \> Linter: Include Paths  
$BUILD\_DIR/myCode/modules

and as it didn’t work, I also add it to:  
Fortran \> Linter: Mod Output  
$BUILD\_DIR/myCode/modules

But fortls doesn’t find the modules.

2/ Is it possible to quickly show all subroutines present in a file

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [July 4, 2022, 3:27pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/15 "2022-07-04T15:27:17Z")

</div>

1. If you are using `$BUILD_DIR` in your definition of of the paths VS Code will not be able to resolve the variable name and hence it will fail. As a side note, the directories are relative to the VS Code root i.e. the directory where VS Code is open from. Other than that you settings seem okay to me, you will have to post either a screenshot or the relevant parts of your json settings for a more detailed response. The `.mod` files are generated by the compiler i.e. linter, so you should configure **and build** before you start. `fortls` is complementary to the linter.  
`fortls` by default will recursively look for source files (not the .mod files). I think there is a diagnostic message when you use an external module but that should not cause any problems. These are the `fortls` options for file discovery [Configuration options - fortls](https://gnikit.github.io/fortls/options.html#sources-file-parsing) you can configure them either via VS Code or via a fortls configuration file.

2. That is what the Symbol Outline in VS Code does `View: Focus on Outline View`. It’s a little menu by default on the bottom left that shows all the symbols inside a file. You can also trigger an interactive menu by pressing `Ctrl`+`Shift`+`O` (or `Cmd`+`Shift`+`O`) and scroll through the same symbols or start typing to narrow the displayed results. `Ctrl`+`T` (or `Cmd`+`T`) will show the same but for all symbols in the whole worskspace. Click or press Enter to go to the symbol. For more info have a look at the fortls webpage, [fortls](https://gnikit.github.io/fortls/index.html) (Feature tab).

---

<div class="post-metadata">

**Author:** ![Christophe](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/christophe/32/1906_2.png) [@Christophe](https://fortran-lang.discourse.group/u/Christophe)\
**Post date:** [July 5, 2022, 8:10am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/16 "2022-07-05T08:10:48Z")

</div>

Hello,

I entered full path for modules and includePath but it is still not working. Here are few screen captures:

 ![Modern Fortran 1](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/7/7b11e198708e336028538a20723d9ed8450ae7d2.png)  
 ![Modern Fortran 2](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/d/dc2637fdb4505edeb5d13415170dfe8289a84961.png)  
 ![Modern Fortran 2](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/d/dc2637fdb4505edeb5d13415170dfe8289a84961.png)  
 ![Modern Fortran 4](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/c/cac28da1a47d27d5b4db691aa7ac291c615bdc5e.png)

and for the second point, I am unabble to show the structure of Fortran files:

 ![Modern Fortran 5](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/0/0125955b59255463f2f61aa7d77a25b8c70bdfd6.png)

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [July 5, 2022, 8:42am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/17 "2022-07-05T08:42:21Z")

</div>

First of all, welcome to the community @Christophe!

## Linter

One obvious thing I noticed is the `include Paths`. There should be one item per line, so that should fix the linter (most likely). If you have any other compiler flags that you use for compilation e.g. `-DHAVE_MPI` you need to pass those to the extra args, (one per line).

## fortls

Is that location to the fortls binary working? You can find out by doing something like this in a terminal

```auto
/your/fortls/inst/fortls --debug_filepath your_file.F90 --debug_rootpath . --debug_parser

```

If you could post the log channel output (copy-paste) of the extension that would also help

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/3/3e349f801211ded74f31ff3a686e499e40eae03a.png)

FYI when it comes to sharing settings for VS Code it is easier if you send the relevant parts of the `settings.json`. You can change between the UI and the JSON format via that little icon

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/f/f93f7030e166ab310326a819006867f8b6bc5376.png)

---

<div class="post-metadata">

**Author:** ![Christophe](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/christophe/32/1906_2.png) [@Christophe](https://fortran-lang.discourse.group/u/Christophe)\
**Post date:** [July 5, 2022, 9:48am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/18 "2022-07-05T09:48:36Z")

</div>

Here is the output for Modern Fortran

 ![Modern Fortran 6](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/c/c2767656b21d438dd30c14a23136f402e348a6b5.png)

and here is the result of command:  
~/.local/bin/fortls --debug\_filepath Main.F90 --debug\_rootpath . --debug\_parser

(small file)

```auto
Testing parser
  File = "Main.F90"
  Detected format: free

=========
Parser Output
=========

=== PreProc Pass ===

=== Parsing Pass ===

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !!! Doc string - Line:1
Main.f90 !!! Doc string - Line:2
Christophe Peyret !!! Doc string - Line:3
Copyright (c) 1995-2022. All rights reserved. !!! Doc string - Line:4
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!! Doc string - Line:5
program space !!! PROGRAM - Ln:7
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !!! Doc string - Line:8
  use mpi !!! USE - Ln:9
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!! Doc string - Line:10
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !!! Doc string - Line:11
  integer :: iErr !!! VARIABLE - Ln:12
  external :: driver_space !!! VARIABLE - Ln:13
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!! Doc string - Line:16
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !!! Doc string - Line:18
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!! Doc string - Line:27
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !!! Doc string - Line:30
Initialisation environnement MPI !!! Doc string - Line:31
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!! Doc string - Line:33

```

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [July 5, 2022, 10:04am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/19 "2022-07-05T10:04:56Z")

</div>

I still think you `"fortran.linter.includePaths"` are wrong, there should be one path per line in the output and the settings UI should look like this

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/f/fc582c5b271f80da552fc6455d4b1d83aa40e0d4.png)

As for `fortls` I am not sure what’s going on. What version are you using?

---

<div class="post-metadata">

**Author:** ![Christophe](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/christophe/32/1906_2.png) [@Christophe](https://fortran-lang.discourse.group/u/Christophe)\
**Post date:** [July 5, 2022, 12:18pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713/20 "2022-07-05T12:18:12Z")

</div>

Thanks,

Adding path item by item make fortls works.  
I’m using version 2.11.0 of fortls

That is very usefull because I can see all warnings (and errors) now and correct it

But I still do not succeed to see the list of procedures and function contained in one file.

[Next page](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-1-0-release/3713.md?page=2)
