Add ale.has to mirror ale#Has in Lua

This commit is contained in:
w0rp
2025-03-22 00:04:46 +00:00
parent bd591d47f2
commit ecf815891d
3 changed files with 40 additions and 1 deletions

View File

@@ -55,6 +55,15 @@ ale.setup = setmetatable({
end,
})
---Check if ALE supports a given feature.
---
---The ALE version can be checked with ale.has("ale-1.0.0"), etc.
---@param feature string The feature to test for.
---@return boolean supported If the feature is supported.
ale.has = function(feature)
return vim.fn["ale#Has"](feature) == 1
end
---Get an ALE variable for a buffer (first) or globally (second)
---@param buffer number The buffer number to retreive the variable for.
---@param variable_name string The variable to retrieve.