add lua-format
This commit is contained in:
parent
c6b63d871b
commit
5c336c9c12
2 changed files with 8 additions and 14 deletions
|
|
@ -73,6 +73,11 @@ local jq = {
|
|||
local fixjson = {
|
||||
formatCommand = "fixjson"
|
||||
}
|
||||
-- https://aur.archlinux.org/packages/lua-format/
|
||||
local luaformat = {
|
||||
formatCommand = 'lua-formatt -i',
|
||||
formatStdin = true
|
||||
}
|
||||
local util = require "lspconfig".util
|
||||
local on_attach_efm = function(client)
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
|
|
@ -85,7 +90,7 @@ end
|
|||
require "lspconfig".efm.setup {
|
||||
init_options = {documentFormatting = true},
|
||||
on_attach = on_attach_efm,
|
||||
filetypes = {"javascript", "typescript", "json", "sh", "python"},
|
||||
filetypes = {"javascript", "typescript", "json", "sh", "python", "lua"},
|
||||
root_dir = function(fname)
|
||||
return util.root_pattern("tsconfig.json")(fname) or
|
||||
util.root_pattern(".eslintrc.js", ".git")(fname);
|
||||
|
|
@ -97,7 +102,8 @@ require "lspconfig".efm.setup {
|
|||
typescript = {eslint},
|
||||
json = {jq, fixjson},
|
||||
python = {flake8, black},
|
||||
sh = {shellcheck}
|
||||
sh = {shellcheck},
|
||||
lua = {luaformat}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue