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

**URL:** <https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347>\
**Category:** Announcements\
**Created:** [April 29, 2022, 5:31pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347 "2022-04-29T17:31:37Z")\
**Posts on this page:** 9\
**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:** [April 29, 2022, 5:31pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/1 "2022-04-29T17:31:37Z")

</div>

I am mostly done with v3.0 of [Modern Fortran](https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran) 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`](https://github.com/gnikit/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`
> 
> ```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](https://github.com/fortran-lang/vscode-fortran-support/issues/new/choose) if you come across any bugs or if there are any features that you would like to see being added in the future.

---

<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:** [April 29, 2022, 11:15pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/2 "2022-04-29T23:15:10Z")

</div>

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

```auto
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…

---

<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:** [April 29, 2022, 11:37pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/3 "2022-04-29T23:37:13Z")

</div>

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

---

<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:** [April 30, 2022, 1:12pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/4 "2022-04-30T13:12:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChiseiMinamoto](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@ChiseiMinamoto](https://fortran-lang.discourse.group/u/ChiseiMinamoto)\
**Post date:** [May 31, 2022, 1:38am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/5 "2022-05-31T01:38:33Z")

</div>

Hi gnikit,

Your work is great, however I am having problem launching fortls with Modern Fortran extension in vscode.

The setup I used is:

1. macOS
2. Modern Fortran version v3.0.2022050508
3. fortls version 2.7.0

And I am connecting to a remote server using ssh extension.

With this setup, when I tried open an f90 file to launch the fortls, the following error occurs:

* * *

[“INFO” - 8:34:37 PM] Fortran Language Server  
[“INFO” - 8:34:38 PM] Initialising Language Server for file: /home/yz167/GLX15/code/RCM-E/rcm-e.f90  
[Error - 8:34:38 PM] Server initialization failed.  
Message: ‘list’ object is not callable  
Code: -32603  
[object Object]  
[Error - 8:34:38 PM] Starting client failed  
Message: ‘list’ object is not callable  
Code: -32603  
[object Object]  
error handling request {‘jsonrpc’: ‘2.0’, ‘id’: 0, ‘method’: ‘initialize’, ‘params’: {‘processId’: 33435, ‘clientInfo’: {‘name’: ‘Visual Studio Code’, ‘version’: ‘1.67.2’}, ‘locale’: ‘en’, ‘rootPath’: None, ‘rootUri’: None, ‘capabilities’: {‘workspace’: {‘applyEdit’: True, ‘workspaceEdit’: {‘documentChanges’: True, ‘resourceOperations’: [‘create’, ‘rename’, ‘delete’], ‘failureHandling’: ‘textOnlyTransactional’, ‘normalizesLineEndings’: True, ‘changeAnnotationSupport’: {‘groupsOnLabel’: True}}, ‘didChangeConfiguration’: {‘dynamicRegistration’: True}, ‘didChangeWatchedFiles’: {‘dynamicRegistration’: True}, ‘symbol’: {‘dynamicRegistration’: True, ‘symbolKind’: {‘valueSet’: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, ‘tagSupport’: {‘valueSet’: [1]}}, ‘codeLens’: {‘refreshSupport’: True}, ‘executeCommand’: {‘dynamicRegistration’: True}, ‘configuration’: True, ‘workspaceFolders’: True, ‘semanticTokens’: {‘refreshSupport’: True}, ‘fileOperations’: {‘dynamicRegistration’: True, ‘didCreate’: True, ‘didRename’: True, ‘didDelete’: True, ‘willCreate’: True, ‘willRename’: True, ‘willDelete’: True}}, ‘textDocument’: {‘publishDiagnostics’: {‘relatedInformation’: True, ‘versionSupport’: False, ‘tagSupport’: {‘valueSet’: [1, 2]}, ‘codeDescriptionSupport’: True, ‘dataSupport’: True}, ‘synchronization’: {‘dynamicRegistration’: True, ‘willSave’: True, ‘willSaveWaitUntil’: True, ‘didSave’: True}, ‘completion’: {‘dynamicRegistration’: True, ‘contextSupport’: True, ‘completionItem’: {‘snippetSupport’: True, ‘commitCharactersSupport’: True, ‘documentationFormat’: [‘markdown’, ‘plaintext’], ‘deprecatedSupport’: True, ‘preselectSupport’: True, ‘tagSupport’: {‘valueSet’: [1]}, ‘insertReplaceSupport’: True, ‘resolveSupport’: {‘properties’: [‘documentation’, ‘detail’, ‘additionalTextEdits’]}, ‘insertTextModeSupport’: {‘valueSet’: [1, 2]}}, ‘completionItemKind’: {‘valueSet’: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}, ‘hover’: {‘dynamicRegistration’: True, ‘contentFormat’: [‘markdown’, ‘plaintext’]}, ‘signatureHelp’: {‘dynamicRegistration’: True, ‘signatureInformation’: {‘documentationFormat’: [‘markdown’, ‘plaintext’], ‘parameterInformation’: {‘labelOffsetSupport’: True}, ‘activeParameterSupport’: True}, ‘contextSupport’: True}, ‘definition’: {‘dynamicRegistration’: True, ‘linkSupport’: True}, ‘references’: {‘dynamicRegistration’: True}, ‘documentHighlight’: {‘dynamicRegistration’: True}, ‘documentSymbol’: {‘dynamicRegistration’: True, ‘symbolKind’: {‘valueSet’: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, ‘hierarchicalDocumentSymbolSupport’: True, ‘tagSupport’: {‘valueSet’: [1]}, ‘labelSupport’: True}, ‘codeAction’: {‘dynamicRegistration’: True, ‘isPreferredSupport’: True, ‘disabledSupport’: True, ‘dataSupport’: True, ‘resolveSupport’: {‘properties’: [‘edit’]}, ‘codeActionLiteralSupport’: {‘codeActionKind’: {‘valueSet’: [’’, ‘quickfix’, ‘refactor’, ‘refactor.extract’, ‘refactor.inline’, ‘refactor.rewrite’, ‘source’, ‘source.organizeImports’]}}, ‘honorsChangeAnnotations’: False}, ‘codeLens’: {‘dynamicRegistration’: True}, ‘formatting’: {‘dynamicRegistration’: True}, ‘rangeFormatting’: {‘dynamicRegistration’: True}, ‘onTypeFormatting’: {‘dynamicRegistration’: True}, ‘rename’: {‘dynamicRegistration’: True, ‘prepareSupport’: True, ‘prepareSupportDefaultBehavior’: 1, ‘honorsChangeAnnotations’: True}, ‘documentLink’: {‘dynamicRegistration’: True, ‘tooltipSupport’: True}, ‘typeDefinition’: {‘dynamicRegistration’: True, ‘linkSupport’: True}, ‘implementation’: {‘dynamicRegistration’: True, ‘linkSupport’: True}, ‘colorProvider’: {‘dynamicRegistration’: True}, ‘foldingRange’: {‘dynamicRegistration’: True, ‘rangeLimit’: 5000, ‘lineFoldingOnly’: True}, ‘declaration’: {‘dynamicRegistration’: True, ‘linkSupport’: True}, ‘selectionRange’: {‘dynamicRegistration’: True}, ‘callHierarchy’: {‘dynamicRegistration’: True}, ‘semanticTokens’: {‘dynamicRegistration’: True, ‘tokenTypes’: [‘namespace’, ‘type’, ‘class’, ‘enum’, ‘interface’, ‘struct’, ‘typeParameter’, ‘parameter’, ‘variable’, ‘property’, ‘enumMember’, ‘event’, ‘function’, ‘method’, ‘macro’, ‘keyword’, ‘modifier’, ‘comment’, ‘string’, ‘number’, ‘regexp’, ‘operator’], ‘tokenModifiers’: [‘declaration’, ‘definition’, ‘readonly’, ‘static’, ‘deprecated’, ‘abstract’, ‘async’, ‘modification’, ‘documentation’, ‘defaultLibrary’], ‘formats’: [‘relative’], ‘requests’: {‘range’: True, ‘full’: {‘delta’: True}}, ‘multilineTokenSupport’: False, ‘overlappingTokenSupport’: False}, ‘linkedEditingRange’: {‘dynamicRegistration’: True}}, ‘window’: {‘showMessage’: {‘messageActionItem’: {‘additionalPropertiesSupport’: True}}, ‘showDocument’: {‘support’: True}, ‘workDoneProgress’: True}, ‘general’: {‘regularExpressions’: {‘engine’: ‘ECMAScript’, ‘version’: ‘ES2020’}, ‘markdown’: {‘parser’: ‘marked’, ‘version’: ‘1.1.0’}}}, ‘trace’: ‘off’, ‘workspaceFolders’: None}}  
Traceback (most recent call last):  
File “/home/yz167/pkg/miniconda/lib/python3.9/site-packages/fortls/langserver.py”, line 1505, in \_load\_config\_file  
config\_dict = json.load(jsonfile)  
File “/home/yz167/pkg/miniconda/lib/python3.9/json/ **init**.py”, line 293, in load  
return loads(fp.read(),  
File “/home/yz167/pkg/miniconda/lib/python3.9/json/ **init**.py”, line 346, in loads  
return \_default\_decoder.decode(s)  
File “/home/yz167/pkg/miniconda/lib/python3.9/json/decoder.py”, line 337, in decode  
obj, end = self.raw\_decode(s, idx=\_w(s, 0).end())  
File “/home/yz167/pkg/miniconda/lib/python3.9/json/decoder.py”, line 353, in raw\_decode  
obj, end = self.scan\_once(s, idx)  
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/home/yz167/pkg/miniconda/lib/python3.9/site-packages/fortls/langserver.py”, line 166, in handle  
resp = handler(request)  
File “/home/yz167/pkg/miniconda/lib/python3.9/site-packages/fortls/langserver.py”, line 193, in serve\_initialize  
self.\_load\_config\_file()  
File “/home/yz167/pkg/miniconda/lib/python3.9/site-packages/fortls/langserver.py”, line 1529, in \_load\_config\_file  
self.post\_messages(  
TypeError: ‘list’ object is not callable

* * *

Could you help me with this?

Many thanks.

---

<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:** [May 31, 2022, 8:17am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/6 "2022-05-31T08:17:59Z")

</div>

Hi @ChiseiMinamoto welcome to the community!

From the looks of it the configuration file i.e. ‘.fortls’ seems to contain invalid json syntax

> Expecting property name enclosed in double quotes: line 2 column 1 (char 2)

so `fortls` cannot initialise. See the `fortls` documentation for using a configuration file: [https://gnikit.github.io/fortls/options.html#configuration-using-a-file](https://gnikit.github.io/fortls/options.html#configuration-using-a-file)

There was a related bug in v2.7.0 that fatal errors such as the one you reported were not properly displayed and that basically makes the rest of the logs you posted. This has now been fixed in v2.8.0!

---

<div class="post-metadata">

**Author:** ![ChiseiMinamoto](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@ChiseiMinamoto](https://fortran-lang.discourse.group/u/ChiseiMinamoto)\
**Post date:** [June 1, 2022, 12:44am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/7 "2022-06-01T00:44:29Z")

</div>

Thanks, it now works just fine!

---

<div class="post-metadata">

**Author:** ![nicholaswogan](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nicholaswogan](https://fortran-lang.discourse.group/u/nicholaswogan)\
**Post date:** [June 9, 2022, 3:41am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/8 "2022-06-09T03:41:07Z")

</div>

@gnikit do you know how to turn off all suggestions with the Modern Fortran vscode extension? For example, when I type “func”, a suggestion pops up for making a function. I want to disable all these suggestions. Thanks!

---

<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 9, 2022, 8:14am UTC](https://fortran-lang.discourse.group/t/modern-fortran-for-vs-code-v3-0-x-final-pre-release/3347/9 "2022-06-09T08:14:26Z")

</div>

I don’t think disabling autocomplete completely is possible.

- You can do this to disable all code snippets [visual studio code - How to remove IntelliSense suggested snippets introduced by extension - Stack Overflow](https://stackoverflow.com/a/64688778/5648064)
- and you can pass “–autocomplete\_no\_snippets” in your fortran.gortls.extraArgs settings.

These 2 should somehow limit the autocomplete suggestions but unfortunately there is no way to completely turn off the feature AFAIK.
