Skip to content

Commit f5def20

Browse files
author
Jose Alvarez
committed
feat(builtins): warn on nonexistent method
1 parent 66f7c03 commit f5def20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/null-ls/builtins/init.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local logger = require("null-ls.logger")
12
local u = require("null-ls.utils")
23

34
local export_tables = {
@@ -14,8 +15,7 @@ for method, table in pairs(export_tables) do
1415
__index = function(t, k)
1516
local ok, builtin = pcall(require, string.format("null-ls.builtins.%s.%s", method, k))
1617
if not ok then
17-
u.echo(
18-
"WarningMsg",
18+
logger:warn(
1919
string.format("failed to load builtin %s for method %s; please check your config", k, method)
2020
)
2121
return
@@ -29,6 +29,9 @@ end
2929

3030
return setmetatable({}, {
3131
__index = function(_, k)
32+
if not export_tables[k] then
33+
logger:warn(string.format("failed to load builtin table for method %s; please check your config", k))
34+
end
3235
return export_tables[k]
3336
end,
3437
})

0 commit comments

Comments
 (0)