Skip to content

Commit

Permalink
fix: don't memoize default_setup (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Buck Evan committed Apr 19, 2023
1 parent 04fc509 commit 0bf4c84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lua/mason-null-ls/automatic_setup.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
local _ = require('mason-core.functional')
local null_ls = require('null-ls')

-- @param source string
-- @param types string[]
return _.memoize(function(source, types)
return function(source, types)
if not null_ls.is_registered(source) then
vim.tbl_map(function(type)
null_ls.register(null_ls.builtins[type][source])
end, types)
end
end)
end
4 changes: 1 addition & 3 deletions lua/mason-null-ls/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ local M = {}
-- Currently this only needs to be evaluated for the same list passed in.
-- @param source string
-- @param types string[]
M.default_setup = function(source, types)
require('mason-null-ls.automatic_setup')(source, types)
end
M.default_setup = require('mason-null-ls.automatic_setup')

---@param handlers table<string, fun(source_name: string, methods: string[])> | nil
---@return nil
Expand Down

0 comments on commit 0bf4c84

Please sign in to comment.