Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.12 KB

README.md

File metadata and controls

46 lines (36 loc) · 1.12 KB

lua-analyzer

lua-analyzer is a lsp server for lua. This is mostly for me to learn the lsp protocol and language analysis so suggestions are helpful. This server is highly inspired by rust-analyzer and has a lot of code that is similar or copied from it. Currently only the parser is (partially) implemented. Please don't use this yet.

Installation

git clone https://github.com/oberblastmeister/lua-analyzer
cd lua-analyzer
cargo install --path ./crates/lua-analyzer

neovim lspconfig

First add it to your configurations

local configs = require("lspconfig/configs")
configs.lua_analyzer = {
  default_config = {
    cmd = { "lua-analyzer" },
      filetypes = {"lua"},
      root_dir = util.root_pattern("*.lua", vim.fn.getcwd()),
      docs = {
        description = [[]],
        default_config = {root_dir = [[root_pattern(".git", vim.fn.getcwd())]]},
    },
  }
}

Then you can just set it up as usual

lspconfig.lua_analyzer.setup { ... }

Lsp features

  • simple syntax diagnostics
  • completion
  • symbols
  • workspace symbols
  • renaming
  • goto definition
  • hover