You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
9
+
This repository scrapes the Garry's Mod Lua API and generates annotated code snippets that will help provide autocompletion for Lua in editors like VSCode, NeoVim and more.
10
+
11
+
<divalign="center">
12
+
13
+

14
+
15
+
</div>
10
16
11
17
## 🔨 Usage
12
18
13
-
1. Install **Lua Language Server:** for your editor of choice:
14
-
*[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
To get autocompletion for the Garry's Mod Lua API in your Garry's Mod projects, you need to install the Lua Language Server and our GLua API Definitions.
20
+
21
+
**First** install **Lua Language Server (LuaLS):** for your editor of choice:
22
+
23
+
*[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
16
24
17
-
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 ...**:
18
-

**Then** download/install our GLua API Definitions for the Lua Language Server. This process varies depending on your editor:
19
28
20
-
3. Search for the **Garry's Mod** addon and **Enable** it:
21
-

29
+
*[Visual Studio Code](#visual-studio-code)
30
+
31
+
*[NeoVim](#neovim)
32
+
33
+
### Visual Studio Code
34
+
35
+
Installing our GLua API Definitions for the Lua Language Server in Visual Studio Code is easy thanks to the Lua Language Server Addon Manager built into the VSCode extension.
36
+
37
+
1. In Visual Studio Code open the Command Palette with the key combination `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
22
38
23
-
4. You will now get autocompletion for the Garry's Mod Lua API in your Garry's Mod projects.
39
+
2. Search for *Addon*, then select **`Lua: Open Addon Manager ...`**:
24
40
25
41
<divalign="center">
26
42
27
-

43
+

44
+
45
+
</div>
46
+
47
+
3. Search for the **Garry's Mod** addon and **`Enable`** it:
48
+
49
+
<divalign="center">
50
+
51
+

28
52
29
53
</div>
30
54
31
-
*Alternatively download the latest release and include or symlink it into your workspace. Get the release from [🔗 the releases page](https://github.com/luttje/glua-api-snippets/releases) it's named something like `YYYY-MM-DD_HH-MM-SS.lua.zip` .*
55
+
### NeoVim
56
+
57
+
1. Clone (or download and unzip) [our `lua-language-server-addon` branch](https://github.com/luttje/glua-api-snippets/tree/lua-language-server-addon)
58
+
59
+
2. Follow [the instructions in the Lua Language Server documentation](https://luals.github.io/wiki/addons/#installing-addons) and point `workspace.userThirdParty` to where you placed the `lua-language-server-addon` branch
32
60
33
61
## 📅 Automatically up-to-date
34
62
@@ -40,10 +68,10 @@ A workflow will automatically scrape the latest Garry's Mod Lua API from [the Ga
40
68
>
41
69
> The Lua Language Server addon might not be immediately updated to align with the definitions in this repository. This delay occurs because we must submit a pull request (PR) to the [Lua Language Server Addons repository (`LuaLS/LLS-Addons`)](https://github.com/LuaLS/LLS-Addons) to update the addon. Subsequently, a maintainer of the `LuaLS/LLS-Addons` repository needs to find time to review and merge the PR.
42
70
>
43
-
> Our schedule for updating our addon with `LuaLS/LLS-Addons` is set for the first day of each even month, specifically: February, April, June, August, October, and December.
71
+
> Our schedule for updating our addon with `LuaLS/LLS-Addons` is set for the first day of February, April, June, August, October, and December.
44
72
> This schedule is subject to change based on the availability of maintainers and the urgency of the update.
45
73
>
46
-
> If you urgently require the most current definitions from the addon, you can expedite the process by submitting a PR to update it. Instructions for doing so can be found in [the `CONTRIBUTING.md` file](https://github.com/luttje/glua-api-snippets/blob/main/CONTRIBUTING.md#updating-the-addon-for-lua-language-server).
74
+
> If you urgently require the most current definitions from the addon, you can expedite the process by submitting a PR to update it yourself. Instructions for doing so can be found in [the `CONTRIBUTING.md` file](https://github.com/luttje/glua-api-snippets/blob/main/CONTRIBUTING.md#updating-the-addon-for-lua-language-server).
47
75
48
76
## 🤖 Advanced Usage
49
77
@@ -63,7 +91,15 @@ This project uses [Jest](https://jestjs.io/) to automate testing. You can run th
63
91
64
92
### API as JSON
65
93
66
-
The API is also available as JSON. You can find it with the Lua API package [on the releases page](https://github.com/luttje/glua-api-snippets/releases). It is named something like `YYYY-MM-DD_HH-MM-SS.json.zip`.
94
+
The API is also available as JSON. You can find it with the Lua API package on [🔗 the releases page](https://github.com/luttje/glua-api-snippets/releases). It is named something like `YYYY-MM-DD_HH-MM-SS.json.zip`.
95
+
96
+
### Manual Installation
97
+
98
+
If you cannot or do not want to use Lua Language Server:
99
+
100
+
1. Download and unzip the latest release from [🔗 the releases page](https://github.com/luttje/glua-api-snippets/releases), it's named something like `YYYY-MM-DD_HH-MM-SS.lua.zip`
101
+
102
+
2. Include or symlink the unzipped directory into your workspace
0 commit comments