Vurv78 / glua-api-snippets

Scrapes the Garry's Mod Wiki in order to build Lua Language Server comments that will provide intellisense help.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Garry's Mod Lua API Definitions

GitHub Release GitHub License GitHub Tests Action Test Coverage Status

This repository scrapes the Garry's Mod Lua API and generates snippets that will help provide autocompletion for Lua in editors like VSCode, NeoVim and more.

πŸ”¨ Usage

  1. Install Lua Language Server: for your editor of choice:

  2. Open the Lua Language Server Addon Manager with the key combination Ctrl+Shift+P (or Cmd+Shift+P on macOS) and search for Addon, then select Lua: Open Addon Manager ...: VSCode editor command suggestion showing: Lua: Open Addon Manager ...

  3. Search for the Garry's Mod addon and Enable it: Lua Language Server Addon Manager showing the Garry's Mod addon

  4. You will now get autocompletion for the Garry's Mod Lua API in your Garry's Mod projects.

VSCode showing autocomplete options from the GLua API while typing code with EmmyLua

Alternatively download the latest release and include or symlink it into your workspace. Get the release from πŸ”— the releases page it's named something like YYYY-MM-DD_HH-MM-SS.lua.zip .

πŸ“… Automatically up-to-date

Using GitHub Actions, this repository is automatically updated every first day of the month at around 00:00 UTC.

A workflow will automatically scrape the latest Garry's Mod Lua API from the Garry's Mod Wiki and package them into πŸ”— a release.

Note

The Lua Language Server addon may not be 100% up-to-date with the definitions in this repository. You can help us out by updating it for everyone. There are instructions on how to do this in the CONTRIBUTING.md file.

πŸ€– Advanced Usage

Running the Scraper Locally

You can clone this repository and run the scraper yourself. This is useful if you want to use the latest version of the API, or if you want to make changes to the scraper.

  1. Clone this repository

  2. Install the dependencies with npm install

  3. Run the scraper with npm run scrape-wiki

Testing the project

This project uses Jest to automate testing. You can run the tests with npm test.

API as JSON

The API is also available as JSON. You can find it with the Lua API package on the releases page. It is named something like YYYY-MM-DD_HH-MM-SS.json.zip.

About

Scrapes the Garry's Mod Wiki in order to build Lua Language Server comments that will provide intellisense help.

License:MIT License


Languages

Language:TypeScript 99.2%Language:Lua 0.8%