|
2 | 2 | order: 92 |
3 | 3 | icon: zap |
4 | 4 | --- |
5 | | -# Auto Completion & Intellisense |
| 5 | +# Auto Completion & IntelliSense |
| 6 | +To enhance your development experience with LuaLink, it is recommended to set up auto completion with IntelliSense. |
6 | 7 |
|
7 | | -<details> |
8 | | -<summary><strong>VSCode / VSCodium Setup</strong></summary> |
| 8 | +Getting this up and running is really simple. Choose your IDE and follow instructions below: |
9 | 9 |
|
10 | | -If you want auto completion and intellisense for LuaLink scripts in VSCode (or VSCodium), follow these simple steps: |
| 10 | +=== **Visual Studio Code**   |   **VSCodium** |
11 | 11 |
|
12 | | -### 1. Install the Lua Extension |
| 12 | +<br> |
13 | 13 |
|
14 | | -- Install the **sumneko Lua** extension: |
15 | | - - [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) |
16 | | - - [Open VSX](https://open-vsx.org/extension/sumneko/lua) |
| 14 | +#### 1. Install Lua Extension |
| 15 | +Download and install **sumneko Lua** extension. You can do this manually, or use built-in extension manager if available. |
17 | 16 |
|
18 | | -### 2. Get the LuaLink LLS Addon |
| 17 | +{.list-icon} |
| 18 | +- **Trusted Sources** |
| 19 | +- [**:icon-link: VSCode Marketplace** (marketplace.visualstudio.com)](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) |
| 20 | +- [**:icon-link: Open VSX** (open-vsx.org)](https://open-vsx.org/extension/sumneko/lua) |
19 | 21 |
|
20 | | -- Clone (recommended) or download [LuaLink/lualink-lls-addon](https://github.com/LuaLink/lualink-lls-addon) |
21 | | -- Cloning is recommended so you can update it easily: |
22 | | - ```bash |
23 | | - git clone https://github.com/LuaLink/lualink-lls-addon |
24 | | - ``` |
| 22 | +--- |
| 23 | + |
| 24 | +#### 2. Get LuaLink LLS Addon |
| 25 | +Clone or download [**our addon**](https://github.com/LuaLink/lualink-lls-addon). It contains Lua stubs for common Java and Bukkit types and enables auto-completion of class names. |
| 26 | + |
| 27 | +Cloning is recommended so you can update it easily. |
| 28 | +```bash |
| 29 | +git clone https://github.com/LuaLink/lualink-lls-addon |
| 30 | +``` |
| 31 | +Updating is as simple as executing `git pull` inside the cloned directory. |
| 32 | + |
| 33 | +**Note**: Stubs are based on JDK 21 and latest Paper API snapshot. Repository is updated on daily basis so if recently added API is missing, just pull changes from remote or download and replace files manually. |
25 | 34 |
|
26 | | -### 3. Configure the Extension |
| 35 | +--- |
| 36 | + |
| 37 | +#### 3. Configure Lua Extension |
| 38 | +The last step is to configure **sumneko Lua** extension to make it recognize and index downloaded Lua stubs, and use our runtime plugin. |
27 | 39 |
|
28 | 40 | - Open the settings for the Lua extension. |
29 | 41 | - Add a new entry to `Lua.workspace.library` and enter the path to your `lualink-lls-addon` folder. |
30 | 42 | - Set `Lua.runtime.plugin` to `lualink-lls-addon/plugin.lua`. |
31 | 43 | - This setting requires editing the `settings.json` for the extension directly. |
32 | 44 |
|
33 | | -#### Note |
34 | | - |
35 | | -It *should* be possible to just add the `lualink-lls-addon` folder to `Lua.workspace.userThirdParty` and have the plugin load only for LuaLink scripts, but in testing this didn't work. If you figure it out, please open an issue or join our Discord! |
36 | | - |
37 | | -### Done! |
| 45 | +**Note**: It *should* be possible to just add the `lualink-lls-addon` folder to `Lua.workspace.userThirdParty` and have the plugin load only for LuaLink scripts. We could never get this to work however. So if you figure it out - please [open a new issue](https://github.com/LuaLink/docs/issues) or [join our Discord](https://discord.gg/xYcjBKqkDz). |
38 | 46 |
|
39 | | -If you did everything right, you should now get auto completion and intellisense for LuaLink in your Lua files. This should make developing scripts much easier! |
| 47 | +=== |
40 | 48 |
|
41 | | -</details> |
| 49 | +**Not working?** [Join our Discord server](https://discord.gg/xYcjBKqkDz) and ask for help. We will do our best to help you set it up. |
42 | 50 |
|
43 | 51 | <!-- Add more IDE instructions below as needed --> |
0 commit comments