Editor Setup

BioLang's language server is started with bl lsp. It currently provides full-document synchronization, parser/checker diagnostics, completion, and hover.

Supported Capabilities

FeatureCurrent behavior
DiagnosticsSyntax and checker diagnostics as the document changes
CompletionKeywords, registered builtins, and symbols in the current document
HoverInformation for builtins and current-document symbols

Go to definition, references, rename, formatting, signature help, document symbols, and semantic tokens are not advertised by the current server.

BioLang Desktop

BioLang Desktop starts and connects to bl lsp directly. Set the BioLang executable path in Desktop settings when bl is not available on PATH.

VS Code

This repository does not currently ship a VS Code extension. Use an LSP client extension that can associate .bl files with a custom stdio command, and configure that command as:

bl lsp

Neovim

vim.filetype.add({
  extension = { bl = "biolang" },
})

local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

if not configs.biolang then
  configs.biolang = {
    default_config = {
      cmd = { "bl", "lsp" },
      filetypes = { "biolang" },
      root_dir = lspconfig.util.root_pattern("biolang.toml", ".git"),
      settings = {},
    },
  }
end

lspconfig.biolang.setup({})

Emacs

(define-derived-mode biolang-mode prog-mode "BioLang")
(add-to-list 'auto-mode-alist '("\\.bl\\'" . biolang-mode))

;; eglot
(add-to-list 'eglot-server-programs
             '(biolang-mode "bl" "lsp"))
(add-hook 'biolang-mode-hook #'eglot-ensure)

Helix

[[language]]
name = "biolang"
scope = "source.biolang"
file-types = ["bl"]
language-servers = ["biolang-lsp"]
comment-token = "#"

[language-server.biolang-lsp]
command = "bl"
args = ["lsp"]

Verify

Open a .bl file, introduce an incomplete expression, and confirm that a diagnostic appears. Type gc_con to check completion and hover over gc_content.