All notable changes to the EmmyLua Analyzer Rust project will be documented in this file.
- Support for
@return_overloadannotation: Added support for@return_overload, which allow you define function return like pcall
---@return_overload true, string
---@return_overload false, integer
local function func()
endthen the two variables in local ok, res = func() will be correctly inferred as ok: true, res: string and ok: false, res: integer respectively.
- Ready for New Formatter: The language server plans to introduce a new formatter in version 0.23.0. This formatter can currently be experienced in CLI mode. You can download the latest formatter
luafmtfrom the release page. For related documentation, please refer to EmmyLua Formatter Documentation Index. This formatting tool draws inspiration from Prettier while maintaining more style options from EmmyLua CodeStyle. After replacing the original formatter, emmylua_ls will no longer depend on high-version C++ compilers, and formatting results will be more stable. However, there are still some edge cases with suboptimal formatting, which will be continuously fixed in subsequent versions.
- Update luars to 0.17.0: Updated the
luarsdependency to version 0.17.0. - Improve performance: Properly improved performance through a series of measures
Fix some bugs
- Support @schema url annotation: Added support for
@schemaannotation, which can be use to add completion and hover for json-schema-defined APIs. For example:
---@schema https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json
local c = {
-- will suggest `diagnostics` and more
}
- Update luars to 0.14.2: Updated the
luarsdependency to version 0.14.2, which includes various bug fixes and improvements to Lua parsing and execution.
- fix package.searchpath returns nil+error if none succeeds
- fix module recursive
- fix shebang support
- fix global declaration support
- fix select(n, func()) correctly narrows type when func returns multiple values
- fix resolve alias-call returns and simplify flow assignments
- fix the next returned by pairs should accept 2 arguments
- fix enforce segment-boundary fuzzy require matching
- fix stabilize fuzzy require resolution across duplicate suffix matches
- fix package.searchpath returns nil+error if none succeeds
- fix lua5.5 named vararg support: donot report syntax-error
- Support .emmyrc.lua configuration file: The language server and emmylua_check now support loading configuration from
.emmyrc.luain addition to.emmyrc.jsonand.luarc.json. Lua configuration is parsed using the luars library. A basic config looks like:
local diagnostics = {
disable = { "undefined-global" },
}
return {
diagnostics = diagnostics,
}You can use standard libraries such as os, table, utf8, string to write more complex configuration logic. print can be used for debugging; its output is redirected to the language server log.
Note: The current .emmyrc.lua does not have dedicated code completions; this will be added in a future release.
Note2: The luars project was developed by me with AI assistance. It is an almost-complete Lua 5.5 implementation but is still experimental and contains many bugs. Use with caution.
- Enhance workspace.library:
workspace.librarynow supports per-entry ignore configuration, for example:
{
"workspace": {
"library": [
{
"path": "/path/to/lib1",
"ignoreGlobs": [ "**/test/**" ],
"ignoreDir": ["docs"]
}
]
}
}Additionally, workspace.library can now point directly to a single file instead of a directory:
{
"workspace": {
"library": [
"/path/to/single/file.lua"
]
}
}- Improve type narrowing for 'and'/'or': Improved type narrowing for the
andandoroperators when used with nullable types and table/literal expressions.
- Fixed preferred_local_alias diagnostic
- Fixed some type checking issues
- Fixed recursive behavior in reference computation
- Optimized generic-related computations
- Support Lua5.5: Added support for Lua 5.5 syntax and features, including global declarations, table.create, and named vararg. For example:
global *
global <const> a, b, c
global d, e, f = 1, 2, 3
table.create(10, 0)
function func(...args)
end- Support format Lua 5.5 syntax: The built-in formatter now supports formatting Lua 5.5 syntax.
- Add new stdlib i18n translation: Added new internationalization functions to the standard library.
- Support call argument snippet completion: When
"completion.callSnippet": trueis enabled, provide snippet completions for function arguments during function calls. - Support param/@return completion: Typing
---@above a function will showparam/@returncompletion suggestions; accepting a suggestion will automatically fill parameter names and types.
- Workspace variable search optimization: Optimized workspace-wide variable search to decide whether to use case-sensitive or case-insensitive matching based on the input's casing.
- Fix integer literal parsing issue: Integers exceeding int64 are now recognized as floats instead of being treated as 0.
- Fix typecheck: Fixed several type checking issues.
An experimental Lua 5.4 interpreter implemented in Rust: https://github.com/CppCXY/lua-rs
- Type narrowing with union types using field checks: Changed the behavior when using a field of a union type in an
ifstatement for type narrowing. Now, if the field exists in some types of the union but not in others, the types without that field will be excluded from the narrowed type. For example:
local a --- @type string|{foo:boolean, bar:string}
if a.foo then
local _ = a.bar -- a will be narrowed to {foo:boolean, bar:string}
end- Support generic in @field: You can now use declaration generic type in
@fieldannotations. For example:
---@class GetType
---@field get_type fun<T>(name:`T`): T
local MyClass = {}
local d = MyClass.get_type("Car") -- d: "Car"- Refactor Document Symbols: Refactored the
textDocument/documentSymbolrequest to improve performance and accuracy. The new implementation provides better handling of nested symbols and improves the overall structure of the returned symbol tree.
- Fix Lazyvim.dev integration issue: Fixed an issue where Lazyvim.dev integration did not work correctly due to ignore
workspace/didConfigurationchanges. - Fix Completion: Fixed an issue where certain completions were not being suggested, like:
Partial<Type> - Fix nil propagation in consecutive field access: Fixed an issue where, during consecutive field access, if a previous field could be nil, subsequent fields would incorrectly propagate the nil type. For example:
local a --- @type { foo? : { bar: { baz: number } } }
local b = a.foo.bar -- a.foo may be nil (correct)
local _ = b.baz -- b is number- Refactor IndexAliasName: Removed the original index alias implementation (
-- [IndexAliasName]), now use---@[index_alias("name")]. - Refactor ClassDefaultCall: Removed the configuration item
runtime.class_default_call, now use---@[constructor("<constructor_method_name>")]. - Rename ParamTypeNotMatch to ParamTypeMismatch: Renamed the diagnostic
ParamTypeNotMatchtoParamTypeMismatchfor better clarity. - Optimize comment parsing logic: Comments now preserve leading spaces at the start of each line, maintaining the original formatting as much as possible when returned to the LSP client.
- Attribute: Introduced the new feature
---@attributefor defining additional metadata, with several built-in attributes:
--- Deprecated. Accepts an optional message parameter.
---@attribute deprecated(message: string?)
--- Language Server Optimization Items.
---
--- Parameters:
--- - `check_table_field`: Skips assignment checks for table fields. Recommended for large configuration tables.
--- - `delayed_definition`: Indicates the variable type is determined by the first assignment.
--- Only valid for `local` declarations without an initial value.
---@attribute lsp_optimization(code: "check_table_field"|"delayed_definition")
--- Index field alias, displayed in `hint` and `completion`.
---
--- Accepts a string parameter for the alias name.
---@attribute index_alias(name: string)
--- This attribute must be applied to function parameters, and the parameter type must be a string template generic.
--- Used to specify the default constructor of a class.
---
--- Parameters:
--- - `name`: The method name as a constructor.
--- - `root_class`: Marks the root class, will be implicitly inherited, e.g., `System.Object` in C#. Defaults to empty.
--- - `strip_self`: Whether the `self` parameter can be omitted when calling the constructor, defaults to `true`.
--- - `return_self`: Whether the constructor is forced to return `self`, defaults to `true`.
---@attribute constructor(name: string, root_class: string?, strip_self: boolean?, return_self: boolean?)
--- Associates `getter` and `setter` methods with a field. Currently only provides definition navigation functionality.
--- The target methods must be within the same class.
---
--- Parameters:
--- - `convention`: Naming convention, defaults to `camelCase`. Implicitly adds `get` and `set` prefixes. e.g., `_age` -> `getAge`, `setAge`.
--- - `getter`: Getter method name. Takes precedence over `convention`.
--- - `setter`: Setter method name. Takes precedence over `convention`.
---@attribute field_accessor(convention: "camelCase"|"PascalCase"|"snake_case"|nil, getter: string?, setter: string?)The syntax is ---@[attribute_name_1(arg...), attribute_name_2(arg...), ...], and multiple attributes can be used simultaneously. Example:
---@class A
---@[deprecated] # If the attribute can omit parameters, `()` can be omitted
---@field b string # b is now marked as deprecated
---@[index_alias("b")]
---@field [1] string # This will be shown as `b` in hints and completion- More Generic Type: support generic like:
--- Get the parameters of a function as a tuple
---@alias Parameters<T extends function> T extends (fun(...: infer P): any) and P or never
--- Get the parameters of a constructor as a tuple
---@alias ConstructorParameters<T> T extends new (fun(...: infer P): any) and P or never
--- Make all properties in T optional
---@alias Partial<T> { [P in keyof T]?: T[P]; }- Support gutter request for intellij: Added support for gutter requests in IntelliJ, allowing for better integration with the IDE's features.
- Fix completion: Fixed an issue where certain completions were not being suggested, like:
if not self:<|>- Fix '~' Replace error in config: Fixed an issue where using '~' in configuration paths did not correctly expand to the user's home directory.
- Fix enum completion issue: Fixed an issue where enum members were not being suggested in completions.
- Fix workspace load status bar: Fixed an issue where the workspace load status bar always display in empty lua workspace.
- Fix some condition narrow: Fixed some issues with condition-based type narrowing not working as expected.
- Support
workspace/diagnostic: Added support for theworkspace/diagnosticrequest, allowing clients to fetch diagnostics for the entire workspace. - Support global function overload: You can now define overloads for global functions in
@metafiles. For example:
---@meta
function overload(a: integer): integer
end
function overload(a: string): string
end- Update lsp-server dependency: Updated the
lsp-serverdependency to version 0.7.9 to leverage the latest features and improvements. - Migrate
lsp-typestoemmy-lsp-types: Migrated from using thelsp-typescrate to theemmy-lsp-typescrate, which is a fork tailored for EmmyLua Analyzer Rust. This change allows for better customization and alignment with the project's specific needs.
- Fix deadlock issue: Resolved a deadlock issue that could occur during certain operations, improving the stability of the language server.
- Fix diagnostic reporting: Fixed an issue where some diagnostics never cleaned up after files were change information.
- Fix overload description issue: Fixed an issue where descriptions for overloaded functions were not displayed correctly in completion and hover tooltips.
- Use Clippy as linter: core codebase now uses Clippy as the linter, improving code quality and consistency.
- Support
textdocument/diagnostic: Added support for thetextDocument/diagnosticrequest, allowing clients to fetch diagnostics for a specific document. - Support annotation
@readonly: You can now use the@readonlyannotation to mark fields as read-only. For example:
---@readonly
local myVar = 42- Add check for
global in non module: Added a new diagnostic to check for global variable declarations in non-module scope. This helps detect unintended global variable declarations.
- Optimize semantic token: Optimized semantic token handling for delimiter symbols.
- Fix generic pattern matching issue: Fixed an issue where generic pattern matching aliases could lead to incorrect type inference.
- Parser Optimization: The parser now reports syntax errors more accurately and has improved error recovery.
- @type Support for Return Statements: You can now use
@typeabove a return statement to specify the return value type, for example:
---@return vim.lsp.Config
return {}- Type Checking Optimization: Improved type checking algorithms for better performance.
- SARIF Format for emmyLua_check:
emmyLua_checknow supports SARIF format output, enabled via the--format sarifcommand line option. - Generic List Supports T... Syntax: Generic lists now support the
T...syntax, for example:
---@alias MyTuple<T...> [T...]- Fix create progress: Fixed an issue with the
window/workDoneProgress/createprotocol; it must be sent as a request, not a notification. - Fix Function Overload Algorithm: Rewrote the function overload algorithm to better handle variadic function parameters.
- LSP Handler Order: Fixed an issue where LSP request donot handle during initialization.it will be handle after initialization complete.
- Support @link in comment: You can now use
@linkin comments to create clickable links. For example:
--- This is a link to {@link string.format}- Support
--editordirective: You can now use the--editordirective to specify the editor type. For example:
emmylua_ls --editor intellij- Support range foramt for external tool: You can now use the
rangeFormatrequest to format a specific range of code using an external tool. This feature can be enabled with the following configuration:
{
"format": {
"externalToolRangeFormat": {
"program": "stylua",
"args": [
"-",
"--stdin-filepath",
"${file}",
"--indent-width=${indent_size}",
"--indent-type",
"${use_tabs?Tabs:Spaces}",
"--range-start=${start_offset}",
"--range-end=${end_offset}"
],
"timeout": 5000
}
}
}for more information, please refer to External Formatter Options.
- Add Basic EmmyLua Annotation Documentation: Added more documentation for EmmyLua annotations, please refer to EmmyLua Annotation Documentation.
- Refactor LSP Handler: Refactored LSP handler to improve performance and maintainability.
- Refactor Folding Range: Refactored folding range to support
Intellij - Add More Semantic Token: Added more semantic tokens to improve syntax highlighting.
- Crash issue fixed: Fixed a crash caused by parsing Unicode characters in comments.
- Large table performance issue fixed: Fixed a performance issue where parsing large array tables in projects caused severe slowdowns.
- Generic type matching fixed: Fixed an issue with incorrect matching of
constTpl<T>types affecting generic type hints.
-
Markdown syntax highlighting enabled by default: Markdown syntax highlighting in comments is now enabled by default, including partial syntax highlighting for code blocks within comments.
-
Support for
@language: Added support for using@languagein comments to specify the language of code blocks, for example:---@language lua local d = [[ print("Hello, world!") ]]
This enables syntax highlighting for Lua code.
-
Support for
Language<T>generic type: You can now useLanguage<T: string>in parameter comments to specify the language of a parameter, for example:---@param lang Language<"vim"> function vim_run(lang) end vim_run [[set ft=lua]]
Supported injected languages: lua, vim, sql, json, shell, protobuf.
-
Support for
keyof type: When a function parameter iskeyof type, corresponding code completion is provided.
- Fixed a stack overflow crash: Resolved an issue that caused the language server to crash due to excessive recursion.
- Fixed a deadlock issue: Resolved an issue that caused the language server to hang indefinitely in Neovim.
- Fixed workspace libraries: Resolved an issue where libraries in subdirectories were incorrectly added to the main workspace.
- Fixed error reporting: Resolved an issue where error reports were not being generated correctly for table fields.
- Support for Markdown/MarkdownRst: Added support for Markdown and reStructuredText (RST) formats highlighted in documentation comments. This feature is disabled by default and can be enabled with the following configuration:
{
"semanticTokens": {
"renderDocumentationMarkup": true
},
"doc": {
"syntax": "md"
}
}- Support for external formatting tools: Added support for external formatting tools. You can now configure an external formatter to format your Lua code. This feature can be enabled with the following configuration:
{
"format": {
"externalTool": {
"program": "stylua",
"args": [
"-",
"--stdin-filepath",
"${file}",
"--indent-width=${indent_size}",
"--indent-type",
"${use_tabs:Tabs:Spaces}"
]
}
}
}Note: The built-in formatter is not stylua, but emmyluacodestyle. This feature simply provides an extension point, allowing users to use their preferred formatting tool. In terms of performance, using this extension may be faster than using other plugins.
- Support for non-standard symbols: Added support for non-standard symbols in Lua.
{
"runtime": {
"nonstandardSymbol": [
"//",
"/**/",
"`",
"+=",
"-=",
"*=",
"/=",
"%=",
"^=",
"//=",
"|=",
"&=",
"<<=",
">>=",
"||",
"&&",
"!",
"!=",
"continue"
]
}
}- Fix create an empty directory: Fixed an issue where the language server would create an empty directory.
- Rust Edition 2024: The language server is now built with Rust Edition 2024, which brings various performance and stability improvements.
- Refactor generic function inference: Lambda function parameters now use deferred matching, allowing generic types to be inferred from other parameters first. For example:
---@generic T
---@param f1 fun(...: T...): any
---@param ... T...
function invoke(f1, ...)
end
invoke(function(a, b, c) -- infer as: integer, integer, integer
print(a, b, c)
end, 1, 2, 3)- Generic Type Decay: Now, generic types that match constants of integer, string, float, or boolean will be directly converted to their corresponding general types.
- Use Mimalloc: Mimalloc is now the default memory allocator, improving performance and memory management. Startup performance is increased by about 50%.
- Lua 5.5 Syntax Support: More complete support for Lua 5.5 syntax, including
globaldeclarations,table.create, and the new attribute syntax. For example:
local <const> a, b, c = 1, 2, 3
global <const> d, e, fAlso supports immutability checks for iterator variables in for loop statements.
- Doc Cli Modification: Improved the documentation CLI to better handle various edge cases and provide more accurate suggestions.
- Fix load order: Fixed an issue where the order of loading files could lead to incorrect type inference.
- Fix Unpack infer: Fixed an issue where unpacking a table in a table.
- Fix rename in @param: Fixed an issue where renaming a parameter in a function param.
- Flow Inference Refactor: Refactored flow analysis algorithm, now uses a TypeScript-like flow analysis approach for better handling of complex scenarios.
- Doc CLI: Changed export format, now supports multiple
@seeand other tag flags.
- TypeGuard Now Supports Generics: You can now use generic parameters in TypeGuard, e.g.
TypeGuard<T>. - Type Narrowing by Constant Fields: Supports type narrowing using constant fields.
- Basic Range Checking: Array type indexing is now less frequently nullable.
- Bug Fixes: Fixed various bugs.
-
Support for Descriptions Above and After Tags: You can now add descriptions both above a tag (as a preceding comment) and after a tag (inline). The description will be associated with the corresponding tag.
---@class A --- Description below (applies to the @field a) ---@field a integer inline-description ---@field b integer # description after hash --- Description above (applies to the @field b) ---@field c integer inline-description local a = {}
-
Add call
__callhint: Add call__callhint, enable byhint.metaCallHint---@class A ---@overload fun(a: integer): integer local A A(1) -- There will be a lightning prompt between `A` and `(` or a `new` prompt before `A`
-
Support syntax
--[[@cast -?]]: When@castis followed by an operator instead of a name, it will convert the type of the previous expression, but currently only works for function calls! -
Quick Fix for Nil Removal: Added quick fix action for
NeedCheckNildiagnostic that suggests using@castto remove nil type---@Class Cast1 ---@field get fun(self: self, a: number): Cast1? local A local _a = A:get(1) --[[@cast -?]]:get(2):get(3) -- Quick fix will prompt whether to automatically add `--[[@cast -?]]`
-
Base Function Name Completion: Added
completion.baseFunctionIncludesNameconfiguration to control whether function names are included in base function completions{ "completion": { "baseFunctionIncludesName": true } }When enabled, function completions will include the function name:
function name() endinstead offunction () end -
Cast Type Mismatch Diagnostic: Added new diagnostic
CastTypeMismatchto detect type mismatches in cast operations---@type string local a = "hello" --[[@cast a int]] -- Warning
-
Auto Require Naming Convention Configuration: Added
completion.autoRequireNamingConvention.keep-classconfiguration option. When importing modules, if the return value is a class definition, the class name will be used; otherwise, the file name will be used{ "completion": { "autoRequireNamingConvention": "keep-class" } } -
File rename prompts whether to update
requirepaths: Added prompt when renaming files to ask whether to update corresponding import statements
-
Class Method Completion: When a function call jumps, if there are multiple declarations, It will then attempt to return the most matching definition along with all actual code declarations, rather than returning all definitions.
-
Definition Jump Enhancement: When jumping to definition from function calls, if the target is located in a return statement, the language server will now attempt to find the original definition. For example:
-- test.lua local function test() end return { test = test, }
local t = require("test") local test = t.test -- Previously jumped to: test = test, test() -- Now jumps to: local function test()
- Enum Variable Parameter Issue: Fixed a crash issue when checking enum variable as parameter
- Circle Doc Class Issue: Fixed a bug that caused the language server to hang when
- Generic constraint improvements: Generic constraint (StrTplRef) removes the protection for string
---@generic T: string -- need to remove `: string` ---@param a `T` ---@return T local function class(a) end ---@class A local A = class("A") -- error
-
Immutable Tuples: Explicitly declared
Tupleare now immutable---@type [1, 2] local a = {1, 2} a[1] = 3 -- error
-
Class Default Call Configuration: Added
classDefaultCallconfiguration item{ "runtime": { "classDefaultCall": { "functionName": "__init", "forceNonColon": true, "forceReturnSelf": true } } } -
Base Type Matching: Added
docBaseConstMatchBaseTypeconfiguration item{ "strict": { "docBaseConstMatchBaseType": true } } -
Enhanced Inlay Hints: Params hint can now jump to the actual type definition
-
Improved File Management: When closing files not in workspace/library, their impact is removed
-
Enhanced Ignore Functionality: Ignored files won't be parsed when opened
- Function Hover: Function hover now shows corresponding doc comments
- Go to Definition: Fixed crash when using "go to definition" of member
- Enum Parameters: Fixed enum usage as function parameters
- Function Completion: Fixed function completion for table fields expecting functions
- New Standard Types:
std.Unpacktype for betterunpackfunction inferencestd.Rawgettype for betterrawgetfunction inference
- Generator Support: Implementation similar to
luals - Enhanced Generic Inference: Improved generic parameter inference for lambda functions
- Type Checking: Added type checking for intersection types
- Generic Constraints: Support for generic constraint checking and string template parameters
- Documentation Hints: Added in code completion for modules and types
- Math Library: Changed
math.hugeto number type - Type Hints: Optimized rendering of certain type hints
- Type Narrowing: Fixed issue where type narrowing is lost in nested closures
- Variadic Returns: Optimized inference of variadic generic return values
- Performance: Fixed performance issue with large Lua tables causing unresponsiveness
-
@return_cast Support: Support
@return_castfor functions. When a function's return value is boolean (must be annotated as boolean), you can add an additional annotation---@return_cast <param> <cast op>, indicating that when the function returns true, the parameter<param>will be transformed to the corresponding type according to the cast. For example:---@return boolean ---@return_cast n integer local function isInteger(n) return n == math.floor(n) end local a ---@type integer | string if isInteger(a) then print(a) -- a: integer else print(a) -- a: string end
@return_castsupport self param. For example:---@class My2 ---@class My1 ---@class My3:My2,My1 local m = {} ---@return boolean ---@return_cast self My1 function m:isMy1() end ---@return boolean ---@return_cast self My2 function m:isMy2() end if m:isMy1() then print(m) -- m: My1 elseif m:isMy2() then print(m) -- m: My2 end
- Diagnostic Changes: Remove diagnostic
lua-syntax-error, it merges intosyntax-error, adddoc-syntax-errorfor doc syntax error - Format Changes: Fix format issue, Now When exist
syntax-error, the format never return value
- Performance Fixes: Fix a performance issue: prevent large union types when functions return tables
- Require Function Changes: When an object returned by require function is a class/enum, defining new members on it is prohibited, while tables are not restricted
- Lua 5.5 Support: Support
Lua 5.5global decl grammar - TypeGuard Support: Support
TypeGuard<T>as return type. For example:---@return TypeGuard<string> local function is_string(value) return type(value) == "string" end local a if is_string(a) then print(a:sub(1, 1)) else print("a is not a string") end
- Call Hierarchy Support: Support
Call hierarchybut only support incomming call - @internal Tag: Support new tag
@internalfor members or declarations. When a member or declaration is marked as@internal, it is only visible within its current library. This means that if you use@internalin one library, you cannot access this member or declaration from other libraries or workspace. - Go to Implementation: Support
Go to implementation - @nodiscard with Reason: Support
@nodiscardwith reason
- Performance Fixes: Fix Some performance issue
- Global Configuration Support: Now language server configuration might be provided globally via the
<os-specific home dir>/.emmyrc.json,<os-specific config dir>/emmylua_ls/.emmyrc.json, or by setting a variableEMMYLUALS_CONFIGwith a path to the json configuration. Global configuration have less priority than the local one - Class Inference from Generic Types: Classes might now infer from generic types and provide corresponding completions.
- Flow Analyze Algorithm: Refactor flow analyze algorithm
- Self Inference: Fix some self infer issue
- Diagnostic Action: Fix some diagnostic action issue
- Type Check and Completion: Optimize some type check and completion
- Type Infer Refactor: Refactor
type infer - Member Infer Refactor: Refactor
member infer - Tuple Type Check: Optimize and Fix tuple type check
- Math Library: Changed
math.hugeto number type
- Variadic Type Support in Tuple: Support Varidic type use in tuple, eg:
[string, integer...] - Pcall Infer Optimization: Optimize pcall infer, now can match the self and alias
- Range Iter Var Optimization: for range iter var now will remove nil type
- Setmetatable Infer Support: Support infer from setmetatable
- emmylua_doc_cli Export: emmylua_doc_cli will export more information
- Subclass and Super Class Rule Optimization: Optimize type check rule for subclass and super class
- Description Support for Union Type: Add description to type
- Multi Union Description Support: Support description without '#' on multi union
- Standard Library Translation: Add standard library translation
- Parameter Inlay Hint Optimization: Optimize inlay hint for parameter, if the parameter name is the same as the variable name, the parameter name will not be displayed
- Re-index Control: Disable re-index in default, need to enable by
workspace.enableReindex - New Diagnostics: Add New Diagnostics
inject_field,missing_fields,redefined_local,undefined_field,inject-field,missing-global-doc,incomplete-signature-doc,circle-doc-class,assign-type-mismatch,unbalanced_assignments,check_return_count,duplicate_require,circle_doc_class,incomplete_signature_doc,unnecessary_assert - Boolean Type Support: Support
trueandfalseas type - Compact Fun Return Syntax: Compact luals fun return syntax like:
(name: string, age: number) - Iterator Function Aliases: Aliases and overloads of iterator functions (i.e
fun(v: any): (K, V)whereKis the key type andVis the value type) are now used to infer types inforloops - Compact String Template Syntax: Compact luals string template syntax like: xxx
T,T,TXXX, usage:---@generic T ---@class aaa.`T`.bbb ---@return T function get_type(a) end local d = get_type('xxx') --- aaa.xxx.bbb
- @see Support: Support
@seeany thing - Module Documentation Export Enhancement: Enhance module documentation export
- @module Support: Support
@moduleusage:---@module "module path"
- Generic Dots Params Type Check: Fix generic dots params type check
- Generic Table Infer Issue: Fix generic table infer issue
- Tuple Infer Issue: Fix tuple infer issue
- Env Variable Support: Compact luals env variable start with
$ - Humanize Type Refactor: Refactor
humanize typefor stack overflow issue - Documentation CLI Tool Render Enhancement: Fix a documentation cli tool render issue
- Diagnostic Progress Issue Fix: Fix diagnostic progress issue
- Negative Integer Type Support: Support negative integer as type
- TypeScript-like Type Gymnastics: Support TypeScript-like type gymnastics
- Reference Search Improvement: Improve reference search
- Type Check Refactor: Refactor type check
- Hover Optimization: Optimize hover
- Completion Optimization: Optimize completion
- Pcall Return Type Support: Support
pcallreturn type and check
- Infinite Recursion Issue in Alias Generics: Fix infinite recursion issue in alias generics.
- Fold Range Refactor: Refactor
folding range - Super Class Completion Support: Fix super class completion issue
- Function Overload Support in @field: Support
@fieldfunction overload like:---@class AAA ---@field event fun(s:string):string ---@field event fun(s:number):number
- Enum Type Check Fix: Fix enum type check
- Custom Operator Infer Fix: Fix custom operator infer
- Select Function Fix and Std.Select Type Addition: Fix select function and add std.Select type
- Union Type Refactor: Refactor Union type
- Description Support for Type: Add description to type
- Multi Union Description Support: Support description without '#' on multi union
- Standard Library Translation: Add standard library translation
- Parameter Inlay Hint Optimization: Optimize inlay hint for parameter, if the parameter name is the same as the variable name, the parameter name will not be displayed
- Unix Issue Fix: Fix issue
emmylua_lsmight not exit in unix.
- TypeScript-like Type Gymnastics: Support TypeScript-like type gymnastics
- Reference Search Improvement: Improve reference search
- Type Check Refactor: Refactor type check
- Hover Optimization: Optimize hover
- Completion Optimization: Optimize completion
- Pcall Return Type Support: Support
pcallreturn type and check
- Tuple to Array Casting Type-check: Support type-check when casting tuples to arrays.
- Function Overloads Autocompletion: Now autocompletion suggests function overloads.
- Improved Completion for Integer Member Keys: Improved completion for integer member keys.
- Value Inference by Reassign: Infer value by reassign
- Base Control Flow Analyze Improvement: Improved analyze base control flow
- Class Hover Enhancement: Improved hover for class
- Semantic Token Optimization: Optimized semantic token
- Tuple Inference for Table Array: Infer Some table array as tuple
- Array Inference for
{ ... }: Infer{ ... }as array - Immutable Semantic Model: Semantic Model now is immutable
- Iteration Order Issue: Fix inference issue by resolving iteration order problem.
- Type Check Improvement: Improve type check
- Executable File Directory Hierarchy Issue: Fix issue with executable file directory hierarchy being too deep.
- Generic Table Infer Issue: Fix generic table infer issue
- Tuple Infer Issue: Fix tuple infer issue
- Env Variable Support: Compact luals env variable start with
$ - Humanize Type Refactor: Refactor
humanize typefor stack overflow issue - Documentation CLI Tool Render Enhancement: Fix a documentation cli tool render issue
- Diagnostic Progress Issue Fix: Fix diagnostic progress issue
- Generic Alias Fold Support: Support generic alias fold
- Code Style Check: Support
code style check, which powered byemmyluacodestyle - Basic Table Declaration Field Names Autocompletion: Basic table declaration field names autocompletion.
- Integer Overflow Panic Issue: Fix possible panic due to integer overflow when calculating pows.
- Std Resource Loaded for CLI Tools: Fix std resource loaded for cli tools
- Self Parameter Regard as Unuseful Issue: Fix
selfparameter regard as unuseful issue
- emmylua_check CLI Tool: Add
emmylua_checkcli tool, you can use it to check lua code. you can install it bycargo install emmylua_check
- Global Crates Release: all the crates release to crates.io. now you can get
emmylua_parser,emmylua_code_analysis,emmylua_ls,emmylua_doc_clifrom crates.io.cargo install emmylua_ls cargo install emmylua_doc_cli
- Template System Refactor: refactor
template system, optimize the generic infer - Configuration Loading in NeoVim: now configurations are loaded properly in NeoVim in cases when no extra LSP configuration parameters are provided
- Humanization of Small Constant Table Types: extended humanization of small constant table types
-
Module Name Mapping Configuration: Add configuration option
workspace.moduleMapto map old module names to new ones. ThemoduleMapis a list of mappings, for example:{ "workspace": { "moduleMap": [ { "pattern": "^lib(.*)$", "replace": "script$1" } ] } }This feature ensures that
requireworks correctly. If you need to translate module names starting withlibto usescript, add the appropriate mapping here. -
Project Structure Refactor: Refactor project structure, move all resources into executable binary
- Develop Guide: Add Develop Guide
- workspace/didChangeConfiguration Notification Support: support
workspace/didChangeConfigurationnotification for neovim - Semantic Token Refactor: refactor
semantic token - Simple Generic Type Instantiation Support: support simple generic type instantiation based on the passed functions
- Find Generic Class Template Parameter Issue Fix: Fix find generic class template parameter issue
- Multiple Return Value Inference Errors: Fixed some multiple return value inference errors
- Redundant @return in Hover: Removed redundant
@returnin hover
- Resource File Location Support: Language server supports locating resource files through the
$EMMYLUA_LS_RESOURCESvariable
- Indexing Completion Issue: Fixed a potential issue where indexing could not be completed
- Type Checking with Subclass Parameters: Fixed an issue where type checking failed when passing subclass parameters to a parent class
- Progress Notifications for Non-VSCode Platforms: Add progress notifications for non-VSCode platforms
- Nix Flake Installation Support: Add nix flake for installation by nix users, refer to PR#4
- Parameter and Return Descriptions in Hover: Support displaying parameter and return descriptions in hover
- Consecutive Require Statements as Import Blocks: Support viewing consecutive require statements as import blocks, automatically folded by VSCode if the file only contains require statements
- Spelling Error: Fix spelling error
interger->integer - URL Parsing Issue: Fix URL parsing issue when the first directory under a drive letter is in Chinese
- Table Type Checking Issues: Fix type checking issues related to tables
- Document Color Implementation: Modify the implementation of document color, requiring continuous words, and provide an option to disable the document color feature
- Type Inference Issue with Self as Parameter: Fix type inference issue when
selfis used as an explicit function parameter