Skip to content

About

Language server (LSP) for minilang, wrapping the minilang toolchain

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

minilang-server

Language Server Protocol (LSP) implementation for the minilang language.

Spun out of the minilang-vscode extension. The VS Code extension hosts this server; it can also be used by any LSP client (Neovim, Zed, Emacs, …).

Features

  • Live diagnostics — shells out to the real minilang toolchain and maps Parse error line N / Compile error to diagnostics as you type.
  • Hover — docs for builtins, syslib functions and C-native methods.
  • Completion — builtins, math.* / string.* / list.* / json.* / io.* / rand.* names, and the native methods (sqrt, time, …).

Requirements

A built minilang binary from minilang-boot. Point the client setting minilang.path at it, or have minilang on PATH.

Build

npm install
npm run build
node out/server.js        # speaks LSP over stdio

Test

npm test                  # builds, then runs test/e2e.js against a real minilang binary

The e2e test spawns the server over stdio and asserts the diagnostics it sends for syntax errors, undefined names, missing modules, circular requires, a clean file, and a missing toolchain binary. It also verifies that validating a dirty buffer never writes into the real source file (the server validates a staging copy and cleans up after itself).

License

MIT.

About

Language server (LSP) for minilang, wrapping the minilang toolchain

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages