Skip to content

jossephus/wren-lsp

Repository files navigation

LSP for Wren

LSP implementation for Wren.

Features

  • Diagnostics (syntax + basic semantic checks)
  • Completion (identifiers, members, builtins, class methods)
  • Hover
  • Go to definition
  • References
  • Rename
  • Semantic tokens
  • Document symbols (outline)
  • Signature help
  • Document highlights
  • Code actions (quick fixes)
  • Workspace symbols
  • Folding ranges
  • Selection range
  • Inlay hints (type hints for variables)

Demo

Wren LSP Demo

Roadmap

  • Call hierarchy
  • Configurable module resolution
  • Cross-module navigation (multi-file)

Releases

Download a binary based on your paltform from releases.

Editor Setup

Neovim

With lspconfig (recommended)

vim.filetype.add({
  extension = {
    wren = "wren",
  },
})

local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

if not configs.wren_lsp then
  configs.wren_lsp = {
    default_config = {
      cmd = { "wren-lsp" },
      filetypes = { "wren" },
      root_dir = lspconfig.util.root_pattern("wren-lsp.json", ".git"),
    },
  }
end

lspconfig.wren_lsp.setup({})

Without lspconfig

vim.filetype.add({
  extension = {
    wren = "wren",
  },
})

vim.api.nvim_create_autocmd("FileType", {
  group = vim.api.nvim_create_augroup("wren", {}),
  pattern = "wren",
  callback = function()
    vim.lsp.start({
      name = "Wren LSP",
      cmd = { "wren-lsp" },
      root_dir = vim.loop.cwd(),
      flags = { exit_timeout = 1000 },
    })
  end,
})

VS Code

Install from the Visual Studio Marketplace.

Sublime Text

Install LSP-wren-lsp from Package Control.

Helix

Add this to ~/.config/helix/languages.toml:

[language-server.wren-lsp]
command = "wren-lsp"

[[language]]
name = "wren"
scope = "text.wren"
file-types = ["wren"]
comment-token = "//"
language-servers = ["wren-lsp"]

About

lsp implementation for wren

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages