fortls


Namefortls JSON
Version 3.1.2 PyPI version JSON
download
home_pageNone
Summaryfortls - Fortran Language Server
upload_time2024-06-19 23:30:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
keywords fortran language server language server protocol lsp fortls
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ![alt](https://raw.githubusercontent.com/fortran-lang/fortls/master/assets/logo.png)

# fortls - Fortran Language Server

[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat-square&colorA=E1523D&colorB=007D8A)](https://numfocus.org)
![PyPI](https://img.shields.io/pypi/v/fortls?style=flat-square)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fortls?style=flat-square)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/fortls?style=flat-square&label=PyPi)](https://pepy.tech/project/fortls)
![Conda](https://img.shields.io/conda/dn/conda-forge/fortls?label=Anaconda&style=flat-square)
![GitHub License](https://img.shields.io/github/license/fortran-lang/fortls?style=flat-square)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fortran-lang/fortls/main.yml?branch=master&label=CI&style=flat-square)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fortran-lang/fortls/docs.yml?branch=master&label=Docs&style=flat-square)
![Codecov](https://img.shields.io/codecov/c/github/fortran-lang/fortls?style=flat-square)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
![GitHub Repo stars](https://img.shields.io/github/stars/fortran-lang/fortls?color=yellow&style=flat-square)
[![DOI](https://zenodo.org/badge/412392321.svg?style=flat-square)](https://zenodo.org/badge/latestdoi/412392321)

<!-- [<img alt="https://github.com/sponsors/gnikit" src="https://img.shields.io/static/v1?style=social&label=Sponsor&message=%E2%9D%A4&logo=GitHub&color&link=%3Curl%3E" height="30" />](https://github.com/sponsors/gnikit)
[<img alt="https://paypal.me/inikit" src="https://img.shields.io/static/v1?style=social&label=Donate&message=%E2%9D%A4&logo=Paypal&color&link=%3Curl%3E" height="30" />](https://paypal.me/inikit) -->

![alt](https://raw.githubusercontent.com/fortran-lang/fortls/master/assets/animations/intro-demo.gif)

`fortls` is an implementation of the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol)
(LSP) for Fortran using Python (3.7+).

All code editors that support LSP can integrate with `fortls` see the section
[Editor Integration](https://fortls.fortran-lang.org/editor_integration.html#editor-integration) in the documentation.
Some supported code editors include:
[Visual Studio Code](https://fortls.fortran-lang.org/editor_integration.html#visual-studio-code),
[Atom](https://fortls.fortran-lang.org/editor_integration.html#atom),
[Sublime Text](https://fortls.fortran-lang.org/editor_integration.html#sublime-text),
[(Neo)Vim](https://fortls.fortran-lang.org/editor_integration.html#vim-neovim-gvim),
and [Emacs](https://fortls.fortran-lang.org/editor_integration.html#emacs).

## Features

- Project-wide and Document symbol detection and Renaming
- Hover support, Signature help and Auto-completion
- GoTo/Peek implementation and Find/Peek references
- Preprocessor support
- Documentation parsing ([Doxygen](http://www.doxygen.org/) and
  [FORD](https://github.com/Fortran-FOSS-Programmers/ford) styles)
- Access to multiple intrinsic modules and functions
  - `ISO_FORTRAN_ENV` GCC 11.2.0
  - `ISO_C_BINDING` GCC 11.2.0
  - `IEEE_EXCEPTIONS`, `IEEE_ARITHMETIC`, `IEEE_FEATURES` GCC 11.2.0
  - OpenMP `OMP_LIB`, `OMP_LIB_KINDS` v5.0
  - OpenACC `OPENACC`, `OPENACC_KINDS` v3.1
- Diagnostics
  - Multiple definitions with the same variable name
  - Variable definition masks definition from parent scope
  - Missing subroutine/function arguments
  - Unknown user-defined type used in `TYPE`/`CLASS` definition
    (only if visible in project)
  - Unclosed blocks/scopes
  - Invalid scope nesting
  - Unknown modules in `USE` statement
  - Unimplemented deferred type-bound procedures
  - Use of non-imported variables/objects in interface blocks
  - Statement placement errors (`CONTAINS`, `IMPLICIT`, `IMPORT`)
- Code actions
  - Generate type-bound procedures and implementation templates for
    deferred procedures

### Notes/Limitations

- Signature help and hover does not handle elegantly overloaded functions i.e. interfaces

## Documentation

The full documentation for `fortls` can be found at
[fortls.fortran-lang.org](https://fortls.fortran-lang.org/).

## Installation

### PyPi

```sh
pip install fortls
```

### Anaconda

```sh
conda install -c conda-forge fortls
```

for more information about the Anaconda installation [see](https://github.com/conda-forge/fortls-feedstock#about-fortls)

### Common installation problems

It is **NOT** recommended having `fortls` and `fortran-language-server`
simultaneously installed, since they use the same executable name. If you are having trouble
getting `fortls` to work try uninstalling `fortran-language-server` and reinstalling `fortls`.

With `pip`

```sh
pip uninstall fortran-language-server
pip install fortls --upgrade
```

or with Anaconda

```sh
conda uninstall fortran-language-server
conda install -c conda-forge fortls
```

## Settings

`fortls` can be configured through both the command line e.g.
`fortls --hover_signature` or through a Configuration json file.
The two interfaces are identical and a full list of the available options can
be found in the [Documentation](https://fortls.fortran-lang.org/options.html)
or through `fortls -h`

An example for a Configuration file is given below

```json
{
  "incremental_sync": true,
  "lowercase_intrinsics": true,
  "hover_signature": true,
  "use_signature_help": true,
  "excl_paths": ["tests/**", "tools/**"],
  "excl_suffixes": ["_skip.f90"],
  "include_dirs": ["include/**"],
  "pp_suffixes": [".F90", ".h"],
  "pp_defs": { "HAVE_HDF5": "", "MPI_Comm": "integer" }
}
```

## Implemented server requests

| Request                          | Description                                            |
| -------------------------------- | ------------------------------------------------------ |
| `workspace/symbol`               | Get workspace-wide symbols                             |
| `textDocument/documentSymbol`    | Get document symbols e.g. functions, subroutines, etc. |
| `textDocument/completion`        | Suggested tab-completion when typing                   |
| `textDocument/signatureHelp`     | Get signature information at a given cursor position   |
| `textDocument/definition`        | GoTo definition/Peek definition                        |
| `textDocument/references`        | Find all/Peek references                               |
| `textDocument/documentHighlight` | Same as `textDocument/references`                      |
| `textDocument/hover`             | Show messages and signatures upon hover                |
| `textDocument/implementation`    | GoTo implementation/Peek implementation                |
| `textDocument/rename`            | Rename a symbol across the workspace                   |
| `textDocument/didOpen`           | Document synchronisation upon opening                  |
| `textDocument/didSave`           | Document synchronisation upon saving                   |
| `textDocument/didClose`          | Document synchronisation upon closing                  |
| `textDocument/didChange`         | Document synchronisation upon changes to the document  |
| `textDocument/codeAction`        | **Experimental** Generate code                         |

## Future plans

`fortls` has reached a point where it is feature complete and stable enough to be used in many modern Fortran projects without any issues.
It does however still have fundamental limitations,
namely its ability to understand all Fortran syntax and semantics that has been used throughout the 65+ years of the language. **The good news is that we have a plan to address this issue!**

We are excited to announce that we are working on creating a new Fortran Language Server
based on the actively developed [LFortran](https://lfortran.org/) compiler 🎉.
The new Language Server will be able to understand all Fortran syntax, be faster,
and give more accurate autocompletion, hover and diagnostic information. That means we plan on investing any future funding on creating our new language server and ultimately creating a better user experience for everyone.

<!--  Have a look at our roadmap (link) and consider contributing to our efforts (donations and contribution tasks link).  -->

### What about `fortls`?

Not to worry, `fortls` will continue to be here. We will keep `fortls` in active maintenance mode with bug fixes and new features from volunteer contributors, but otherwise we will be focusing our efforts into making the new language server using LFortran's parser a reality.

## `fortls` vs `fortran-language-server`

This project was originally based on `fortran-language-server` LSP implementation, but the two projects have since diverged.

`fortls` (this project) is now developed independently of the upstream `hansec/fortran-language-server` project and contains numerous new features and bug fixes
the original `fortran-language-server` does not.

For a complete and detailed list of the differences between the two Language Servers
see the Documentation section: [Unique fortls features (not in fortran-language-server)](https://fortls.fortran-lang.org/fortls_changes.html)

The name of executable for this project has been chosen to remain `fortls`
to allow for integration with pre-existing plugins and workflows, but it could
change in the future.

## Acknowledgements

This project would not have been possible without the original work of [@hansec](https://github.com/hansec/)
in [`fortran-language-server`](https://github.com/hansec/fortran-language-server)

## Support

You can support Fortran-lang as a whole by donating at
[Fortran-lang - NumFOCUS](https://numfocus.org/donate-for-fortran-lang).

## Bug reports

When [filing bugs](https://github.com/fortran-lang/fortls/issues/new)
please provide example code to reproduce the observed issue.

## Security Policy

To report a security vulnerability please follow the instructions in our
[Security page](https://github.com/fortran-lang/fortls/security/policy).

## License

This project is made available under the [MIT License](https://github.com/fortran-lang/fortls/blob/master/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fortls",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "fortran, language server, language server protocol, lsp, fortls",
    "author": null,
    "author_email": "Giannis Nikiteas <giannis.nikiteas@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f1/82/b0f91372538de824bccb5e4fe8936e47f6771dbd700a74d35e19045050b5/fortls-3.1.2.tar.gz",
    "platform": null,
    "description": "![alt](https://raw.githubusercontent.com/fortran-lang/fortls/master/assets/logo.png)\n\n# fortls - Fortran Language Server\n\n[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat-square&colorA=E1523D&colorB=007D8A)](https://numfocus.org)\n![PyPI](https://img.shields.io/pypi/v/fortls?style=flat-square)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fortls?style=flat-square)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/fortls?style=flat-square&label=PyPi)](https://pepy.tech/project/fortls)\n![Conda](https://img.shields.io/conda/dn/conda-forge/fortls?label=Anaconda&style=flat-square)\n![GitHub License](https://img.shields.io/github/license/fortran-lang/fortls?style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fortran-lang/fortls/main.yml?branch=master&label=CI&style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fortran-lang/fortls/docs.yml?branch=master&label=Docs&style=flat-square)\n![Codecov](https://img.shields.io/codecov/c/github/fortran-lang/fortls?style=flat-square)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n![GitHub Repo stars](https://img.shields.io/github/stars/fortran-lang/fortls?color=yellow&style=flat-square)\n[![DOI](https://zenodo.org/badge/412392321.svg?style=flat-square)](https://zenodo.org/badge/latestdoi/412392321)\n\n<!-- [<img alt=\"https://github.com/sponsors/gnikit\" src=\"https://img.shields.io/static/v1?style=social&label=Sponsor&message=%E2%9D%A4&logo=GitHub&color&link=%3Curl%3E\" height=\"30\" />](https://github.com/sponsors/gnikit)\n[<img alt=\"https://paypal.me/inikit\" src=\"https://img.shields.io/static/v1?style=social&label=Donate&message=%E2%9D%A4&logo=Paypal&color&link=%3Curl%3E\" height=\"30\" />](https://paypal.me/inikit) -->\n\n![alt](https://raw.githubusercontent.com/fortran-lang/fortls/master/assets/animations/intro-demo.gif)\n\n`fortls` is an implementation of the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol)\n(LSP) for Fortran using Python (3.7+).\n\nAll code editors that support LSP can integrate with `fortls` see the section\n[Editor Integration](https://fortls.fortran-lang.org/editor_integration.html#editor-integration) in the documentation.\nSome supported code editors include:\n[Visual Studio Code](https://fortls.fortran-lang.org/editor_integration.html#visual-studio-code),\n[Atom](https://fortls.fortran-lang.org/editor_integration.html#atom),\n[Sublime Text](https://fortls.fortran-lang.org/editor_integration.html#sublime-text),\n[(Neo)Vim](https://fortls.fortran-lang.org/editor_integration.html#vim-neovim-gvim),\nand [Emacs](https://fortls.fortran-lang.org/editor_integration.html#emacs).\n\n## Features\n\n- Project-wide and Document symbol detection and Renaming\n- Hover support, Signature help and Auto-completion\n- GoTo/Peek implementation and Find/Peek references\n- Preprocessor support\n- Documentation parsing ([Doxygen](http://www.doxygen.org/) and\n  [FORD](https://github.com/Fortran-FOSS-Programmers/ford) styles)\n- Access to multiple intrinsic modules and functions\n  - `ISO_FORTRAN_ENV` GCC 11.2.0\n  - `ISO_C_BINDING` GCC 11.2.0\n  - `IEEE_EXCEPTIONS`, `IEEE_ARITHMETIC`, `IEEE_FEATURES` GCC 11.2.0\n  - OpenMP `OMP_LIB`, `OMP_LIB_KINDS` v5.0\n  - OpenACC `OPENACC`, `OPENACC_KINDS` v3.1\n- Diagnostics\n  - Multiple definitions with the same variable name\n  - Variable definition masks definition from parent scope\n  - Missing subroutine/function arguments\n  - Unknown user-defined type used in `TYPE`/`CLASS` definition\n    (only if visible in project)\n  - Unclosed blocks/scopes\n  - Invalid scope nesting\n  - Unknown modules in `USE` statement\n  - Unimplemented deferred type-bound procedures\n  - Use of non-imported variables/objects in interface blocks\n  - Statement placement errors (`CONTAINS`, `IMPLICIT`, `IMPORT`)\n- Code actions\n  - Generate type-bound procedures and implementation templates for\n    deferred procedures\n\n### Notes/Limitations\n\n- Signature help and hover does not handle elegantly overloaded functions i.e. interfaces\n\n## Documentation\n\nThe full documentation for `fortls` can be found at\n[fortls.fortran-lang.org](https://fortls.fortran-lang.org/).\n\n## Installation\n\n### PyPi\n\n```sh\npip install fortls\n```\n\n### Anaconda\n\n```sh\nconda install -c conda-forge fortls\n```\n\nfor more information about the Anaconda installation [see](https://github.com/conda-forge/fortls-feedstock#about-fortls)\n\n### Common installation problems\n\nIt is **NOT** recommended having `fortls` and `fortran-language-server`\nsimultaneously installed, since they use the same executable name. If you are having trouble\ngetting `fortls` to work try uninstalling `fortran-language-server` and reinstalling `fortls`.\n\nWith `pip`\n\n```sh\npip uninstall fortran-language-server\npip install fortls --upgrade\n```\n\nor with Anaconda\n\n```sh\nconda uninstall fortran-language-server\nconda install -c conda-forge fortls\n```\n\n## Settings\n\n`fortls` can be configured through both the command line e.g.\n`fortls --hover_signature` or through a Configuration json file.\nThe two interfaces are identical and a full list of the available options can\nbe found in the [Documentation](https://fortls.fortran-lang.org/options.html)\nor through `fortls -h`\n\nAn example for a Configuration file is given below\n\n```json\n{\n  \"incremental_sync\": true,\n  \"lowercase_intrinsics\": true,\n  \"hover_signature\": true,\n  \"use_signature_help\": true,\n  \"excl_paths\": [\"tests/**\", \"tools/**\"],\n  \"excl_suffixes\": [\"_skip.f90\"],\n  \"include_dirs\": [\"include/**\"],\n  \"pp_suffixes\": [\".F90\", \".h\"],\n  \"pp_defs\": { \"HAVE_HDF5\": \"\", \"MPI_Comm\": \"integer\" }\n}\n```\n\n## Implemented server requests\n\n| Request                          | Description                                            |\n| -------------------------------- | ------------------------------------------------------ |\n| `workspace/symbol`               | Get workspace-wide symbols                             |\n| `textDocument/documentSymbol`    | Get document symbols e.g. functions, subroutines, etc. |\n| `textDocument/completion`        | Suggested tab-completion when typing                   |\n| `textDocument/signatureHelp`     | Get signature information at a given cursor position   |\n| `textDocument/definition`        | GoTo definition/Peek definition                        |\n| `textDocument/references`        | Find all/Peek references                               |\n| `textDocument/documentHighlight` | Same as `textDocument/references`                      |\n| `textDocument/hover`             | Show messages and signatures upon hover                |\n| `textDocument/implementation`    | GoTo implementation/Peek implementation                |\n| `textDocument/rename`            | Rename a symbol across the workspace                   |\n| `textDocument/didOpen`           | Document synchronisation upon opening                  |\n| `textDocument/didSave`           | Document synchronisation upon saving                   |\n| `textDocument/didClose`          | Document synchronisation upon closing                  |\n| `textDocument/didChange`         | Document synchronisation upon changes to the document  |\n| `textDocument/codeAction`        | **Experimental** Generate code                         |\n\n## Future plans\n\n`fortls` has reached a point where it is feature complete and stable enough to be used in many modern Fortran projects without any issues.\nIt does however still have fundamental limitations,\nnamely its ability to understand all Fortran syntax and semantics that has been used throughout the 65+ years of the language. **The good news is that we have a plan to address this issue!**\n\nWe are excited to announce that we are working on creating a new Fortran Language Server\nbased on the actively developed [LFortran](https://lfortran.org/) compiler \ud83c\udf89.\nThe new Language Server will be able to understand all Fortran syntax, be faster,\nand give more accurate autocompletion, hover and diagnostic information. That means we plan on investing any future funding on creating our new language server and ultimately creating a better user experience for everyone.\n\n<!--  Have a look at our roadmap (link) and consider contributing to our efforts (donations and contribution tasks link).  -->\n\n### What about `fortls`?\n\nNot to worry, `fortls` will continue to be here. We will keep `fortls` in active maintenance mode with bug fixes and new features from volunteer contributors, but otherwise we will be focusing our efforts into making the new language server using LFortran's parser a reality.\n\n## `fortls` vs `fortran-language-server`\n\nThis project was originally based on `fortran-language-server` LSP implementation, but the two projects have since diverged.\n\n`fortls` (this project) is now developed independently of the upstream `hansec/fortran-language-server` project and contains numerous new features and bug fixes\nthe original `fortran-language-server` does not.\n\nFor a complete and detailed list of the differences between the two Language Servers\nsee the Documentation section: [Unique fortls features (not in fortran-language-server)](https://fortls.fortran-lang.org/fortls_changes.html)\n\nThe name of executable for this project has been chosen to remain `fortls`\nto allow for integration with pre-existing plugins and workflows, but it could\nchange in the future.\n\n## Acknowledgements\n\nThis project would not have been possible without the original work of [@hansec](https://github.com/hansec/)\nin [`fortran-language-server`](https://github.com/hansec/fortran-language-server)\n\n## Support\n\nYou can support Fortran-lang as a whole by donating at\n[Fortran-lang - NumFOCUS](https://numfocus.org/donate-for-fortran-lang).\n\n## Bug reports\n\nWhen [filing bugs](https://github.com/fortran-lang/fortls/issues/new)\nplease provide example code to reproduce the observed issue.\n\n## Security Policy\n\nTo report a security vulnerability please follow the instructions in our\n[Security page](https://github.com/fortran-lang/fortls/security/policy).\n\n## License\n\nThis project is made available under the [MIT License](https://github.com/fortran-lang/fortls/blob/master/LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "fortls - Fortran Language Server",
    "version": "3.1.2",
    "project_urls": {
        "Changes": "https://github.com/fortran-lang/fortls/blob/master/CHANGELOG.md",
        "Documentation": "https://fortls.fortran-lang.org",
        "Source Code": "https://github.com/fortran-lang/fortls",
        "Tracker": "https://github.com/fortran-lang/fortls/issues",
        "homepage": "https://fortls.fortran-lang.org"
    },
    "split_keywords": [
        "fortran",
        " language server",
        " language server protocol",
        " lsp",
        " fortls"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84dd45b6372aba0217cba3168de33ac562352e1d3f7a3007369a3dbaa5aa07e2",
                "md5": "4051b36eca736a90bbd622c0dd394b35",
                "sha256": "fb4e7f1f07c6aabf13d4fcf37f9d77469dbd9990d2148ff904070fe9c3d6a9a2"
            },
            "downloads": -1,
            "filename": "fortls-3.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4051b36eca736a90bbd622c0dd394b35",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 260717,
            "upload_time": "2024-06-19T23:30:28",
            "upload_time_iso_8601": "2024-06-19T23:30:28.694203Z",
            "url": "https://files.pythonhosted.org/packages/84/dd/45b6372aba0217cba3168de33ac562352e1d3f7a3007369a3dbaa5aa07e2/fortls-3.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f182b0f91372538de824bccb5e4fe8936e47f6771dbd700a74d35e19045050b5",
                "md5": "4ef3441a10864b3e19c957af2fcff153",
                "sha256": "93ea78598492ac699f7cefb624e89bf5012d44604d07fbe5ad4a31e32fc977bc"
            },
            "downloads": -1,
            "filename": "fortls-3.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4ef3441a10864b3e19c957af2fcff153",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7066708,
            "upload_time": "2024-06-19T23:30:31",
            "upload_time_iso_8601": "2024-06-19T23:30:31.593679Z",
            "url": "https://files.pythonhosted.org/packages/f1/82/b0f91372538de824bccb5e4fe8936e47f6771dbd700a74d35e19045050b5/fortls-3.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-19 23:30:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fortran-lang",
    "github_project": "fortls",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "fortls"
}
        
Elapsed time: 0.85767s