diff --git a/changelog.md b/changelog.md index 33fc397b6..e5224a0c2 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ * `FIX` Typed `@field` (eg `---@field [string] boolean`) should not override other defined field [#2171](https://github.com/LuaLS/lua-language-server/issues/2171), [#2711](https://github.com/LuaLS/lua-language-server/issues/2711) * `FIX` don't return empty hover doc when luals failed to find definition * `FIX` Prevent stack overflow when attempting to resolve function return values. [#3246](https://github.com/LuaLS/lua-language-server/issues/3246) +* `FIX` Fix type annotations for `string.buffer` module ## 3.15.0 `2025-6-25` diff --git a/meta/template/string.buffer.lua b/meta/template/string.buffer.lua index 7285290a4..950e70262 100644 --- a/meta/template/string.buffer.lua +++ b/meta/template/string.buffer.lua @@ -262,7 +262,7 @@ function buf:ref() end --- Serializes (encodes) the Lua object to the buffer --- --- This function may throw an error when attempting to serialize unsupported object types, circular references or deeply nested tables. ----@param obj string.buffer.data +---@param obj any ---@return string.buffer function buf:encode(obj) end @@ -277,14 +277,14 @@ function buf:encode(obj) end --- --- Attempting to de-serialize an FFI type will throw an error, if the FFI library is not built-in or has not been loaded, yet. --- ----@return string.buffer.data|nil obj +---@return any obj function buf:decode() end --- Serializes (encodes) the Lua object obj --- --- This function may throw an error when attempting to serialize unsupported object types, circular references or deeply nested tables. ----@param obj string.buffer.data +---@param obj any ---@return string function buffer.encode(obj) end @@ -298,7 +298,7 @@ function buffer.encode(obj) end --- Attempting to de-serialize an FFI type will throw an error, if the FFI library is not built-in or has not been loaded, yet. --- ---@param str string ----@return string.buffer.data|nil obj +---@return any obj function buffer.decode(str) end