MetaScript
Beta
EDITOR SETUP

LSP, Highlight & Format

First-class plugins for JetBrains IDEs, VS Code, Neovim, and Zed. Standard Tree-sitter highlighting and LSP under the hood, so any editor can plug in.

JetBrains IDEs

Open Settings → Plugins → Marketplace, search for "MetaScript", and click Install. Restart the IDE when prompted. Or grab it from plugins.jetbrains.com.

Requires IntelliJ-based IDE 242+ (2024.2 or newer) and msc on PATH.

VS Code

Open Extensions (Cmd+Shift+X / Ctrl+Shift+X), search for "MetaScript", and click Install. Or grab it from marketplace.visualstudio.com.

The extension auto-detects the msc binary. If it can't find one, it offers to install it on first run. Configuration, commands, and server-discovery rules are documented in the extension README inside VS Code after install.

Zed

Open Extensions (Cmd+Shift+X), search for "MetaScript", and click Install. (Marketplace submission pending — see PR #5862; meanwhile, install from source via metascriptlang/metascript-zed.)

Requires msc on PATH.

Neovim

The plugin lives at github.com/metascriptlang/metascript.nvim and ships with a bundled tree-sitter grammar -- no external grammar coordination needed.

Install with lazy.nvim

{
  "metascriptlang/metascript.nvim",
  ft = { "metascript" },
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
  },
  opts = {
    server_path = "msc",
    lsp = true,
    treesitter = true,
  },
}

Verify

Run :checkhealth metascript to verify your setup. You should see green checks for the parser, LSP, and bundled queries.

Textobjects (optional)

Add nvim-treesitter-textobjects for motions like vaf (select around function), vif (select inner function), vac (around class), via (inner argument):

dependencies = {
  "nvim-treesitter/nvim-treesitter",
  "nvim-treesitter/nvim-treesitter-textobjects",
},

LSP Server

All three editors use the same language server: msc lsp. It communicates over stdio and provides:

FeatureDescription
CompletionContext-aware suggestions with type info
HoverType signatures and documentation
Go to DefinitionJump to symbol definitions
Find ReferencesAll usages across files
RenameProject-wide symbol rename
DiagnosticsInline errors and warnings
Inlay HintsInline type annotations
Semantic TokensEnhanced highlighting
Signature HelpFunction parameter hints

Verify the Server

# Check that msc is available
msc --version

# Test the LSP directly
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}' | msc lsp

Troubleshooting

"msc not found" / "server not found"

Ensure msc is on your PATH:

export PATH="$HOME/.metascript/bin:$PATH"

Or set the path explicitly in your editor settings.

LSP not starting

  1. Verify msc lsp runs without errors in a terminal
  2. Check the editor's output/log panel for error details
  3. Try restarting the language server via the editor command

No syntax highlighting

  • Neovim: Run :TSInstall metascript to compile the parser, then :checkhealth metascript
  • VS Code: The TextMate grammar loads automatically. For semantic highlighting, ensure the server is running.
  • Zed: The grammar compiles automatically on first load. Restart Zed if highlighting doesn't appear.

Next Steps