{"id":15489328,"url":"https://github.com/fortran-lang/vscode-fortran-support","last_synced_at":"2025-05-16T15:02:38.725Z","repository":{"id":37022437,"uuid":"92602565","full_name":"fortran-lang/vscode-fortran-support","owner":"fortran-lang","description":"Fortran language support for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2025-04-21T20:50:48.000Z","size":68794,"stargazers_count":239,"open_issues_count":53,"forks_count":36,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-23T09:40:55.484Z","etag":null,"topics":["debugger","formatting","fortls","fortran","language-server-client","linter","snippets","syntax-highlighter","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fortran-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-05-27T14:08:50.000Z","updated_at":"2025-04-10T18:58:42.000Z","dependencies_parsed_at":"2023-10-16T08:55:38.343Z","dependency_job_id":"8a62e83a-461d-4b42-a7c6-5dfb10ca9c5d","html_url":"https://github.com/fortran-lang/vscode-fortran-support","commit_stats":{"total_commits":1033,"total_committers":21,"mean_commits":49.19047619047619,"dds":0.5179090029041626,"last_synced_commit":"82bac3ea3181be27af5124edd92b75ed43471f53"},"previous_names":["krvajal/vscode-fortran-support"],"tags_count":177,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fvscode-fortran-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fvscode-fortran-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fvscode-fortran-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fvscode-fortran-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fortran-lang","download_url":"https://codeload.github.com/fortran-lang/vscode-fortran-support/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553936,"owners_count":22090415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","formatting","fortls","fortran","language-server-client","linter","snippets","syntax-highlighter","vscode-extension"],"created_at":"2024-10-02T07:05:01.959Z","updated_at":"2025-05-16T15:02:38.635Z","avatar_url":"https://github.com/fortran-lang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/png/modern-fortran-logo.png\" width=800/\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/fortran-lang.linter-gfortran?style=flat-square)\n![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/fortran-lang.linter-gfortran?style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fortran-lang/vscode-fortran-support/main.yaml?label=CI\u0026style=flat-square)\n![Visual Studio Marketplace Version (including pre-releases)](https://img.shields.io/visual-studio-marketplace/v/fortran-lang.linter-gfortran?color=brightgreen\u0026include_prereleases\u0026style=flat-square)\n![GitHub](https://img.shields.io/github/license/fortran-lang/vscode-fortran-support?color=brightgreen\u0026style=flat-square)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"#key-features\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#get-started--seek-support\"\u003eGet Started\u003c/a\u003e •\n  \u003ca href=\"#language-server-integration\"\u003eLSP\u003c/a\u003e •\n  \u003ca href=\"#linting\"\u003eLint\u003c/a\u003e •\n  \u003ca href=\"#debugging\"\u003eDebug\u003c/a\u003e •\n  \u003ca href=\"#formatting\"\u003eFormat\u003c/a\u003e •\n  \u003ca href=\"#snippets\"\u003eSnippets\u003c/a\u003e •\n  \u003ca href=\"#support-us\"\u003eDonate\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/gif/intro-demo.gif\"/\u003e\n\u003c/p\u003e\n\n## Key Features\n\n- Syntax highlighting (Free and Fixed forms)\n- Hover support, Signature help and Auto-completion\n- GoTo/Peek implementation and Find/Peek references\n- Project-wide and Document symbol detection and Renaming\n- [Native Language Server integration](#language-server-integration) with [`fortls`](https://fortls.fortran-lang.org)\n- [Linting support](#linting): GNU's [`gfortran`](https://gcc.gnu.org/wiki/GFortran), Intel's [`ifort`](https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler.html), `ifx`, NAG's [`nagfor`](https://www.nag.co.uk/nagfor/)\n- [Interactive Debugger with UI](#debugging)\n- [Formatting](#formatting) with [findent](https://github.com/gnikit/findent-pypi) or [fprettify](https://github.com/pseewald/fprettify)\n- [Code snippets](#snippets) (more can be defined by the user [see](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets))\n\n## Get Started \u0026 Seek Support\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://fortran-lang.org/learn/\"\u003e\u003cimg src=\"assets/png/readme.tutorial.png\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://fortran-lang.discourse.group/c/help/vscode/\"\u003e\u003cimg src=\"assets/png/readme.github.png\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://fortran-lang.discourse.group/\"\u003e\u003cimg src=\"assets/png/readme.discourse.png\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Useful Tools\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://fortls.fortran-lang.org\"\u003e\u003cimg src=\"assets/png/readme.fortls.png\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://fpm.fortran-lang.org\"\u003e\u003cimg src=\"assets/png/readme.fpm.png\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/fortran-lang/stdlib\"\u003e\u003cimg src=\"assets/png/readme.stdlib.png\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Language Server integration\n\nThe Fortran Language Server [`fortls`](https://fortls.fortran-lang.org) is responsible\nfor providing a lot of the higher level, IDE functionality. By default,\n`Modern Fortran` will attempt to use it for hover, autocompletion, symbols and Go to \u0026 Peeking into definitions.\n\nAllow for `fortls` to be automatically installed with `pip` or `Anaconda` and\nif the location where `fortls` is installed is not in your `PATH` point VS Code\nto the `fortls` location by setting\n\n```json\n{\n  \"fortran.fortls.path\": \"/custom/path/to/fortls\"\n}\n```\n\nFor more about the Language Server's capabilities please refer to the\n[documentation](https://fortls.fortran-lang.org/) of `fortls`.\n\n## Linting\n\nLinting allows for compiler error and warning detection while coding\nwithout the user having to compile.\n\n| Vendor                                                                                        | Compiler       |\n| --------------------------------------------------------------------------------------------- | -------------- |\n| [GNU](https://gcc.gnu.org/wiki/GFortran)                                                      | `gfortran`     |\n| [Intel](https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler.html) | `ifort`, `ifx` |\n| [NAG](https://www.nag.com/)                                                                   | `nagfor`       |\n\nUsing an invalid if expression\n\n![alt](assets/gif/lint-demo.gif)\n\nUsing incorrect type and rank as function argument\n\n![alt](assets/gif/lint-demo2.gif)\n\n| 📝️ Note | Save your file to generate linting results |\n| -------- | ------------------------------------------ |\n\nLinting results can be improved by providing additional options to the compiler.\n\n### Including directories\n\nYou can control the include paths to be used by the linter with the `fortran.linter.includePaths` option.\n\n| ❗️ Important | For the best linting results `linter.includePaths` should match the included paths for your project's compilation. |\n| ------------ | ------------------------------------------------------------------------------------------------------------------ |\n\n```json\n{\n  \"fortran.linter.includePaths\": [\"/usr/include/**\", \"${workspaceFolder}/include/**\"]\n}\n```\n\n| ❗️ Important | If a glob pattern is used only directories matching the pattern will be included |\n| ------------ | -------------------------------------------------------------------------------- |\n\n### Additional linting options\n\nMore options can be passed to the linter via\n\n```json\n{\n  \"fortran.linter.extraArgs\": [\n    \"-fdefault-real-8\",\n    \"-fdefault-double-8\",\n    \"-Wunused-variable\",\n    \"-Wunused-dummy-argument\"\n  ]\n}\n```\n\nDefault value is `-Wall` (or `-warn all` for ifort).\n\n### Changing linting compiler\n\nBy default, the linter used is `gfortran`, Intel's `ifort` and Intel's LLVM based compiler `ifx` are also supported.\nOne can use a different linter compiler via the option\n\n```jsonc\n{\n  \"fortran.linter.compiler\": \"ifort\" | \"gfortran\" | \"ifx\" | \"Disabled\"\n}\n```\n\nThe linter executable is assumed to be found in the `PATH`.\nIn order to use a different executable or if the executable can't be found in the `PATH`\nyou can point the extension to another linter with the `fortran.linter.compilerPath` option.\n\n```json\n{\n  \"fortran.linter.compilerPath\": \"/opt/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort\"\n}\n```\n\n## Debugging\n\n![alt](assets/gif/gdb_ani.gif)\n\nThe extension uses the debugger from Microsoft's\n[C/C++ extension](https://github.com/Microsoft/vscode-cpptools)\nfor Visual Studio Code. This allows this extension to use the full functionality\nof the C/C++ extension for debugging applications:\n(un)conditional breaking points, expression evaluation, multithreaded debugging,\ncall stack, stepping, watch window.\n\nA minimal `launch.json` script, responsible for controlling the debugger, is\nprovided below. However, Visual Studio Code is also capable of autogenerating\na `launch.json` file and the configurations inside the file.\n\nMore details about how to set up the debugger can be found in Microsoft's website:\n\n- General information about debugging in VS Code: \u003chttps://code.visualstudio.com/docs/editor/debugging\u003e\n- C/C++ extension debugger information: \u003chttps://code.visualstudio.com/docs/cpp/cpp-debug\u003e\n- Build tasks for easy compiling: \u003chttps://code.visualstudio.com/docs/editor/tasks\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eExample: Launch.json\u003c/b\u003e\u003c/summary\u003e\n\n```jsonc\n{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"(gdb) Fortran\",\n      \"type\": \"cppdbg\",\n      \"request\": \"launch\",\n      \"program\": \"${workspaceFolder}/a.out\",\n      \"args\": [], // Possible input args for a.out\n      \"stopAtEntry\": false,\n      \"cwd\": \"${workspaceFolder}\",\n      \"environment\": [],\n      \"externalConsole\": false,\n      \"MIMode\": \"gdb\",\n      \"setupCommands\": [\n        {\n          \"description\": \"Enable pretty-printing for gdb\",\n          \"text\": \"-enable-pretty-printing\",\n          \"ignoreFailures\": true,\n        },\n      ],\n    },\n  ],\n}\n```\n\n\u003c/details\u003e\n\n## Formatting\n\nTwo formatters are supported [`findent`](https://github.com/gnikit/findent-pypi)\nand [`fprettify`](https://github.com/pseewald/fprettify). Both of them can be\ninstalled with `pip` automatically through the extension.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eDemo: formatters in action\u003c/b\u003e\u003c/summary\u003e\n\n|                findent                |                fprettify                |\n| :-----------------------------------: | :-------------------------------------: |\n| ![alt](./assets/gif/findent-demo.gif) | ![alt](./assets/gif/fprettify-demo.gif) |\n\n\u003c/details\u003e\n\nThe formatter is controlled by the user option\n\n```jsonc\n{\n  \"fortran.formatting.formatter\": \"findent\" | \"fprettify\" | \"Disabled\"\n}\n```\n\nAdditional arguments to the formatter can be input using\n\n```json\n{\n  \"fortran.formatting.findentArgs\": [\"-Cn\", \"-Rr\"],\n  \"fortran.formatting.fprettifyArgs\": [\"--whitespace-comma\", \"--enable-decl\"]\n}\n```\n\nTo check all available arguments to formatters try `findent -h` or `fprettify -h`\nin a terminal.\n\nIf the formatter is not present in the `PATH` its location can be input with\n\n```json\n{\n  \"fortran.formatting.path\": \"./custom/path/venv/bin\"\n}\n```\n\n| 📝️ Note | `findent` can also be used to generate dependency files for a project. |\n| -------- | ---------------------------------------------------------------------- |\n\n## Fortran Package Manager\n\n### Validation of `fpm.toml`\n\nAutocompletion and options validation for `fpm.toml` files are provided by the\n**installing the [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) Visual Studio Code extension**.\n\n![fpm-validation](assets/gif/fpm-toml-validation.gif)\n\n## Snippets\n\nSnippets are included by both `fortls` Language Server and the Modern Fortran VS Code extension.\nSome available snippets can be seen below. Users can define their own snippets\nby following these VS Code [instructions](https://code.visualstudio.com/docs/editor/userdefinedsnippets).\n\nIf you think a snippet should be shipped by with the extension feel free to\nsubmit a [feature request](https://github.com/fortran-lang/vscode-fortran-support/issues/new?assignees=\u0026labels=feature-request\u0026template=feature_request.md\u0026title=)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDemo: snippets in action\u003c/b\u003e\u003c/summary\u003e\n\u003cp float=\"left\"\u003e\n  \u003cimg alt=\"program snippet\" src=\"https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif\" width=400/\u003e\n  \u003cimg alt=\"module snippet\" src=\"https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif\" width=320/\u003e\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Advanced options\n\nTo show the symbols in the file outline enable `provide.symbols`. Symbols can be\nserved by the fortls, the built-in, both or none. By default\n`fortls` is used.\n\n```jsonc\n{\n  \"fortran.provide.symbols\": \"fortls\" | \"Built-in\" | \"Both\" | \"Disable\"\n}\n```\n\nYou can also configure the case for fortran intrinsics auto-complete by using\n\n```jsonc\n{\n    \"fortran.preferredCase\": \"lowercase\" | \"uppercase\"\n}\n```\n\n## Requirements\n\nFor debugging you need to have one of the following debuggers installed:\n\n- **Linux**: GDB\n- **macOS**: GDB or LLDB\n- **Windows**: GDB or Visual Studio Windows Debugger\n\n## Contributing\n\n- [Guidelines](https://github.com/fortran-lang/vscode-fortran-support/blob/master/CONTRIBUTING.md)\n- [Code of conduct: Contributor Covenant](https://github.com/fortran-lang/.github/blob/main/CODE_OF_CONDUCT.md)\n- [License](https://github.com/fortran-lang/vscode-fortran-support/blob/master/LICENSE)\n\n## Support Us\n\nYou can support further development of the extension by fiscal donations:\n\n\u003ca href=\"https://numfocus.org/donate-to-lfortran\"\u003e\u003cimg src=\"./assets/png/readme.lfortran.png\"\u003e\u003c/a\u003e to our [**LFortan**](https://numfocus.org/donate-to-lfortran) project on NumFOCUS\n\nOr\n\n\u003ca href=\"https://github.com/fortran-lang/vscode-fortran-support\"\u003e\u003cimg src=\"./assets/png/readme.github.sponsor.png\"\u003e\u003c/a\u003e directly sponsoring developers through [**GitHub Sponsors**](https://github.com/fortran-lang/vscode-fortran-support)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortran-lang%2Fvscode-fortran-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffortran-lang%2Fvscode-fortran-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortran-lang%2Fvscode-fortran-support/lists"}