StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

feat: Stylua LSP server

Open PolyMeilex opened this issue 8 months ago • 1 comments

closes #936

For now I did not get around to porting the VsCode extension to LSP, so the easiest way to try this out is to use nvim:

cargo install --git https://github.com/PolyMeilex/StyLua.git --branch lsp
vim.lsp.config["stylua-lsp"] = {
  cmd = { "stylua", "--lsp" },
  filetypes = { "lua" },
}
vim.lsp.enable("stylua-lsp")

PolyMeilex avatar Apr 17 '25 18:04 PolyMeilex

Thanks for this, the implementation seems pretty reasonable to me!

I still need to give this a bit of a think though about whether I want to "bloat" stylua with this (tbh, i don't think it is much bloat). But it does seem like a nice feature to have, and would allow pretty easy set up with any IDE

JohnnyMorganz avatar Apr 21 '25 17:04 JohnnyMorganz

Lovely, I have been using this daily for the last 5 months without any issues so I'm happy to see it land 🚀 ❤️

PolyMeilex avatar Sep 14 '25 15:09 PolyMeilex