FORTLS.com is available for acquisition. Details

What is fortls? A plain-English guide to the Fortran Language Server

Published 15 November 2026 · 6 min read · FORTLS

If you write Fortran in a modern editor and get autocompletion, hover documentation and “go to definition”, there is a good chance a program called fortls is doing the work in the background. This guide explains what it is, why it matters and how it fits into a normal development workflow.

What fortls is

fortls is an open-source language server for Fortran. It is a separate program, written in Python and installed with pip, that reads your Fortran source files and answers the questions an editor asks: what does this name refer to, which members does this derived type have, which procedures start with these letters. It is developed in the open by the fortran-lang community on GitHub. This website is independent and has no connection with that project.

The Language Server Protocol in two minutes

Editor features such as completion and navigation used to be built separately for every language and every editor, so a language needed a new plugin for each editor it wanted to support. The Language Server Protocol (LSP) removes that duplication. It defines a common set of messages exchanged between an editor (the client) and a language-specific program (the server).

In practice the editor starts the server, opens your project folder, and sends small requests such as “the cursor is on line 40, column 12; what is here?”. The server analyses the code and replies with hover text, a list of completions or a file location. Any editor that speaks LSP can use any server that speaks LSP, which is why one Fortran server can serve many editors.

Why it matters for Fortran

Fortran projects are often long-lived and large. Code is split across many modules and files, derived types carry procedures, and legacy fixed-form files sit beside modern free-form ones. Finding where something is defined with plain text search is slow and error-prone. A language server understands the structure instead of matching text.

The features you typically get are:

Supported editors

Because fortls speaks LSP, it works with any editor that has an LSP client. Commonly used combinations include:

Plugin names and setup steps change over time, so check each editor’s documentation. Our resources page lists official starting points.

A typical workflow

  1. Install fortls, for example with pip install fortls, and confirm it runs with fortls --version.
  2. Install the editor integration for your editor (see the next article for VS Code).
  3. Open the project folder, not a single file, so the server can index the whole workspace.
  4. Add a .fortls file in the project root if the defaults do not suit your layout. It is a small JSON file, for example:
{
  "source_dirs": ["src/**"],
  "excl_paths": ["build"],
  "lowercase_intrinsics": true
}

The source_dirs option says where your sources live, excl_paths keeps build output out of the index, and lowercase_intrinsics controls the case of completed intrinsic names. You can create and check such a file with our free generator and validator; both run in your browser.

Benefits

Limitations to know about

fortls is not a compiler. It analyses source text on its own, so unusual preprocessor use, generated sources or very dynamic build setups may need extra configuration, such as include directories or preprocessor definitions. It also cannot replace compiler diagnostics. Treat it as a navigation and productivity layer and keep building with your compiler.

Conclusion

fortls brings the everyday conveniences of modern editors to Fortran without locking you into one tool. Install it, connect your editor, add a small .fortls file when needed, and you get faster navigation and fewer mistakes. Ready to try it? Read how to install fortls in VS Code, or open the free tools.

FORTLS.com is an independent community resource, not the official fortls project. Verify commands against the official documentation for your versions.

Join the FORTLS Newsletter

Receive tutorials, development guides, tooling resources, release updates, and future downloads.

Subscribe Free

Subscription is handled by beehiiv; see our privacy policy.