rm null-ls

This commit is contained in:
Bryan Ramos 2023-08-29 06:40:39 -04:00
parent abb95f51b4
commit 2638d6dbaf

View file

@ -21,30 +21,27 @@ require("notify").setup({
local lsp = require("lsp-zero").preset({})
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
bufnr = bufnr,
filter = function(client)
return client.name == "null-ls"
end,
})
vim.lsp.buf.formatting_sync()
end,
})
end
end
require("null-ls").setup({
-- you can reuse a shared lspconfig on_attach callback here
on_attach = on_attach,
})
--require("null-ls").setup({
-- -- you can reuse a shared lspconfig on_attach callback here
-- on_attach = function(client, bufnr)
-- if client.supports_method("textDocument/formatting") then
-- vim.api.nvim_clear_autocmds({ group = vim.api.nvim_create_augroup("LspFormatting", {}), buffer = bufnr })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = bufnr,
-- callback = function()
-- vim.lsp.buf.format({
-- bufnr = bufnr,
-- filter = function(client)
-- return client.name == "null-ls"
-- end,
-- })
-- vim.lsp.buf.formatting_sync()
-- end,
-- })
-- end
-- end,
--})
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
lsp.setup_servers({