coc-luals
v1.1.3
Published
Lua extension using lua-language-server for coc.nvim
Maintainers
Readme
🌙 coc-luals
coc-luals is a coc.nvim extension powered by lua-language-server (LuaLS). It provides the full feature set of LuaLS/vscode-lua, along with dedicated Neovim Lua development utilities like dynamic library imports and integrated addon management.
✨ Features
- 🎯 Full LuaLS Support: Complete language server features and configuration schema, using official binaries extracted from
LuaLS/vscode-lua. - ⚡ Auto-Download: Automatically downloads prebuilt binaries on first launch (Windows, macOS, Linux), or point to your own binary.
- 🧩 Neovim Lua Development: Auto
$VIMRUNTIMEloading, on-demand plugin library imports onrequire('...'), and quickfix code actions. - 📦 Addon Manager: Browse, install, and toggle official LuaLS/LLS-Addons directly in coc.nvim via
:CocList lls_addons.
📦 Installation
Install via coc.nvim:
:CocInstall coc-luals💡 On first launch, if
lua-language-serveris not found,coc-lualsprompts to download the prebuilt binary automatically.
📖 Neovim Lua Development
Designed for editing Neovim configurations and plugins:
- Automatic
$VIMRUNTIME: Provides autocompletion and documentation for Neovim runtime APIs (vim.api.*,vim.fn.*, etc.). - Runtime Plugin Completion: Autocomplete suggestions include modules from installed runtime plugins.
- Dynamic Library Import: Instead of adding every installed plugin to
workspace.libraryat startup, definitions are loaded on-the-fly when used. - Code Action: Offers
Import library '<name>' to workspaceon unimported module calls.
Configuration
// In :CocConfig
{
// Enable Neovim Lua development support (auto-imports $VIMRUNTIME)
"luals.nvimLua.enable": true,
// Optional: pre-import specific plugin libraries
"luals.nvimLua.library": [
"nvim-treesitter",
"plenary.nvim"
]
}🧩 Addon Manager
Manage addons from LuaLS/LLS-Addons (e.g. definitions and annotations for Busted, LÖVE, OpenResty, Hammerspoon).
Open the addon list:
:CocList lls_addons
" or
:CocCommand lua.openAddonManagerStatus Indicators
| Indicator | Status |
| :-------: | :----- |
| [+] | Enabled in workspace |
| [*] | Installed (disabled) |
| [-] | Available (not installed) |
Actions
<CR>: Enable addon (downloads and installs automatically if not yet present).<Tab>: Open action menu:enable: Enable addon and apply workspace settingsdisable: Disable addon and revert settingsinstall: Download and cache addonuninstall: Remove local addon cacheview on github: Open repository in browser
🛠️ Server Executable
- Default: Uses official release binaries extracted from
LuaLS/vscode-lua. - Custom Executable / Directory: To use a system package or custom build:
{ "Lua.misc.executablePath": "lua-language-server" // or // "luals.serverDir": "/path/to/lua-language-server" }
⌨️ Commands
| Command | Description |
| :------ | :---------- |
| lua.install | Install or update server binary |
| lua.restart | Restart Lua language server and extension |
| lua.checkUpdate | Check for server binary updates |
| lua.showVersion | Show current Lua Language Server version |
| lua.showUsage | Display server status and resource usage |
| lua.showChangelog | Open and read server changelog |
| lua.openAddonManager | Open the Addon Manager list |
| lua.reloadFFIMeta | Reload LuaJIT FFI metadata definitions |
⚙️ Settings
coc-luals supports all upstream LuaLS configuration options.
