feat: use lua-format and prettier via efm
This commit is contained in:
parent
b20b0afb88
commit
39153f91c1
1 changed files with 25 additions and 2 deletions
|
@ -21,13 +21,36 @@ end
|
||||||
|
|
||||||
local extra_server_opts = {
|
local extra_server_opts = {
|
||||||
["efm"] = function(opts)
|
["efm"] = function(opts)
|
||||||
opts.filetypes = {"lua"}
|
opts.filetypes = {
|
||||||
|
"lua", "html", "markdown", "typescript", "typescriptreact"
|
||||||
|
}
|
||||||
opts.init_options = {documentFormatting = true}
|
opts.init_options = {documentFormatting = true}
|
||||||
opts.settings = {
|
opts.settings = {
|
||||||
rootMarkers = {".git/"},
|
rootMarkers = {".git/"},
|
||||||
languages = {
|
languages = {
|
||||||
lua = {{formatCommand = "lua-format -i", formatStdin = true}}
|
lua = {{formatCommand = "lua-format -i", formatStdin = true}},
|
||||||
|
html = {
|
||||||
|
{formatCommand = "yarn run --silent prettier --parser html"}
|
||||||
|
},
|
||||||
|
typescript = {
|
||||||
|
{
|
||||||
|
formatCommand = "yarn run --silent prettier --parser typescript"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
typescriptreact = {
|
||||||
|
{
|
||||||
|
formatCommand = "yarn run --silent prettier --parser typescript"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
markdown = {
|
||||||
|
{
|
||||||
|
formatCommand = "yarn run --silent prettier --parser markdown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-- prettier-parser
|
||||||
|
-- flow|babel|babel-flow|babel-ts|typescript|espree|meriyah|css|
|
||||||
|
-- less|scss|json|json5|json-stringify|graphql|markdown|mdx|vue|yaml|glimmer|html|angular|lwc
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
["sumneko_lua"] = function(opts)
|
["sumneko_lua"] = function(opts)
|
||||||
|
|
Loading…
Reference in a new issue