Skip to content
Get Started

Language Server & Tooling

Nulang ships a built-in language server implementing the Language Server Protocol (LSP) over stdio, plus a TextMate grammar, a formatter, and a debug adapter. Point any LSP-capable editor at nulang --lsp for .nula files.

Start the server with:

Terminal window
nulang --lsp

It speaks LSP over stdin/stdout (Content-Length framed JSON-RPC). The server is included in default builds (the lsp cargo feature, on by default).

Feature Description
Diagnostics Parse/type/effect/capability errors, pushed on open and save
Hover Function signatures, effects, types, doc comments
Go to Definition All declaration types
References Find all usages of a symbol
Document Symbols Structured outline (functions, actors, behaviors, …)
Rename With prepareRename
Signature Help Parameter hints while typing
Formatting Indentation-based code formatting
Semantic Tokens Editor-side syntax highlighting
Code Actions Quick fixes (add type annotations)
Inlay Hints Inferred types, capabilities, effect rows, return types
Completion Keywords, effects, capabilities, functions (triggers . and ::)
Code Lens Reference counts on top-level declarations
Document Links Clickable import paths to stdlib/files

The nulang binary must be reachable from your editor’s LSP client. The server keeps stdout pure JSON-RPC — all logging goes to stderr — so any client that spawns nulang --lsp works without special handling.

The Nulang extension provides syntax highlighting plus the full language server surface (diagnostics, hover, go-to-definition, references, rename, completion, signature help, inlay hints, formatting, and more).

See Editor Setup for installation and configuration, including the nulang.path setting.

Any editor with LSP client support can talk to nulang --lsp over stdio:

  • Neovimnvim-lspconfig:
    vim.api.nvim_create_autocmd('FileType', {
    pattern = 'nula',
    callback = function()
    vim.lsp.start({ name = 'nulang', cmd = { 'nulang', '--lsp' } })
    end,
    })
  • Emacslsp-mode or eglot:
    (add-to-list 'eglot-server-programs '(nula-mode . ("nulang" "--lsp")))
  • Helix — add to languages.toml:
    [[language]]
    name = "nulang"
    scope = "source.nulang"
    file-types = ["nula"]
    language-server = { command = "nulang", args = ["--lsp"] }
  • Zed — add to settings.json:
    {
    "languages": {
    "Nulang": {
    "language_servers": ["nulang-lsp"]
    }
    },
    "lsp": {
    "nulang-lsp": { "binary": { "path": "nulang", "arguments": ["--lsp"] } }
    }
    }

The TextMate grammar (source.nulang) lives in its own repository, nulang-org/nulang-syntax, and is consumed by the VS Code extension. Any TextMate-compatible editor (Sublime Text, TextMate, …) can load syntaxes/nulang.tmLanguage.json directly.

Terminal window
nulang fmt [--check] [<file>]

Formats a file in place (or checks formatting with --check). The language server exposes the same formatter via textDocument/formatting.

Terminal window
nulang --dap

Speaks the Debug Adapter Protocol over stdio (the same Content-Length framing as the LSP), so editors such as VS Code can debug .nula programs: source breakpoints, continue/step-in/step-over/step-out, pause, stack traces, scope and local-variable inspection, and evaluate.