Skip to content

Commit

Permalink
fix #404 miss return table by os.date
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 22, 2021
1 parent 063c5df commit b6dc956
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions locale/en-us/meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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`).'
Expand Down
9 changes: 9 additions & 0 deletions locale/zh-cn/meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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`)。'
Expand Down
22 changes: 21 additions & 1 deletion meta/template/os.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b6dc956

Please sign in to comment.