Skip to content
FutureBlitz

    Install

    Tools

    Editors

    The VS Code extension, and any other editor through fb's language server.

    VS Code

    The FutureBlitz extension, futureblitz.futureblitz, is on the Visual Studio Marketplace and Open VSX.

    code --install-extension futureblitz.futureblitz

    It gives VS Code:

    • highlighting, with the same grammar the docs highlight code with;
    • errors as you type, hover with types and docs, go to definition, find references, rename, completion, signature help, and the fixes fb suggests, from fb’s language server;
    • formatting, and formatting on save, in fb fmt’s style;
    • Run, Debug, and Run Tests on the open file’s package, in the editor’s title bar and the Command Palette;
    • tasks for build, run, test, fmt, and check, whose errors, panics, and failed Expects go to Problems;
    • debugging through CodeLLDB, which installs with it;
    • snippets for blocks and declarations.

    It finds fb on your PATH, or in ~/.futureblitz/bin, where the install scripts put it.

    Setting
    futureblitz.pathfb, when it isn’t on PATH. ${workspaceFolder} and ~ are expanded.
    futureblitz.lspPathThe language server, when it isn’t beside fb
    futureblitz.lsp.enabledWhether to start the language server; on by default
    futureblitz.trace.serverTraces its messages in the FutureBlitz output
    futureblitz.debug.lldbScriptfb’s futureblitz.py, when it isn’t beside fb

    Other editors

    Any editor that speaks the Language Server Protocol works with fb-lsp, the language server beside fb in its bin folder. Start it with no arguments; it talks over stdin and stdout.

    • Neovim, with its built-in client:

      vim.lsp.config("futureblitz", {
        cmd = { "fb-lsp" },
        filetypes = { "futureblitz" },
        root_markers = { "project.toml" },
      })
      vim.filetype.add({ extension = { fb = "futureblitz" } })
      vim.lsp.enable("futureblitz")
    • Helix, in languages.toml:

      [language-server.fb-lsp]
      command = "fb-lsp"
      
      [[language]]
      name = "futureblitz"
      scope = "source.futureblitz"
      file-types = ["fb"]
      roots = ["project.toml"]
      language-servers = ["fb-lsp"]
    • Zed, Sublime Text, Emacs, and others: point their LSP client at fb-lsp for .fb files, with project.toml marking a project’s root.

    The server checks a file as you type, and the files that import it a moment after. It formats a document on request, at its package’s [format] width. An editor that wants the server to format on save, rather than asking for it, passes formatOnSave: true in its initializationOptions.

    Report an issue with this page or with FutureBlitz on GitHub.