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 annotated code 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
10
11
11
<divalign="center">
12
12
@@ -22,14 +22,10 @@ To get autocompletion for the Garry's Mod Lua API in your Garry's Mod projects,
22
22
23
23
*[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
**Then** download/install our GLua API Definitions for the Lua Language Server. This process varies depending on your editor:
28
28
29
-
*[Visual Studio Code](#visual-studio-code)
30
-
31
-
*[NeoVim](#neovim)
32
-
33
29
### Visual Studio Code
34
30
35
31
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.
@@ -43,7 +39,7 @@ Installing our GLua API Definitions for the Lua Language Server in Visual Studio
43
39

44
40
45
41
</div>
46
-
42
+
47
43
3. Search for the **Garry's Mod** addon and **`Enable`** it:
48
44
49
45
<divalign="center">
@@ -52,11 +48,44 @@ Installing our GLua API Definitions for the Lua Language Server in Visual Studio
52
48
53
49
</div>
54
50
55
-
### NeoVim
51
+
### Neovim
56
52
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)
53
+
1.Setup a folder for storing Lua Language Server addons (e.g. `~/.cache/luals/`) and create `addonManager/addons/garrysmod/module` folders inside it
58
54
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
55
+
> [!NOTE]
56
+
>
57
+
> If you switch between Neovim and VSCode regularly, you probably want to use VSCode's directory, which is `~/AppData/Roaming/Code/User/globalStorage/sumneko.lua` on Windows and `~/.config/Code/User/globalStorage/sumneko.lua` on Linux
58
+
59
+
2. Clone (or download and unzip) [our `lua-language-server-addon` branch](https://github.com/luttje/glua-api-snippets/tree/lua-language-server-addon) into the `garrysmod/module` folder
60
+
61
+
3. In your Neovim config where you call `lspconfig.lua_ls.setup`, add the following to the table
> The VSCode extension [currently does not automatically install addons](https://github.com/LuaLS/vscode-lua/issues/159). If a user that does not have this addon installed already opens a project that has this `.luarc.json` present, they will have to open the Addon Manager and click Disable and Enable on this addon for it to install the addon properly.
0 commit comments