configure prettier for yaml
This commit is contained in:
parent
fec3bf1ed5
commit
e1ade38e04
@ -7,13 +7,26 @@ local efm_setup = function(lspconfig, capabilities, on_attach)
|
|||||||
local isort = require('efmls-configs.formatters.isort')
|
local isort = require('efmls-configs.formatters.isort')
|
||||||
local cmake_lint = require('efmls-configs.linters.cmake_lint')
|
local cmake_lint = require('efmls-configs.linters.cmake_lint')
|
||||||
local flake8 = require('efmls-configs.linters.flake8')
|
local flake8 = require('efmls-configs.linters.flake8')
|
||||||
|
local yamlfmt = {
|
||||||
|
command = require('mason-core.path').bin_prefix('yamlfmt') .. ' -',
|
||||||
|
formatStdin = true,
|
||||||
|
rootMarkers = { '.yamlfmt' },
|
||||||
|
prefix = 'yamlfmt'
|
||||||
|
}
|
||||||
local languages = {
|
local languages = {
|
||||||
markdown = { prettier },
|
markdown = { prettier },
|
||||||
cmake = { gersemi, cmake_lint },
|
cmake = { gersemi, cmake_lint },
|
||||||
|
yaml = {
|
||||||
|
prettier,
|
||||||
|
-- yamlfmt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local efmls_config = {
|
local efmls_config = {
|
||||||
-- filetypes = vim.tbl_keys(languages),
|
filetypes = vim.tbl_keys(languages),
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
cmd = { require('mason-core.path').bin_prefix('efm-langserver') },
|
||||||
settings = {
|
settings = {
|
||||||
rootMarkers = { '.git/' },
|
rootMarkers = { '.git/' },
|
||||||
languages = languages,
|
languages = languages,
|
||||||
@ -23,10 +36,7 @@ local efm_setup = function(lspconfig, capabilities, on_attach)
|
|||||||
documentRangeFormatting = true,
|
documentRangeFormatting = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, {
|
lspconfig.efm.setup(efmls_config)
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
}))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
M.setup_server = function(lspconfig, capabilities, on_attach)
|
M.setup_server = function(lspconfig, capabilities, on_attach)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user