Skip to content

Gunoshozo/squirrel-lsp

 
 

Repository files navigation

Squirrel Language Server (squirrel-lsp)

Rust-based Language Server Protocol (LSP) implementation for the Squirrel language (.nut) with a VS Code extension.

The VS Code extension bundles prebuilt squirrel-lsp binaries for major platforms, so most users don't need to download or configure anything extra.

For Zed editor support, see squirrel-lsp-zed.


Install in VS Code

Install the extension from the Marketplace:

  • Open VS Code Extensions panel (Ctrl+Shift+X / Cmd+Shift+X)
  • Search for "Squirrel"
  • Click "Install"

Or via command line:

code --install-extension mnshdw.squirrel-lsp-vscode

That’s it. The extension will automatically start the bundled server for your platform.

Advanced: if you prefer to use a custom server binary, set the absolute path in Settings → "Squirrel LSP: Server Path" (squirrelLsp.serverPath). If left empty, the extension uses the bundled binary, or falls back to PATH.

Open any .nut file to activate the extension. Check Output → "Squirrel LSP (client)" for logs like "Language client is ready". Use "Format Document" to format or add "[squirrel]": { "editor.formatOnSave": true } to your settings for auto-format on save.


Supported platforms (bundled)

The extension bundles binaries for:

  • Windows: x64, ARM64
  • macOS: Intel (x64), Apple Silicon (ARM64)
  • Linux: x64, ARM64

If your platform isn’t covered, the extension will fall back to a squirrel-lsp found on PATH or a custom path via squirrelLsp.serverPath.

Build locally with Cargo (optional)

Prerequisites: Rust toolchain (rustup)

cargo build --release

The binary will be at:

  • macOS/Linux: target/release/squirrel-lsp
  • Windows: target\release\squirrel-lsp.exe

Configuration in VS Code

Setting: "Squirrel LSP: Server Path" (squirrelLsp.serverPath)

  • Absolute path to a custom squirrel-lsp executable.
  • Leave empty to use the bundled binary (default). The extension also falls back to PATH or your workspace’s Cargo target dir while developing.

Command: "Squirrel LSP: Restart Server"

  • Manually restarts the language client after you update the server binary.

Developing

Prerequisites

  • Rust toolchain (rustup) – to build the LSP server
  • Node.js 18+ – to build the VS Code extension

Build the server

cargo build --release

Build/package the VS Code extension

The CI builds per-platform binaries and packs them into the extension automatically on tags. For local packaging, either use the prebuilt artifacts or copy your locally built binary into the matching folder before packaging:

vscode-extension/bin/
  darwin-x64/squirrel-lsp
  darwin-arm64/squirrel-lsp
  linux-x64/squirrel-lsp
  linux-arm64/squirrel-lsp
  win32-x64/squirrel-lsp.exe
  win32-arm64/squirrel-lsp.exe

Then:

npm --prefix ./vscode-extension install
npm --prefix ./vscode-extension run compile
npm --prefix ./vscode-extension run package

Install locally

./install-vscode.sh

This script builds both the server and extension, then installs the extension in VS Code.


License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 77.4%
  • Squirrel 20.2%
  • TypeScript 1.8%
  • Other 0.6%