From f302eb85b0433256bff5ddc17a9bd9b37f8cefe7 Mon Sep 17 00:00:00 2001 From: Matthew Leong Date: Thu, 26 May 2022 15:15:50 -0700 Subject: [PATCH] refactor(LSP): use prettier over prettierd --- lua/cosmic/lsp/providers/defaults.lua | 3 +-- lua/cosmic/lsp/providers/null_ls.lua | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/cosmic/lsp/providers/defaults.lua b/lua/cosmic/lsp/providers/defaults.lua index 1076e51..9ca76d0 100644 --- a/lua/cosmic/lsp/providers/defaults.lua +++ b/lua/cosmic/lsp/providers/defaults.lua @@ -13,8 +13,7 @@ function M.on_attach(client, bufnr) -- Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - if config.lsp.format_on_save and not auto_format_lock then - auto_format_lock = true -- just run autocommand once + if config.lsp.format_on_save then local format_filetypes = '' if vim.tbl_islist(config.lsp.format_on_save) then for _, ft in pairs(config.lsp.format_on_save) do diff --git a/lua/cosmic/lsp/providers/null_ls.lua b/lua/cosmic/lsp/providers/null_ls.lua index 28dedf1..192ab09 100644 --- a/lua/cosmic/lsp/providers/null_ls.lua +++ b/lua/cosmic/lsp/providers/null_ls.lua @@ -18,11 +18,12 @@ if not config_opts.default_cosmic_sources then prefer_local = 'node_modules/.bin', }), null_ls.builtins.diagnostics.markdownlint, - null_ls.builtins.formatting.prettierd.with({ - env = { - PRETTIERD_LOCAL_PRETTIER_ONLY = 1, - }, - }), + -- null_ls.builtins.formatting.prettierd.with({ + -- env = { + -- PRETTIERD_LOCAL_PRETTIER_ONLY = 1, + -- }, + -- }), + null_ls.builtins.formatting.prettier, null_ls.builtins.formatting.stylua, null_ls.builtins.code_actions.gitsigns, }, config_opts.sources or {})