https://github.com/Bilal2453/luvit-meta
Meta type definitions for the Lua platform Luvit.
https://github.com/Bilal2453/luvit-meta
definitions luvit meta types
Last synced: 7 months ago
JSON representation
Meta type definitions for the Lua platform Luvit.
- Host: GitHub
- URL: https://github.com/Bilal2453/luvit-meta
- Owner: Bilal2453
- License: apache-2.0
- Created: 2022-04-30T18:38:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T19:55:20.000Z (8 months ago)
- Last Synced: 2024-10-29T21:46:21.225Z (8 months ago)
- Topics: definitions, luvit, meta, types
- Language: Lua
- Homepage:
- Size: 329 KB
- Stars: 37
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Luvit-Meta
This project is a collection of definition files for the framework [Luvit](https://github.com/Luvit/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](/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.### Cool, any examples?
Here are some samples of it working:
https://user-images.githubusercontent.com/38175840/169595790-80305ae3-c4fc-478a-af59-6bfa2acb2635.mp4
https://user-images.githubusercontent.com/38175840/169615756-f9946531-d943-4942-9124-f819783bc180.mp4
https://user-images.githubusercontent.com/38175840/169663522-5aed02c1-1308-49d6-8d63-3de23a872ef7.mp4
### Where does this work?
The definitions use the [Sumneko's Lua Language Server (LLS)](https://github.com/LuaLS/lua-language-server/) annotations, therefor it should work on any editor that support LLS, such as [VSCode](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) and Neovim.
### How to install it?
#### On Visual Studio Code:
1. Install [this plugin](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) then reload editor.
2. Open the workspace you want to enable this in.
3. Press `Ctrl + Shift + P`, a prompt will open.
4. Type "Open addon manager" and press enter.
5. Search for `Luvit` then press `Enable`.

6. The definitions should now be enabled for that workspace.
Typing something like `local fs = require'fs'` will show you auto-completion.#### Manually, for other editors:
1. Install [LLS]((https://github.com/LuaLS/lua-language-server/)) for your editor.
2. Configure your meta directory.
3. [Click here](https://github.com/Bilal2453/luvit-meta/archive/refs/heads/release.zip) to download the definitions; alternatively clone this repository.
4. Extract the ZIP file to your meta directory/move the folder there.
5. Should now be ready. If not, check the editor plugin's manual for doing this.### What modules have definitions?
Built-in Modules:
- [x] buffer
- [x] childprocess
- [x] codec
- [x] core
- [x] dgram
- [x] dns
- [x] env
- [x] fs
- [x] helpful
- [x] hooks
- [x] http
- [x] http-codec
- [x] http-header
- [x] https
- [x] json
- [x] los
- [x] lpeg
- [x] net
- [x] path
- [x] pathjoin
- [x] pretty-print
- [x] process
- [x] querystring
- [x] re
- [x] readline
- [x] repl
- [x] require
- [x] resource
- [x] stream
- [x] thread
- [x] timer
- [x] tls
- [x] url
- [x] ustring
- [x] utils
- [x] uv
- [ ] miniz
- [ ] luvi
- [ ] rex
- [ ] openssl
- [ ] WinSVCPopular libraries that are not built-in:
- [x] coro-http
- [ ] coro-net
- [ ] coro-channel
- [ ] coro-wrapper
- [ ] coro-fs
- [ ] coro-spawn
- [x] [discordia](https://github.com/SinisterRectus/Discordia/)## License
This exhausting project is licensed under Apache License 2.0, see [LICENSE](/LICENSE) for more information. Feel free to fork and/or PR changes.