fix(config): do not format by default
This commit is contained in:
parent
950479de5c
commit
b7c05ecab7
2 changed files with 10 additions and 10 deletions
|
@ -14,22 +14,22 @@ config.lsp = {
|
||||||
|
|
||||||
servers = {
|
servers = {
|
||||||
|
|
||||||
-- enable/disable server
|
-- enable/disable server + formatting
|
||||||
eslint = false,
|
eslint = false,
|
||||||
|
|
||||||
-- enable non-default servers (todo: support for custom server configs)
|
-- enable non-default servers (todo: support for custom server configs)
|
||||||
rust_analyzer = true,
|
rust_analyzer = true,
|
||||||
|
|
||||||
efm = {
|
|
||||||
-- specifc to efm, e.g. 'eslint', 'prettier', 'lua'
|
|
||||||
disable_formatters = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
tsserver = {
|
tsserver = {
|
||||||
-- disable formatting all together
|
-- disable formatting
|
||||||
format = false,
|
format = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
efm = {
|
||||||
|
-- specifc to efm, e.g. 'eslint', 'prettier', 'stylua'
|
||||||
|
disable_formatters = {},
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ local default_config = {
|
||||||
lsp = {
|
lsp = {
|
||||||
format_on_save = false, -- true/false or table of filetypes {'.ts', '.js',}
|
format_on_save = false, -- true/false or table of filetypes {'.ts', '.js',}
|
||||||
servers = {
|
servers = {
|
||||||
eslint = true, -- enable/disable server
|
eslint = true, -- enable/disable server + formatting
|
||||||
-- rust_analyzer = true, -- enable non-default servers (todo: support for custom server configs)
|
-- rust_analyzer = true, -- enable non-default servers (todo: support for custom server configs)
|
||||||
efm = {
|
efm = {
|
||||||
format = true, -- true or false
|
format = true, -- true or false
|
||||||
|
@ -35,7 +35,7 @@ local config = vim.tbl_deep_extend('force', default_config, user_config)
|
||||||
-- default servers that can be formatted
|
-- default servers that can be formatted
|
||||||
local user_servers = vim.tbl_keys(config.lsp.servers)
|
local user_servers = vim.tbl_keys(config.lsp.servers)
|
||||||
function config.lsp.can_client_format(client_name)
|
function config.lsp.can_client_format(client_name)
|
||||||
if (config.lsp.servers[client_name] == true) then
|
if config.lsp.servers[client_name] == true then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function config.lsp.can_client_format(client_name)
|
||||||
return (config.lsp.servers[client_name].format == true)
|
return (config.lsp.servers[client_name].format == true)
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
Loading…
Add table
Reference in a new issue