From 1c960a2cf380a7083488c14f21a05f4bfe5119a7 Mon Sep 17 00:00:00 2001 From: Saturn Date: Sun, 25 May 2025 18:20:12 +0000 Subject: [PATCH 1/2] Basic auto completion docs --- autocompletion.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 autocompletion.md diff --git a/autocompletion.md b/autocompletion.md new file mode 100644 index 0000000..85ca32f --- /dev/null +++ b/autocompletion.md @@ -0,0 +1,43 @@ +--- +order: 92 +icon: zap +--- +# Auto Completion & Intellisense + +
+VSCode / VSCodium Setup + +If you want auto completion and intellisense for LuaLink scripts in VSCode (or VSCodium), follow these simple steps: + +### 1. Install the Lua Extension + +- Install the **sumneko Lua** extension: + - [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) + - [Open VSX](https://open-vsx.org/extension/sumneko/lua) + +### 2. Get the LuaLink LLS Addon + +- Clone (recommended) or download [LuaLink/lualink-lls-addon](https://github.com/LuaLink/lualink-lls-addon) +- Cloning is recommended so you can update it easily: + ```bash + git clone https://github.com/LuaLink/lualink-lls-addon + ``` + +### 3. Configure the Extension + +- Open the settings for the Lua extension. +- Add a new entry to `Lua.workspace.library` and enter the path to your `lualink-lls-addon` folder. +- Set `Lua.runtime.plugin` to `lualink-lls-addon/plugin.lua`. + - This setting requires editing the `settings.json` for the extension directly. + +#### 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, but in testing this didn't work. If you figure it out, please open an issue or join our Discord! + +### Done! + +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! + +
+ + From ee7a858108674a373a20d34cc8728e8597889234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czopek?= <44530932+Grabsky@users.noreply.github.com> Date: Sun, 25 May 2025 22:58:59 +0200 Subject: [PATCH 2/2] rephrase and reformat --- autocompletion.md | 52 +++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/autocompletion.md b/autocompletion.md index 85ca32f..017204f 100644 --- a/autocompletion.md +++ b/autocompletion.md @@ -2,42 +2,50 @@ order: 92 icon: zap --- -# Auto Completion & Intellisense +# Auto Completion & IntelliSense +To enhance your development experience with LuaLink, it is recommended to set up auto completion with IntelliSense. -
-VSCode / VSCodium Setup +Getting this up and running is really simple. Choose your IDE and follow instructions below: -If you want auto completion and intellisense for LuaLink scripts in VSCode (or VSCodium), follow these simple steps: +=== **Visual Studio Code**   |   **VSCodium** -### 1. Install the Lua Extension +
-- Install the **sumneko Lua** extension: - - [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) - - [Open VSX](https://open-vsx.org/extension/sumneko/lua) +#### 1. Install Lua Extension +Download and install **sumneko Lua** extension. You can do this manually, or use built-in extension manager if available. -### 2. Get the LuaLink LLS Addon +{.list-icon} +- **Trusted Sources** +- [**:icon-link: VSCode Marketplace** (marketplace.visualstudio.com)](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) +- [**:icon-link: Open VSX** (open-vsx.org)](https://open-vsx.org/extension/sumneko/lua) -- Clone (recommended) or download [LuaLink/lualink-lls-addon](https://github.com/LuaLink/lualink-lls-addon) -- Cloning is recommended so you can update it easily: - ```bash - git clone https://github.com/LuaLink/lualink-lls-addon - ``` +--- + +#### 2. Get LuaLink LLS Addon +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. + +Cloning is recommended so you can update it easily. +```bash +git clone https://github.com/LuaLink/lualink-lls-addon +``` +Updating is as simple as executing `git pull` inside the cloned directory. + +**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. -### 3. Configure the Extension +--- + +#### 3. Configure Lua Extension +The last step is to configure **sumneko Lua** extension to make it recognize and index downloaded Lua stubs, and use our runtime plugin. - Open the settings for the Lua extension. - Add a new entry to `Lua.workspace.library` and enter the path to your `lualink-lls-addon` folder. - Set `Lua.runtime.plugin` to `lualink-lls-addon/plugin.lua`. - This setting requires editing the `settings.json` for the extension directly. -#### 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, but in testing this didn't work. If you figure it out, please open an issue or join our Discord! - -### Done! +**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). -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! +=== -
+**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.