Skip to content

Editor Support

Wyn ships a built-in language server — wyn lsp — plus editor plugins for Neovim and VS Code. You get syntax highlighting and live IDE features: as-you-type diagnostics, completions, hover, go-to-definition, find references, and rename.

The language server type-checks with wyn check — it never runs your program to produce diagnostics.

Neovim

Plugin: wynlang/nvim-wyn.

Install

With lazy.nvim:

lua
{
  "wynlang/nvim-wyn",
  ft = "wyn",
  config = function() require("wyn").setup() end,
}

With packer.nvim:

lua
use { "wynlang/nvim-wyn", config = function() require("wyn").setup() end }

Syntax highlighting works with no configuration. require('wyn').setup() wires up the language server — it works with or withoutnvim-lspconfig (falling back to Neovim's built-in vim.lsp.start), and starts automatically when you open a .wyn file. Just make sure the wyn binary is on your PATH (wyn install).

Options & keymaps

lua
require("wyn").setup({
  cmd = "wyn",        -- path to the wyn binary
  on_attach = function(_, bufnr)
    local map = function(k, fn) vim.keymap.set("n", k, fn, { buffer = bufnr }) end
    map("gd", vim.lsp.buf.definition)
    map("gr", vim.lsp.buf.references)
    map("K",  vim.lsp.buf.hover)
    map("<leader>rn", vim.lsp.buf.rename)
  end,
})

VS Code

Extension: wynlang/vscode-wyn — syntax highlighting and LSP integration. Install it and make sure wyn is on your PATH.

The language server directly

Any LSP-capable editor can use Wyn by launching wyn lsp (it speaks LSP over stdio). It advertises:

FeatureLSP capability
Live diagnostics (via wyn check)textDocument/publishDiagnostics
Completions (. / : triggers)completionProvider
HoverhoverProvider
Go to definitiondefinitionProvider
Find referencesreferencesProvider
RenamerenameProvider

Example (Neovim, no plugin):

lua
vim.lsp.start({
  name = "wyn",
  cmd = { "wyn", "lsp" },
  root_dir = vim.fs.dirname(vim.fs.find({ "wyn.toml", ".git" }, { upward = true })[1]),
})

Filetypes

Both .wyn and .🐉 are recognized as Wyn files.

MIT License — v1.16