diff --git a/changelog.md b/changelog.md index fbce9cb31..47522398b 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ * `FIX` [#400](https://github.com/sumneko/lua-language-server/issues/400) * `FIX` [#402](https://github.com/sumneko/lua-language-server/issues/402) * `FIX` [#403](https://github.com/sumneko/lua-language-server/issues/403) +* `FIX` [#404](https://github.com/sumneko/lua-language-server/issues/404) * `FIX` runtime errors ## 1.16.0 diff --git a/locale/en-us/meta.lua b/locale/en-us/meta.lua index 179e6f4d9..ffb4fee76 100644 --- a/locale/en-us/meta.lua +++ b/locale/en-us/meta.lua @@ -335,6 +335,15 @@ os.rename = 'Renames the file or directory named `oldname` to os.setlocale = 'Sets the current locale of the program.' os.time = 'Returns the current time when called without arguments, or a time representing the local date and time specified by the given table.' os.tmpname = 'Returns a string with a file name that can be used for a temporary file.' +osdate.year = 'four digits' +osdate.month = '1-12' +osdate.day = '1-31' +osdate.hour = '0-23' +osdate.min = '0-59' +osdate.sec = '0-61' +osdate.wday = 'weekday, 1–7, Sunday is 1' +osdate.yday = 'day of the year, 1–366' +osdate.isdst = 'daylight saving flag, a boolean' package = '' require['<5.3'] = 'Loads the given module, returns any value returned by the given module(`true` when `nil`).' diff --git a/locale/zh-cn/meta.lua b/locale/zh-cn/meta.lua index e9fedf618..a054a464c 100644 --- a/locale/zh-cn/meta.lua +++ b/locale/zh-cn/meta.lua @@ -313,6 +313,15 @@ os.rename = '将名字为 `oldname` 的文件或目录更名 os.setlocale = '设置程序的当前区域。' os.time = '当不传参数时,返回当前时刻。 如果传入一张表,就返回由这张表表示的时刻。' os.tmpname = '返回一个可用于临时文件的文件名字符串。' +osdate.year = '四位数字' +osdate.month = '1-12' +osdate.day = '1-31' +osdate.hour = '0-23' +osdate.min = '0-59' +osdate.sec = '0-61' +osdate.wday = '星期几,1-7,星期天为 1' +osdate.yday = '当年的第几天,1-366' +osdate.isdst = '夏令时标记,一个布尔量' package = '' require['<5.3'] = '加载一个模块,返回该模块的返回值(`nil`时为`true`)。' diff --git a/meta/template/os.lua b/meta/template/os.lua index 99b29f6a8..0ea096493 100644 --- a/meta/template/os.lua +++ b/meta/template/os.lua @@ -8,10 +8,30 @@ os = {} ---@return number function os.clock() end +---@class osdate +---#DES 'osdate.year' +---@field year integer +---#DES 'osdate.month' +---@field month integer +---#DES 'osdate.day' +---@field day integer +---#DES 'osdate.hour' +---@field hour integer +---#DES 'osdate.min' +---@field min integer +---#DES 'osdate.sec' +---@field sec integer +---#DES 'osdate.wday' +---@field wday integer +---#DES 'osdate.yday' +---@field yday integer +---#DES 'osdate.isdst' +---@field isdst boolean + ---#DES 'os.date' ---@param format? string ---@param time? integer ----@return string +---@return string|osdate function os.date(format, time) end ---#DES 'os.difftime'