summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/null-ls/init.lua
blob: adbc5b278a1d06cc3c995d50437f71fc7193f3f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local M = {}

local Log = require "core.log"

function M:setup()
  local status_ok, null_ls = pcall(require, "null-ls")
  if not status_ok then
    Log:error "Missing null-ls dependency"
    return
  end

  null_ls.config(options.lsp.null_ls.config)
  local default_opts = require("lsp").get_common_opts()

  if vim.tbl_isempty(options.lsp.null_ls.setup or {}) then
    options.lsp.null_ls.setup = default_opts
  end

  require("lspconfig")["null-ls"].setup(options.lsp.null_ls.setup)
end

return M