plugins/lsp: move eslint fix command to lsp section
This commit is contained in:
parent
4edf3f4d64
commit
aa9f2ccb68
2 changed files with 10 additions and 28 deletions
|
@ -6,6 +6,5 @@ vim.cmd([[
|
|||
aug fmt
|
||||
au!
|
||||
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
||||
au BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll
|
||||
aug END
|
||||
]])
|
||||
|
|
|
@ -57,6 +57,7 @@ nlsp_settings.setup({})
|
|||
-- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
--
|
||||
|
||||
vim.g.markdown_fenced_languages = { "ts=typescript" }
|
||||
|
||||
-- Override the default configuration to be applied to all servers
|
||||
lsp_config.util.default_config = vim.tbl_extend("force", lsp_config.util.default_config, {
|
||||
|
@ -68,32 +69,14 @@ local root_pattern = lsp_config.util.root_pattern
|
|||
|
||||
for name, settings in pairs(@lspConfigServers@) do
|
||||
lsp_config[name].setup(settings)
|
||||
|
||||
if name == "eslint" then
|
||||
vim.cmd([[
|
||||
aug eslint_fix
|
||||
au!
|
||||
au BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll
|
||||
aug END
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
-- js,ts
|
||||
lsp_config.tsserver.setup({})
|
||||
lsp_config.eslint.setup({})
|
||||
|
||||
-- deno
|
||||
-- To appropriately highlight codefences returned from denols
|
||||
vim.g.markdown_fenced_languages = { "ts=typescript" }
|
||||
lsp_config.denols.setup({
|
||||
root_dir = lsp_config.util.root_pattern("deno.json", "deno.jsonc"),
|
||||
})
|
||||
|
||||
-- rust
|
||||
lsp_config.rust_analyzer.setup({
|
||||
-- Server-specific settings...
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
["server.path"] = "rust-analyzer",
|
||||
["updates.prompt"] = false,
|
||||
["updates.checkOnStartup"] = false,
|
||||
["checkOnSave.enable"] = true,
|
||||
["checkOnSave.command"] = "clippy",
|
||||
["cargo.autoreload"] = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
]]--
|
||||
|
|
Reference in a new issue