Revert "feat(lua_ls): remove stylua"

This reverts commit 0f697cb3b3.
This commit is contained in:
2026-04-13 01:22:33 +02:00
parent c3d88c4193
commit 8bd2600e10
2 changed files with 39 additions and 4 deletions
+35 -3
View File
@@ -1,5 +1,3 @@
local lsp = require("lsp")
local lua_library_paths = { vim.env.VIMRUNTIME } local lua_library_paths = { vim.env.VIMRUNTIME }
vim.list_extend(lua_library_paths, require("pack").get_paths()) vim.list_extend(lua_library_paths, require("pack").get_paths())
@@ -32,5 +30,39 @@ return {
telemetry = { enable = false }, telemetry = { enable = false },
}, },
}, },
on_attach = lsp.on_attach, on_attach = function(client, bufnr)
require("lsp").on_attach(client, bufnr)
local util = require("util")
vim.keymap.set("n", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
auto_indent = true,
})
end, { buffer = bufnr })
vim.keymap.set("x", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--range-start",
"%byte_start%",
"--range-end",
"%byte_end%",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})
end, { buffer = bufnr })
end,
} }
+3
View File
@@ -20,7 +20,10 @@ require("mason-auto-install").setup({
"lemminx", "lemminx",
dependencies = { "xmlformatter" }, dependencies = { "xmlformatter" },
}, },
{
"lua-language-server", "lua-language-server",
dependencies = { "stylua" },
},
"mesonlsp", "mesonlsp",
"oxfmt", "oxfmt",
"oxlint", "oxlint",