diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 19:23:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 19:23:03 +0800 |
commit | da6942640931afd8f39db0fc84e8e0394f95d9b1 (patch) | |
tree | 9cbb0cfecec8c949b51a9c1fd91c2c9e32754744 | |
parent | 8e3de6b5653ea7087a248b3eb2a4aea6067688b5 (diff) | |
download | lua-language-server-da6942640931afd8f39db0fc84e8e0394f95d9b1.zip |
update
-rw-r--r-- | meta/3rd/love2d/library/love.audio.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.data.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.event.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.filesystem.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.font.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.graphics.lua | 10 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.image.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.joystick.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.keyboard.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.math.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.mouse.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.physics.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.sound.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.system.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.thread.lua | 20 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.timer.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.touch.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.video.lua | 6 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.window.lua | 4 | ||||
-rw-r--r-- | tools/love-api.lua | 8 |
20 files changed, 82 insertions, 26 deletions
diff --git a/meta/3rd/love2d/library/love.audio.lua b/meta/3rd/love2d/library/love.audio.lua index c7d1b717..5285ea50 100644 --- a/meta/3rd/love2d/library/love.audio.lua +++ b/meta/3rd/love2d/library/love.audio.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to create noise with the user's speakers. +--- ---@class love.audio love.audio = {} diff --git a/meta/3rd/love2d/library/love.data.lua b/meta/3rd/love2d/library/love.data.lua index cf77444a..37f8dbd0 100644 --- a/meta/3rd/love2d/library/love.data.lua +++ b/meta/3rd/love2d/library/love.data.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides functionality for creating and transforming data. +--- ---@class love.data love.data = {} diff --git a/meta/3rd/love2d/library/love.event.lua b/meta/3rd/love2d/library/love.event.lua index aa06c47f..71d950fc 100644 --- a/meta/3rd/love2d/library/love.event.lua +++ b/meta/3rd/love2d/library/love.event.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Manages events, like keypresses. +--- ---@class love.event love.event = {} diff --git a/meta/3rd/love2d/library/love.filesystem.lua b/meta/3rd/love2d/library/love.filesystem.lua index 6fd71187..e46afe14 100644 --- a/meta/3rd/love2d/library/love.filesystem.lua +++ b/meta/3rd/love2d/library/love.filesystem.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to the user's filesystem. +--- ---@class love.filesystem love.filesystem = {} diff --git a/meta/3rd/love2d/library/love.font.lua b/meta/3rd/love2d/library/love.font.lua index 4526ccc8..03229a57 100644 --- a/meta/3rd/love2d/library/love.font.lua +++ b/meta/3rd/love2d/library/love.font.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Allows you to work with fonts. +--- ---@class love.font love.font = {} diff --git a/meta/3rd/love2d/library/love.graphics.lua b/meta/3rd/love2d/library/love.graphics.lua index 4ce0e44d..38a705a1 100644 --- a/meta/3rd/love2d/library/love.graphics.lua +++ b/meta/3rd/love2d/library/love.graphics.lua @@ -1,6 +1,14 @@ ---@meta --- version: nil +--- +---The primary responsibility for the love.graphics module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory, creating specialized objects (such as ParticleSystems or Canvases) and managing screen geometry. +--- +---LÖVE's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom. +--- +---In many cases, you draw images or shapes in terms of their upper-left corner. +--- +---Many of the functions are used to manipulate the graphics coordinate system, which is essentially the way coordinates are mapped to the display. You can change the position, scale, and even rotation in this way. +--- ---@class love.graphics love.graphics = {} diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love.image.lua index 6e36e8e8..8fee22d4 100644 --- a/meta/3rd/love2d/library/love.image.lua +++ b/meta/3rd/love2d/library/love.image.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to decode encoded image data. +--- ---@class love.image love.image = {} diff --git a/meta/3rd/love2d/library/love.joystick.lua b/meta/3rd/love2d/library/love.joystick.lua index a1995b8b..3fa5413e 100644 --- a/meta/3rd/love2d/library/love.joystick.lua +++ b/meta/3rd/love2d/library/love.joystick.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to the user's joystick. +--- ---@class love.joystick love.joystick = {} diff --git a/meta/3rd/love2d/library/love.keyboard.lua b/meta/3rd/love2d/library/love.keyboard.lua index 70f4d45f..a7d7cb57 100644 --- a/meta/3rd/love2d/library/love.keyboard.lua +++ b/meta/3rd/love2d/library/love.keyboard.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to the user's keyboard. +--- ---@class love.keyboard love.keyboard = {} diff --git a/meta/3rd/love2d/library/love.math.lua b/meta/3rd/love2d/library/love.math.lua index 503051e3..be8fdf8a 100644 --- a/meta/3rd/love2d/library/love.math.lua +++ b/meta/3rd/love2d/library/love.math.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides system-independent mathematical functions. +--- ---@class love.math love.math = {} diff --git a/meta/3rd/love2d/library/love.mouse.lua b/meta/3rd/love2d/library/love.mouse.lua index 055252c7..76f85a74 100644 --- a/meta/3rd/love2d/library/love.mouse.lua +++ b/meta/3rd/love2d/library/love.mouse.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to the user's mouse. +--- ---@class love.mouse love.mouse = {} diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love.physics.lua index 5b23957e..21055ea0 100644 --- a/meta/3rd/love2d/library/love.physics.lua +++ b/meta/3rd/love2d/library/love.physics.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Can simulate 2D rigid body physics in a realistic manner. This module is based on Box2D, and this API corresponds to the Box2D API as closely as possible. +--- ---@class love.physics love.physics = {} diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love.sound.lua index 8ca9fbbf..9c51e28d 100644 --- a/meta/3rd/love2d/library/love.sound.lua +++ b/meta/3rd/love2d/library/love.sound.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---This module is responsible for decoding sound files. It can't play the sounds, see love.audio for that. +--- ---@class love.sound love.sound = {} diff --git a/meta/3rd/love2d/library/love.system.lua b/meta/3rd/love2d/library/love.system.lua index ed71a00b..a3c41df3 100644 --- a/meta/3rd/love2d/library/love.system.lua +++ b/meta/3rd/love2d/library/love.system.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides access to information about the user's system. +--- ---@class love.system love.system = {} diff --git a/meta/3rd/love2d/library/love.thread.lua b/meta/3rd/love2d/library/love.thread.lua index da0b7c56..3551559e 100644 --- a/meta/3rd/love2d/library/love.thread.lua +++ b/meta/3rd/love2d/library/love.thread.lua @@ -1,6 +1,14 @@ ---@meta --- version: nil +--- +---Allows you to work with threads. +--- +---Threads are separate Lua environments, running in parallel to the main code. As their code runs separately, they can be used to compute complex operations without adversely affecting the frame rate of the main thread. However, as they are separate environments, they cannot access the variables and functions of the main thread, and communication between threads is limited. +--- +---All LOVE objects (userdata) are shared among threads so you'll only have to send their references across threads. You may run into concurrency issues if you manipulate an object on multiple threads at the same time. +--- +---When a Thread is started, it only loads the love.thread module. Every other module has to be loaded with require. +--- ---@class love.thread love.thread = {} @@ -42,7 +50,7 @@ function Channel:clear() end --- ---It waits until a message is in the queue then returns the message value. --- ----@return love.Variant value # The contents of the message. +---@return any value # The contents of the message. function Channel:demand() end --- @@ -63,7 +71,7 @@ function Channel:hasRead(id) end --- ---It returns nil if there's no message in the queue. --- ----@return love.Variant value # The contents of the message. +---@return any value # The contents of the message. function Channel:peek() end --- @@ -83,7 +91,7 @@ function Channel:performAtomic(func, arg1) end --- ---It returns nil if there are no messages in the queue. --- ----@return love.Variant value # The contents of the message. +---@return any value # The contents of the message. function Channel:pop() end --- @@ -91,7 +99,7 @@ function Channel:pop() end --- ---See Variant for the list of supported types. --- ----@param value love.Variant # The contents of the message. +---@param value any # The contents of the message. ---@return number id # Identifier which can be supplied to Channel:hasRead function Channel:push(value) end @@ -100,7 +108,7 @@ function Channel:push(value) end --- ---See Variant for the list of supported types. --- ----@param value love.Variant # The contents of the message. +---@param value any # The contents of the message. ---@return boolean success # Whether the message was successfully supplied (always true). function Channel:supply(value) end diff --git a/meta/3rd/love2d/library/love.timer.lua b/meta/3rd/love2d/library/love.timer.lua index 30a8f06c..c675072d 100644 --- a/meta/3rd/love2d/library/love.timer.lua +++ b/meta/3rd/love2d/library/love.timer.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to the user's clock. +--- ---@class love.timer love.timer = {} diff --git a/meta/3rd/love2d/library/love.touch.lua b/meta/3rd/love2d/library/love.touch.lua index 9c7f7e10..e36744e3 100644 --- a/meta/3rd/love2d/library/love.touch.lua +++ b/meta/3rd/love2d/library/love.touch.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface to touch-screen presses. +--- ---@class love.touch love.touch = {} diff --git a/meta/3rd/love2d/library/love.video.lua b/meta/3rd/love2d/library/love.video.lua index 6be1694b..3305ec77 100644 --- a/meta/3rd/love2d/library/love.video.lua +++ b/meta/3rd/love2d/library/love.video.lua @@ -1,6 +1,10 @@ ---@meta --- version: nil +--- +---This module is responsible for decoding, controlling, and streaming video files. +--- +---It can't draw the videos, see love.graphics.newVideo and Video objects for that. +--- ---@class love.video love.video = {} diff --git a/meta/3rd/love2d/library/love.window.lua b/meta/3rd/love2d/library/love.window.lua index e0ce54c9..dd219d79 100644 --- a/meta/3rd/love2d/library/love.window.lua +++ b/meta/3rd/love2d/library/love.window.lua @@ -1,6 +1,8 @@ ---@meta --- version: nil +--- +---Provides an interface for modifying and retrieving information about the program's window. +--- ---@class love.window love.window = {} diff --git a/tools/love-api.lua b/tools/love-api.lua index 6817e9ff..86ed24a6 100644 --- a/tools/love-api.lua +++ b/tools/love-api.lua @@ -23,7 +23,8 @@ local knownTypes = { ['lightuserdata'] = 'lightuserdata', ['thread'] = 'thread', ['cdata'] = 'ffi.cdata*', - ['light userdata'] = 'lightuserdata' + ['light userdata'] = 'lightuserdata', + ['Variant'] = 'any', } local function trim(name) @@ -133,7 +134,10 @@ local function buildFile(class, defs) text[#text+1] = '---@meta' text[#text+1] = '' - text[#text+1] = ('-- version: %s'):format(defs.version) + if defs.version then + text[#text+1] = ('-- version: %s'):format(defs.version) + end + text[#text+1] = buildDescription(defs.description) text[#text+1] = ('---@class %s'):format(class) text[#text+1] = ('%s = {}'):format(class) |