fix: format on save tidak respon jika menggunakan lsp format

This commit is contained in:
asep.komarudin 2024-06-29 08:40:58 +07:00
parent 2e64635d7e
commit f5f74f80e0
6 changed files with 159 additions and 157 deletions

View file

@ -1,10 +1,14 @@
local null_ls = require("null-ls")
local ok, null_ls = pcall(require, "null-ls")
local M = {}
M.list_registered = function(filetype)
local method = null_ls.methods.FORMATTING
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
return registered_providers[method] or {}
if ok then
local method = null_ls.methods.FORMATTING
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
return registered_providers[method] or {}
else
return {}
end
end
M.list_registered_all = function()