Quick Start Guide
This guide will get you from zero to a fully working EmmyLua Analyzer setup in just 5 minutes. Let’s dive in!Install EmmyLua Analyzer
Install the language server using Cargo (Rust’s package manager):Or use pre-built binaries from the releases page.
Don’t have Rust? Install it first:
Install Editor Extension
Install the appropriate extension for your editor:
- VS Code
- Neovim
- IntelliJ IDEA
Install the EmmyLua extension from the marketplace:
- Open VS Code
- Press
Ctrl+P(orCmd+Pon macOS) - Type:
ext install tangzx.emmylua - Press Enter
emmylua_ls binary.Experience the Features
Open the file in your editor and try these features:
Auto-Completion
Auto-Completion
Type
hero: and you’ll see:move- Move the player by the specified deltatakeDamage- Apply damage to the playerdistanceTo- Get the distance from another position- All fields:
name,health,position
Hover Information
Hover Information
Hover over:
Player.new→ See the function signature and documentationhero→ See it’s typePlayerwith all fieldsself.health→ See it’s typenumberand description
Go to Definition
Go to Definition
Ctrl+Click(orCmd+Click) onPlayer.newto jump to its definition- Works across files in your project
- Jump back with
Alt+Left Arrow
Find References
Find References
- Right-click on
Playerand select “Find All References” - See everywhere the class is used
- Works for functions, variables, and types
Real-Time Diagnostics
Real-Time Diagnostics
Try introducing errors:EmmyLua will highlight these issues immediately!
Rename Refactoring
Rename Refactoring
- Right-click on
Playerand select “Rename Symbol” - Type a new name like
Character - All references are updated across your project!
Configure Your Project (Optional)
Create a.emmyrc.json file in your project root for custom configuration:
The
$schema field enables auto-completion for the config file itself!Advanced Example: Generic Functions
Let’s create a more advanced example with generics:Run Static Analysis
Optionally install the static analyzer to check your code:Generate Documentation
Optionally install the documentation generator:./docs directory!
Common Use Cases
Game Development
Perfect for Lua-based game engines like:
- LÖVE 2D
- Defold
- Corona SDK
- Roblox
Neovim Configuration
Write better Neovim configs with:
- Full
vimAPI completion - Type checking for plugins
- Documentation on hover
Web Development
Use with:
- OpenResty / Nginx
- Lapis framework
- API development
Embedded Scripting
Enhance embedded Lua in:
- Application plugins
- Configuration systems
- Scripting engines
Troubleshooting
Language server not starting
Language server not starting
Check that If not found, ensure
emmylua_ls is in your PATH:~/.cargo/bin is in your PATH:No completion suggestions appearing
No completion suggestions appearing
- Make sure the file is saved with a
.luaextension - Check your editor’s LSP status (usually in the status bar)
- Restart the language server from your editor’s command palette
- Check for errors in the language server logs
Type annotations not working
Type annotations not working
- Ensure you’re using the correct annotation syntax:
---@class,---@param, etc. - Check that there are no syntax errors in your annotations
- The annotation must be directly above the code it describes
- No blank lines between annotation and code
Project-wide features not working
Project-wide features not working
- Make sure you’ve opened the project root folder in your editor, not just a file
- Check that
.emmyrc.jsonis in the project root - Try reloading the workspace
Next Steps
Editor Setup
Detailed configuration for your specific editor
Annotation Guide
Learn all the annotation types and their uses
Configuration
Customize EmmyLua for your workflow
Static Analysis
Integrate checks into your CI/CD pipeline
Documentation
Generate docs from your annotations
Contributing
Learn how to contribute to the project
Community Resources
GitHub Discussions
Ask questions and share your projects
Report Issues
Found a bug? Let us know!
