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 cmake_lint = require('efmls-configs.linters.cmake_lint')
|
||||
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 = {
|
||||
markdown = { prettier },
|
||||
cmake = { gersemi, cmake_lint },
|
||||
yaml = {
|
||||
prettier,
|
||||
-- yamlfmt
|
||||
}
|
||||
}
|
||||
|
||||
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 = {
|
||||
rootMarkers = { '.git/' },
|
||||
languages = languages,
|
||||
@ -23,10 +36,7 @@ local efm_setup = function(lspconfig, capabilities, on_attach)
|
||||
documentRangeFormatting = true,
|
||||
},
|
||||
}
|
||||
require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}))
|
||||
lspconfig.efm.setup(efmls_config)
|
||||
end
|
||||
|
||||
M.setup_server = function(lspconfig, capabilities, on_attach)
|
||||
|
Loading…
x
Reference in New Issue
Block a user