This project is a collection of definition files for the framework Luvit. The definitions provide types for all modules currently shipped in Luvit, the classes, methods and their arguments and returns; it does as well provide descriptions whereever possible, either by scraping the Luvit-docs, Nodejs docs, luv docs or manually written in some places.
Some of the definitions are scraped off of code/docs and then some manual work is done to figure types out. For those the used scraper is located under scrapers, the script outputs to a file in the same directory. From there it is manually copied over to the actual library definition. Other definitions -and most of them- are completely manually written, as it was required to figure the logic out in order to figure the types.
Here are some samples of it working:
http-server.mp4
fs-access.mp4
stream-events.mp4
The definitions use the Sumneko's Lua Language Server (LLS) annotations, therefor it should work on any editor that support LLS, such as VSCode and Neovim.
-
Install this plugin then reload editor.
-
Open the workspace you want to enable this in.
-
Press
Ctrl + Shift + P
, a prompt will open. -
Type "Open addon manager" and press enter.
- Search for
Luvit
then pressEnable
.
- The definitions should now be enabled for that workspace.
Typing something like
local fs = require'fs'
will show you auto-completion.
- Install LLS for your editor.
- Configure your meta directory.
- Click here to download the definitions; alternatively clone this repository.
- Extract the ZIP file to your meta directory/move the folder there.
- Should now be ready. If not, check the editor plugin's manual for doing this.
Built-in Modules:
- buffer
- childprocess
- codec
- core
- dgram
- dns
- env
- fs
- helpful
- hooks
- http
- http-codec
- http-header
- https
- json
- los
- lpeg
- net
- path
- pathjoin
- pretty-print
- process
- querystring
- re
- readline
- repl
- require
- resource
- stream
- thread
- timer
- tls
- url
- ustring
- utils
- uv
- miniz
- luvi
- rex
- openssl
- WinSVC
Popular libraries that are not built-in:
- coro-http
- coro-net
- coro-channel
- coro-wrapper
- coro-fs
- coro-spawn
This exhausting project is licensed under Apache License 2.0, see LICENSE for more information. Feel free to fork and/or PR changes.