Core Completion Features
Auto Require
Intelligently lists available Lua modules and automatically adds require statements on selection
Alias & Enum
Smart completion based on parameter types with support for alias and enum fields
Function Lambda
Detects function type parameters and automatically generates lambda expressions
Namespace
Supports namespace completion with smart suggestions for sub-namespaces and class names
Auto Require
When typing module names, EmmyLua intelligently suggests available Lua modules from your workspace. Upon selection (Tab press), it automatically adds therequire statement at the appropriate position in your file header.
- Intelligently lists available Lua modules
- Automatically adds require statement on Tab press
- Smart insertion at appropriate position in file header
- Supports both
.and/separators
Alias & Enum Completion
Context-aware completion that understands parameter types and suggests appropriate alias and enum values.- Smart completion based on parameter types
- Support for alias and enum fields
- Context-aware precise completion
- Works with union types
Function Lambda Generation
Automatically generates lambda expressions when function type parameters are detected, keeping your code clean and elegant.- Detects function type parameters
- Automatically generates lambda expressions
- Includes parameter names and types
- Keeps code clean and elegant
Namespace Completion
Supports namespace completion with smart suggestions for sub-namespaces and class names.- Use
---@type namespace<"ClassName">annotation - Smart suggestions for sub-namespaces and class names
- Supports nested namespace completion
Path Completion System
- Module Paths
- File System Paths
Smart completion for require parameters, supports both Features:
. and / separators.- Intelligent module path detection
- Support for
.and/separators - Workspace-aware suggestions
- Fuzzy matching support
Advanced Completion Features
Postfix Completion
Type@ or . after variables to trigger expression completion templates.
@for- Generate for loop@if- Generate if statement@not- Negate expression@return- Generate return statement
Snippet Completion
Built-in code snippets for common patterns and structures.- Built-in code snippets
- Support for common Lua patterns
- Tab stops for easy navigation
- Future support for custom template system
Trigger Characters
Completion can be triggered by the following characters:.- Member access:- Method call(- Function parameters[- Table index"or'- String literals (for paths)- Space (for keywords)@- Postfix templates\or/- File paths|- Union types
Smart Features
Fuzzy Matching
Fuzzy Matching
All completion features support fuzzy matching for faster code writing.The fuzzy matcher considers:
- Character sequence matching
- CamelCase abbreviations
- Common abbreviations
Smart Sorting
Smart Sorting
Completion items are intelligently sorted based on:
- Relevance to current context
- Usage frequency
- Scope proximity
- Type compatibility
- Recently used items
Context Awareness
Context Awareness
The completion engine understands your code context:
- Function signatures
- Variable types
- Table structures
- Module imports
- Documentation comments
Configuration
Completion behavior can be configured through your.emmyrc.json:
