85 KiB
changelog
Unreleased
3.15.0
2025-6-25
NEWSupport custom addons path for enhanced editor flexibilityNEWAddLua.type.maxUnionVariantswhich can be set to limit how many union variants are checked againstCHGAdd missing localeCHGFulfill zh-tw translationsFIXCannot debug in Linux due to lua-debug expecting host process to have lua54 symbols availableFIXSupport hex color codes with#intextDocument/documentColorFIXPrevent class methods from triggering missing-fields diagnosticsFIXUpdates the EmmyLuaCodeStyle submodule reference to a newer commit, ensuring compatibility with GCC 15FIXLarge unions will no longer erroneously fail to match later variants
3.14.0
2025-4-7
NEWlocalees-419, thanks Felipe LemaFIXprevent unnecessary edits by LSP formatting when content did not changeFIXreturn no completions if completion is disabledFIXoptimized the performance of large literal tables (e.g., configuration tables)
3.13.9
2025-3-13
CHGremove the limit for analyzing the literal table
3.13.8
2025-3-12
CHGwhen analyzing the literal table, only the first 100 items are analyzed at mostCHGwhen checking type matching for union types, only the first 100 items are checked at mostFIXUpdate--helpmessage.FIX--check now respects ignoreDir settingFIXincorrect argument skip pattern for--check_out_path=, which incorrectly skips the next argument
3.13.7
2025-3-10
NEWCLI: added--help.CHGdefault path for--doc_out_pathis the current directoryFIXincorrect argument skip pattern for--check_out_path=, which incorrectly skips the next argumentFIXincorrect error message for--doc_update.FIXreimplement sectionluals.configin file doc.jsonFIXincorrect file names in file doc.jsonFIXremove extra./path prefix in the check report when using--check=.FIXNarrowing of types with literal fields: #3056, #3089FIXcorrect lua version ofmath.ultandmath.typeFIXincorrect links forpatterninstringmethodsFIXfix type annotations for bit moduleFIXAnother regression related to type narrow and generic param introduced sincev3.10.1#3087
3.13.6
2025-2-6
NEW---@classsupports attributepartial, which will not check missing inherited fields #3023This enables the previous missing field check behavior before #2970---@class Config ---@field a number ---@class (partial) Config.P: Config ---@field b number ---@type Config.P[] local cfgs = {} cfgs[1] = { b = 1 } -- no warning cfgs[2] = {} -- only warns missing `b`NEWAdded variable substitution support for vscode's${workspaceFolder:x}when resolving path placeholders #2987NEWAdded--check_format=json|prettyfor use with--checkto output diagnostics in a human readable format.NEWTest CLI:--name=<testname>-n=<testname>: run specify unit testCHGGeneric pattern now supports definition after capture and optional, union, array #3014 #3031---@generic T ---@param t `T`.Cat? ---@return T? local function f(t) end local t = f('Smile') --> t is `(Smile.Cat)?`FIXFixed the error that the configuration file pointed to by the--configpathoption was not read and loaded.FIXDon't truncate any output when running in--docmode #3049FIXGeneric return can be optional.FIXFixed the comment calculating in docs---@param a string?Comment- now itsCommentinstead ofomment#3028FIXFixed cannot bind variables using tail comment@class#2673FIXFixed missing field completion for generic class object #2196 #2945 #3041
3.13.5
2024-12-20
NEWSetting:Lua.hint.awaitPropagate: When enabled,--@asyncpropagates to the caller.CHGAdd server version information toinitializeresponse #2996CHGIf the---@fieldof the same name has a type offun, theduplicate-doc-fieldcheck will not be performed.FIXIncorrect infer for function array annotation on tables #2367
3.13.4
2024-12-13
CHGCan adjust the level of detail of Hover (VSCode)
3.13.3
2024-12-6
CHGUpdate Love2d versionCHGImprove type infer oftable.unpackandunpackFIXmissing-fieldsdiagnostic now warns about missing inherited fieldsFIXIncorrectparam-type-mismatchdiagnostic for optional fields
3.13.2
2024-11-21
CHGfulfill zh-cn translationsFIXAdd missingerrs ~= nilchecks to script/vm/type checkTableShape
3.13.1
2024-11-13
FIXIncorrect type check in some case
3.13.0
2024-11-13
NEWSetting:Lua.type.inferTableSize: A Small Table array can be inferedNEWAdd custom repository support for addonManager. New configuration setting:Lua.addonManager.repositoryBranchandLua.addonManager.repositoryPathNEWInfer function parameter types when the function is used as an callback argument and that argument has afun()annotation. Enable withLua.type.inferParamTypesetting. #2695---@param callback fun(a: integer) function register(callback) end local function callback(a) end --> a: integer register(callback)CHGBasic types allow contravariance---@class int32: integer ---@type integer local n ---@type int32 local a = nFIXImprove type narrow with literal alias type during completion and signature help
3.12.0
2024-10-30
NEWSupport importingenumthrough class name suffix matching in quick fixes, allowing the import ofenumfromtable.table.enum; return table.NEWSupport limited multiline annotations---@type { --- x: number, --- y: number, --- z: number, ---} local point --> local point: { x: number, y: number, z: number }FIXA regression related to type narrow and generic param introduced sincev3.10.1FIXParse storagePath to improve reliability of resolving ${addons} placeholderFIXReference should also look in tablefieldFIXDetermine that the index of{...}is an integer when iterating
3.11.1
2024-10-9
FIXFixed an issue preventing to set the locale to JapaneseFIXPreserve newlines between function comment and @seeFIXAccept storagePath option from client to resolve addon directory not found
3.11.0
2024-9-30
NEWAdded support for Japanese localeNEWInfer function parameter types when overriding the same-named class function in an instance of that class #2158NEWTypes with literal fields can be narrowed.NEWReference addons installed via the addon manager with${addons}#2866.NEWSupport using---@classonrawset(_G, ...)to annotate the created global variable #2862NEWSettings:Lua.language.fixIndentLua.language.completeAnnotation
FIXEliminate floating point error in test benchmark outputFIXRemove luamake install from make scriptsFIXIncorrecttabletype injected to the global variable created byrawset(_G, ...)#2863
3.10.6
2024-9-10
NEWCustom documentation exporterNEWSetting:Lua.docScriptPath: Path to a script that overridescli.doc.export, allowing user-specified documentation exporting.NEWInfer the parameter types of a same-named function in the subclass based on the parameter types in the superclass function.FIXFixVM.OnCompileFunctionParamfunction in pluginsFIXLua 5.1: fix incorrect warning when using setfenv with an int as first parameterFIXImprove type narrow by checking exact match on literal type paramsFIXCorrectly list enums for function overload arguments #2840FIXIncorrect function params' type infer when there is only@overload#2509 #2708 #2709FIXOnly call workspace/configuration when available #981, #2318, 2336 #2843
3.10.5
2024-8-19
NEWusingenum (partial), it suggests all fields with the sameenumtype rather than just the fields from the current table.NEWWhen usingenum["<key>" or <index>], undefined fields will raise an 'undefined' error.FIXRenaming files in the directory leads to the auto-correction in "require" adding extra characters.FIXPerformance issueFIXFix incorrect indent fixing forfor
3.10.4
2024-8-16
NEWSetting:Lua.type.checkTableShape: Add matching checks between the shape of tables and classes, during type checking. #2768NEWundefined-fieldsupportsenumCHGShow enumed table asenum Xinstead oftableFIXErrorattempt to index a nil valuewhenLua.hint.semicolon == 'All'#2788FIXIncorrect LuaCats parsing for"'"FIXIncorrect indent fixings
3.10.3
2024-8-8
FIXMemory leak with---@enum(partical)
3.10.2
2024-8-7
NEWAdd support for binary metamethod on right operand #2777FIXIncorrect indentation fixing in some case
3.10.1
2024-8-2
FIXRuntime errorFIXDisable indentation fixing for Non-VSCode
3.10.0
2024-8-1
NEWAdd postfix snippet forunpackNEWAdd support for lambda style functions,|paramList| expris syntactic sugar forfunction(paramList) return expr endNEWAdded lua regular expression support forLua.doc.<scope>Name#2753NEWYou can now click on "References" in CodeLen to display the reference list(VSCode)NEWImproved behavior for inserting new lines:- When inside an annotation, an annotation tag will be added at the beginning of the line (VSCode).
- When between
function () endor similar constructs, the format will be adjusted to a more reasonable one (VSCode) and leading/trailing spaces will be removed (generic). - Attempts to semantically fix improper indentation (generic).
CHGImprove performance of multithreaded--checkandundefined-fielddiagnosticCHGChange spacing of parameter inlay hints to match other LSPs, likerust-analyzerFIXdiagnostics.severitydefaulting to "Warning" when run using--check#2730FIXRespectcompletion.showParamsconfig for local function completionFIXAddons can now self-recommend as expected. Fixed by correcting thewholeMatchfunctionFIXNow correctly evaluates the visibility of fields in a class when they are defined directly in the object. use for completion and invisible dianostic. #2752FIXBad triggering of theinject-fielddiagnostic, when the fields are declared at the creation of the object #2746FIXInconsistent type narrow behavior of function call args #2758FIXImprove themissing-fieldslogic to be able to correctly handle classes defined several times #22770FIXTypos in annotation descriptionsFIXincorrectCompletionItemKindfor postfix snippets #2773
3.9.3
2024-6-11
FIXSometimes providing incorrect autocompletion when chaining calls
3.9.2
2024-6-6
NEWReference workspace symbols in comments using[some text](lua://symbolName)syntaxFIXDon't do diagnostics when the workspace is not readyFIXAutocompletion for enum values is not available in some cases
3.9.1
2024-5-14
- revert extension runtime
3.9.0
2024-5-11
NEWgoto implementationNEWnarrow the function prototype based on the parameter type---@overload fun(a: boolean): A ---@overload fun(a: number): B local function f(...) end local r1 = f(true) --> r1 is `A` local r2 = f(10) --> r2 is `B`
3.8.3
2024-4-23
FIXserver may crash when the workspace is using a non-English path.
3.8.2
2024-4-23
- This is a fake version only for the new version of VSCode, with a core of 3.8.0.
3.8.1
2024-4-23
- This is a fake version only for the old version of VSCode, with a core of
3.7.4. Starting from the next minor version, the version requirement for VSCode will be raised to prevent users still using the old version of VSCode from updating to the new version and experiencing compatibility issues.
3.8.0
2024-4-22
-
NEWsupports tuple type (@lizho)---@type [string, number, boolean] local t local x = t[1] --> x is `string` local y = t[2] --> y is `number` local z = t[3] --> z is `boolean` -
NEWgeneric pattern (@fesily)---@generic T ---@param t Cat.`T` ---@return T local function f(t) end local t = f('Smile') --> t is `Cat.Smile` -
NEWalias and enums supports attributepartial---@alias Animal Cat ---@alias(partial) Animal Dog ---@type Animal local animal --> animal is `Cat|Dog` here---@enum(key) ErrorCodes local codes1 = { OK = 0, ERROR = 1, FATAL = 2, } ---@enum(key, partial) ErrorCodes local codes2 = { WARN = 3, INFO = 4, } ---@type ErrorCodes local code code = 'ERROR' --> OK code = 'WARN' --> OK -
NEWplugin: addOnTransFormAstinterface (@fesily) -
NEWplugin: addOnNodeCompileFunctionParaminterface (@fesily) -
NEWplugin: addResolveRequireinterface (@Artem Dzhemesiuk) -
NEWplugin: support multi plugins (@fesily)- setting:
Lua.runtime.plugincan bestring|string[] - setting:
Lua.runtime.pluginArgscan bestring[]|table<string, string>
- setting:
-
NEWCLI:--docadd option--doc_out_path <PATH>(@Andreas Matthias) -
NEWCLI:--doc_update, update an existingdoc.jsonwithout using--docagain (@Andreas Matthias) -
NEWCLI:--trust_all_plugins, this is potentially unsafe for normal use and meant for usage in CI environments only (@Paul Emmerich) -
CHGCLI:--checkwill run plugins (@Daniel Farrell) -
FIXdiagnostic:discard-returnsnot works in some blocks (@clay-golem) -
FIXrename in library files
3.7.4
2024-1-5
FIXrename to unicode withLua.runtime.unicodeName = true
3.7.3
2023-11-14
FIXcan not infer arg type in some cases.
3.7.2
2023-11-9
FIX#2407
3.7.1
2023-11-7
3.7.0
2023-8-24
-
NEWsupport---@typeand--[[@as]]for return statement -
NEWcommandline parameter--force-accept-workspace: allowing the use of the root directory or home directory as the workspace -
NEWdiagnostic:inject-field -
NEW---@enumsupports attributekey---@enum (key) AnimalType local enum = { Cat = 1, Dog = 2, } ---@param animal userdata ---@param atp AnimalType ---@return boolean local function isAnimalType(animal, atp) return API.isAnimalType(animal, enum[atp]) end assert(isAnimalType(animal, 'Cat')) -
NEW---@classsupports attributeexact---@class (exact) Point ---@field x number ---@field y number local m = {} m.x = 1 -- OK m.y = 2 -- OK m.z = 3 -- Warning -
FIXwrong hover and signature for method with varargs and overloads -
FIX#2155 -
FIX#2224 -
FIX#2252 -
FIX#2267
3.6.25
2023-7-26
FIX#2214
3.6.24
2023-7-21
NEWdiagnostic:missing-fieldsFIXshake ofcodeLensFIX#2145
3.6.23
2023-7-7
CHGsignature: narrow by inputed literal
3.6.22
2023-6-14
3.6.21
2023-5-24
FIXdisable ffi plugin
3.6.20
2023-5-23
NEWsupport connecting by socket with--socket=PORTFIX#2113
3.6.19
2023-4-26
3.6.18
2023-3-23
3.6.17
2023-3-9
CHGexport documents: export global variablesFIX#1715FIX#1753FIX#1914FIX#1922FIX#1924FIX#1928FIX#1945FIX#1955FIX#1978
3.6.13
2023-3-2
FIXsetting:Lua.addonManager.enableshould betrueby defaultFIXfailed to publish to Windows
3.6.12
2023-3-2
NEWAddon Manager, try it with commandlua.addon_manager.open. Thanks to carsakiller!
3.6.11
2023-2-13
3.6.10
2023-2-7
3.6.9
2023-2-2
3.6.8
2023-1-31
NEWcommandlua.exportDocument. VSCode will display this command in the right-click menuCHGsettingLua.workspace.supportSchemehas been removed. All schemes are supported if the language id isluaFIX#1831FIX#1838FIX#1841FIX#1851FIX#1855FIX#1857
3.6.7
2023-1-20
3.6.6
2023-1-17
3.6.5
2023-1-16
NEWsupport casting global variablesNEWcode lens: this feature is disabled by default.NEWsettings:Lua.codeLens.enable: Enable code lens.
CHGimprove memory usage for large librariesCHGdefinition: supports finding definitions for@classand@alias, since they may be defined multi timesCHGrename: supports@fieldCHGimprove patch for.luarc.jsonCHG---@meta [name]: once declaredname, user can only require this file by declared name. meta file can not be required with name_CHGremove telemetryFIX#831FIX#1729FIX#1737FIX#1751FIX#1767FIX#1796FIX#1805FIX#1808FIX#1811FIX#1824
3.6.4
2022-11-29
NEWmodifyrequireafter renaming filesFIXcirculation reference in process analysis---@type number local x ---@type number local y x = y y = x --> Can not infer `y` beforeFIX#1698FIX#1704FIX#1717
3.6.3
2022-11-14
3.6.2
2022-11-10
3.6.1
2022-11-8
FIXwrong diagnostics forpcallandxpcallFIXduplicate fields in table hoverFIXdescription disapeared for overloaded functionFIX#1675
3.6.0
2022-11-8
NEWsupportsprivate/protected/public/package- mark in
doc.field---@class unit ---@field private uuid integer - mark with
---@private,---@protected,---@publicand---@package---@class unit local mt = {} ---@private function mt:init() end ---@protected function mt:update() end - mark by settings
Lua.doc.privateName,Lua.doc.protectedNameandLua.doc.packageName---@class unit ---@field _uuid integer --> treat as private when `Lua.doc.privateName` has `"_*"`
- mark in
NEWsettings:Lua.misc.executablePath: #1557 specify the executable path in VSCodeLua.diagnostics.workspaceEvent: #1626 set the time to trigger workspace diagnostics.Lua.doc.privateName: treat matched fields as privateLua.doc.protectedName: treat matched fields as protectedLua.doc.packageName: treat matched fields as package
NEWCLI--doc [path]to make docs. server will generatedoc.jsonanddoc.mdinLOGPATH.doc.mdis generated bydoc.jsonby example codescript/cli/doc2md.lua.CHG#1558 detect multi librariesCHG#1458semantic-tokens: global variable is setted tovariable.global// color global variables to red "editor.semanticTokenColorCustomizations": { "rules": { "variable.global": "#ff0000" } }CHG#1177 re-support for symlinks, users need to maintain the correctness of symlinks themselvesCHG#1561 infer definitions and types across chain expression---@class myClass local myClass = {} myClass.a.b.c.e.f.g = 1 ---@type myClass local class print(class.a.b.c.e.f.g) --> inferred as integerCHG#1582 the following diagnostics consideroverloadmissing-returnmissing-return-valueredundant-return-valuereturn-type-mismatch
CHGworkspace-symbol: supports chain fields based on global variables and types. tryio.openoriolib.openCHG#1641 if a function only has varargs and has---@overload, the varargs will be ignoredCHG#1575 search definitions by first argument ofsetmetatable---@class Object local obj = setmetatable({ initValue = 1, }, mt) print(obj.initValue) --> `obj.initValue` is integerCHG#1153 infer type by generic parameters or returns of function---@generic T ---@param f fun(x: T) ---@return T[] local function x(f) end ---@type fun(x: integer) local cb local arr = x(cb) --> `arr` is inferred as `integer[]`CHG#1201 infer parameter type by expected returned function of parent function---@return fun(x: integer) local function f() return function (x) --> `x` is inferred as `integer` end endCHG#1332 infer parameter type when function in table---@class A ---@field f fun(x: string) ---@type A local t = { f = function (x) end --> `x` is inferred as `string` }CHGfind reference: respectincludeDeclaration(although I don't know how to turn off this option in VSCode)CHG#1344 improve---@seeCHG#1484 settingruntime.specialsupports fields{ "runtime.special": { "sandbox.require": "require" } }CHG#1533 supports completion with table field of functionCHG#1457 infer parameter type by function type---@type fun(x: number) local function f(x) --> `x` is inferred as `number` endCHG#1663 check parameter types of generic extends---@generic T: string | boolean ---@param x T ---@return T local function f(x) return x end local x = f(1) --> Warning: Cannot assign `integer` to parameter `<T:boolean|string>`.CHG#1434 type check: check the fields in table:---@type table<string, string> local x ---@type table<string, number> local y x = y --> Warning: Cannot assign `<string, number>` to `<string, string>`CHG#1374 type check: supports array part in literal table---@type boolean[] local t = { 1, 2, 3 } --> Warning: Cannot assign `integer` to `boolean`CHG---@enumsupports runtime valuesFIX#1479FIX#1480FIX#1567FIX#1593FIX#1595FIX#1599FIX#1606FIX#1608FIX#1637FIX#1640FIX#1642FIX#1662FIX#1672
3.5.6
2022-9-16
3.5.5
2022-9-7
3.5.4
2022-9-6
NEWtype-formatting: fix wrong indentation of VSCodeCHGdocument-symbol: redesigned to better support forSticky Scrollfeature of VSCodeFIXdiagnostics.workspaceDelaycan not prevent first workspace diagnosticFIX#1476FIX#1490FIX#1493FIX#1499FIX#1526
3.5.3
2022-8-13
3.5.2
2022-8-1
3.5.1
2022-7-26
NEWsupports colorNEWsettingLua.runtime.pluginArgsCHGsettingtype.castNumberToIntegerdefault bytrueCHGimprove supports for multi-workspaceFIX#1354FIX#1355FIX#1363FIX#1365FIX#1367FIX#1368FIX#1370FIX#1375FIX#1391
3.5.0
2022-7-19
NEWLuaDoc:---@operator:---@class fspath ---@operator div(string|fspath): fspath ---@type fspath local root local fileName = root / 'script' / 'main.lua' -- `fileName` is `fspath` hereNEWLuaDoc:---@source:-- Also supports absolute path or relative path (based on current file path) ---@source file:///xxx.c:50:20 XXX = 1 -- when finding definitions of `XXX`, returns `file:///xxx.c:50:20` instead here.NEWLuaDoc:---@enum:---@enum animal Animal = { Cat = 1, Dog = 2, } ---@param x animal local function f(x) end f() -- suggests `Animal.Cat`, `Animal.Dog`, `1`, `2` as the first parameterNEWdiagnostics:unknown-operatorunreachable-code
NEWsettings:diagnostics.unusedLocalExclude
NEWVSCode: add support for EmmyLuaUnityCHGsupport multi-type:---@type number, _, boolean local a, b, c -- `a` is `number`, `b` is `unknown`, `c` is `boolean`CHGtreat_ENV = XXXaslocal _ENV = XXX_ENV = nil: disable all globals_ENV = {}: allow all globals_ENV = {} ---@type mathlib: only allow globals inmathlib
CHGhover: dose not show unknown---@XXXas descriptionCHGcontravariance is allowed at the class declaration---@class BaseClass local BaseClass ---@class MyClass: BaseClass local MyClass = BaseClass -- OK!CHGhover: supports path in link-- --> will convert to `--` local xCHGsignature: only show signatures matching the entered parametersFIX#880FIX#1284FIX#1292FIX#1294FIX#1306FIX#1311FIX#1317FIX#1320FIX#1330FIX#1345FIX#1346FIX#1348
3.4.2
2022-7-6
CHGdiagnostic:type-checkignoresnilingetfieldCHGdiagnostic:---@diagnostic disable: <ERR_NAME>can suppress syntax errorsCHGcompletion:completion.callSnippetno longer generate parameter typesCHGhover: show---@type {x: number, y: number}as detail instead oftableCHGdose not infer asnilbyt.field = nilFIX#1278FIX#1288
3.4.1
2022-7-5
NEWsettings:type.weakNilCheck
CHGallow type contravariance forsetmetatablewhen initializing a class---@class A local a = {} ---@class B: A local b = setmetatable({}, { __index = a }) -- OK!FIX#1256FIX#1257FIX#1267FIX#1269FIX#1273FIX#1275FIX#1279
3.4.0
2022-6-29
NEWdiagnostics:cast-local-typeassign-type-mismatchparam-type-mismatchunknown-cast-variablecast-type-mismatchmissing-return-valueredundant-return-valuemissing-returnreturn-type-mismatch
NEWsettings:diagnostics.groupSeveritydiagnostics.groupFileStatustype.castNumberToIntegertype.weakUnionCheckhint.semicolon
CHGinfernilas redundant return valuelocal function f() end local x = f() -- `x` is `nil` instead of `unknown`CHGinfer called function by params num---@overload fun(x: number, y: number):string ---@overload fun(x: number):number ---@return boolean local function f() end local n1 = f() -- `n1` is `boolean` local n2 = f(0) -- `n2` is `number` local n3 = f(0, 0) -- `n3` is `string`CHGsemicolons and parentheses can be used inDocTable---@type { (x: number); (y: boolean) }CHGreturn names and parentheses can be used inDocFunction---@type fun():(x: number, y: number, ...: number)CHGsupports---@return boolean ...CHGimprove experience for diagnostics and semantic-tokensFIXdiagnostics flash when opening a fileFIXsometimes workspace diagnostics are not triggeredFIX#1228FIX#1229FIX#1242FIX#1243FIX#1249
3.3.1
2022-6-17
3.3.0
2022-6-15
NEWLuaDocsupports`CODE`---@type `CONST.X` | `CONST.Y` local x if x == -- suggest `CONST.X` and `CONST.Y` hereCHGinfer type byerror---@type integer|nil local n if not n then error('n is nil') end print(n) -- `n` is `integer` hereCHGinfer type byt and t.x---@type table|nil local t local s = t and t.x or 1 -- `t` in `t.x` is `table`CHGinfer type bytype(x)local x if type(x) == 'string' then print(x) -- `x` is `string` here end local tp = type(x) if tp == 'boolean' then print(x) -- `x` is `boolean` here endCHGinfer type by>/</>=/<=FIXwith clients that support LSP 3.17 (VSCode), workspace diagnostics are triggered every time when opening a file.FIX#1204FIX#1208
3.2.5
2022-6-9
3.2.4
2022-5-25
NEWsettings:workspace.supportScheme:["file", "untitled", "git"]diagnostics.disableScheme:["git"]
NEWfolding: support folding---@aliasCHGifrootUriorworkspaceFolderis set toROOTorHOME, this extension will refuse to load these directories and show an error message.CHGshow warning message when scanning more than 100,000 files.CHGupgrade LSP to3.17FIXhover: can not uniontablewith other basic typesFIX#1125FIX#1131FIX#1134FIX#1141FIX#1144FIX#1150FIX#1155
3.2.3
2022-5-16
CHGparse.luarc.jsonas jsonc. In order to please the editor, it also supports.luarc.jsoncas the file name.CHGdose not load files in symbol linksFIXmemory leak with symbol linksFIXdiagnostic: send empty results to every file after startupFIX#1103FIX#1107
3.2.2
2022-4-26
FIXdiagnostic:unused-functioncannot handle recursion correctlyFIX#1092FIX#1093FIXruntime errors reported by telemetry, see #1091
3.2.1
2022-4-25
FIXbroken in VSCode
3.2.0
2022-4-25
NEWsupports infer of callback parameter---@type string[] local t table.sort(t, function (a, b) -- `a` and `b` is `string` here end)NEWusing---@overloadas class constructor---@class Class ---@overload fun():Class local mt local x = mt() --> x is `Class` hereNEWadd--[[@as type]]local x = true local y = x--[[@as integer]] -- y is `integer` hereNEWadd---@cast---@cast localname type---@cast localname +type---@cast localname -type---@cast localname +?---@cast localname -?
NEWgeneric: resolveT[]bytable<integer, type>or---@field [integer] typeNEWresolveclass[1]by---@field [integer] typeNEWdiagnostic:missing-parameterNEWdiagnostic:need-check-nilCHGdiagnostic: no longer markredundant-parameterasUnnecessaryFIXdiagnostic:unused-functiondoes not recognize recursionFIX#1051FIX#1072FIX#1077FIX#1088FIXruntime errors
3.1.0
2022-4-17
NEWsupport find definition in methodCHGhint: move to LSP. Its font is now controlled by the client.CHGhover: splitlocalintolocal/parameter/upvalue/self.CHGhover: added parentheses to some words, such asglobal/field/class.FIXdefinition oftable<k, v>FIX#994FIX#1057FIXruntime errors reported by telemetry, see #1058
3.0.2
2022-4-15
FIXtable<string, boolean>[string] -> booleanFIXgototype definitionFIX#1050
3.0.1
2022-4-11
3.0.0
2022-4-10
CHGbreak changesCHGdiagnostic:type-check: removed for nowno-implicit-any: renamed tono-unknown
CHGformatter: no longer need--previewCHGLuaDoc: supports---@type (string|integer)[]FIXsemantic: color offunctionFIX#1027FIX#1028
2.6.8
2022-4-9
CHGcompletion: call snippet shown asFunctioninstead ofSnippetwhenLua.completion.callSnippetisReplaceFIX#976FIX#995FIX#1004FIX#1008FIX#1009FIX#1011FIX#1014FIX#1016FIX#1017FIXruntime errors reported by telemetry
2.6.7
2022-3-9
NEWdiagnosis report, read moreCHGVSCode: 1.65 has built in newLuasyntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please open issues here.CHGtelemetry: the prompt will only appear in VSCode to avoid repeated prompts in other platforms due to the inability to automatically modify the settings.FIX#965FIX#975
2.6.6
2022-2-21
2.6.5
2022-2-17
2.6.4
2022-2-9
CHGcompletion: reduced sorting priority for postfix completionFIX#936FIX#937FIX#940FIX#941FIX#941FIX#943FIX#946
2.6.3
2022-1-25
2.6.2
2022-1-25
FIX#925
2.6.1
2022-1-24
CHGdefault values of settings:Lua.diagnostics.workspaceDelay:0sec ->3secLua.workspace.maxPreload:1000->5000Lua.workspace.preloadFileSize:100KB ->500KB
CHGimprove performanceFIXmodify luarc failedFIXlibrary files not recognized correctlyFIX#903FIX#906FIX#920
2.6.0
2022-1-13
NEWsupports multi-workspace in server side, for developers of language clients, please read here to learn more.NEWsetting:Lua.hint.arrayIndexLua.semantic.enableLua.semantic.variableLua.semantic.annotationLua.semantic.keyword
CHGcompletion: improve response speedCHGcompletion: can be triggered inLuaDocand stringsCHGdiagnostic: smootherCHGsettingsLua.color.moderemovedFIX#876FIX#879FIX#884FIX#885FIX#886FIX#902
2.5.6
2021-12-27
CHGdiagnostic: now syntax errors inLuaDocare shown asWarningFIX#863FIXreturn type ofmath.floorFIXruntime errors
2.5.5
2021-12-16
FIXdose not work in VSCode
2.5.4
2021-12-16
2.5.3
2021-12-6
2.5.2
2021-12-2
2.5.1
2021-11-29
FIXincorrect syntax error
2.5.0
2021-11-29
NEWsettings:Lua.runtime.pathStrict: not check subdirectories when usingruntime.pathLua.hint.await: displayawaitwhen calling a function marked as asyncLua.completion.postfix: the symbol that triggers postfix, default is@
NEWadd supports forlovrNEWfile encoding supportsutf16leandutf16beNEWfull IntelliSense supports for literal tables, see #720 and #727NEWLuaDocannotations:---@async: mark a function as async---@nodiscard: the return value of the marking function cannot be discarded
NEWdiagnostics:await-in-sync: check whether calls async function in sync function. disabled by default.not-yieldable: check whether the function supports async functions as parameters. disabled by default.discard-returns: check whether the return value is discarded.
NEWlocalept-br, thanks Jeferson FerreiraNEWsupports utf-8-offsetsNEWsupports quickfix for.luarc.jsonNEWcompletion postifx:@function,@method,@pcall,@xpcall,@insert,@remove,@concat,++,++?CHGLuaDoc:---@classcan be re-declared- supports unicode
- supports
---@param ... number, equivalent to---@vararg number - supports
fun(...: string) - supports
fun(x, y, ...), equivalent tofun(x: any, y: any, ...: any)
CHGsettings from--configpath,.luarc.json,clientno longer prevent subsequent settings, instead they are merged in orderCHGno longer asks to trust plugin in VSCode, because VSCode already provides the workspace trust featureCHGskip huge files (>= 10 MB)CHGafter usingLua.runtime.nonstandardSymbolto treat//as a comment,//is no longer parsed as an operator
2.4.11
2021-11-25
2.4.10
2021-11-23
2.4.9
2021-11-18
-
CHGfor performance reasons, some of the features that are not cost-effective in IntelliSense have been disabled by default, and you can re-enable them through the following settings:Lua.IntelliSense.traceLocalSetLua.IntelliSense.traceReturnLua.IntelliSense.traceBeSettedLua.IntelliSense.traceFieldInject
2.4.8
2021-11-15
2.4.7
2021-10-27
FIX#762
2.4.6
2021-10-26
NEWdiagnostic:redundant-returnFIX#744FIX#748FIX#749FIX#752FIX#753FIX#756FIX#758FIX#760
2.4.5
2021-10-18
FIXaccidentally load lua files from user workspace
2.4.4
2021-10-15
CHGimprove.luarc.jsonFIX#722
2.4.3
2021-10-13
2.4.2
2021-10-8
2.4.1
2021-10-2
2.4.0
2021-10-1
NEWloading settings from.luarc.jsonNEWsettings:Lua.diagnostics.libraryFilesLua.diagnostics.ignoredFilesLua.completion.showWordLua.completion.requireSeparator
NEWdiagnostics:different-requires
NEW---@CustomClass<string, number>NEWsupports$/cancelRequestNEWEventEmitter--- @class Emit --- @field on fun(eventName: string, cb: function) --- @field on fun(eventName: '"died"', cb: fun(i: integer)) --- @field on fun(eventName: '"won"', cb: fun(s: string)) local emit = {} emit:on(--[[support autocomplete fr "died" and "won"]]) emit:on("died", function (i) -- should be i: integer end) emit:on('won', function (s) -- should be s: string end)NEW---@module 'moduleName'---@module 'mylib' local lib -- the same as `local lib = require 'mylib'`NEWadd supports ofskynetCHGhover: improve showing multi definesCHGhover: improve showing multi comments at enumsCHGhover: shows methodCHGhint:Lua.hint.paramNamenow supportsDisable,LiteralandAllCHGonly search first file byrequireCHGno longer infer by usageCHGno longer ignore file names case in WindowsCHGwatching library changesCHGcompletion: improve misspelling resultsCHGcompletion:Lua.completion.displayContextdefault to0CHGcompletion:autoRequirehas better inserting positionCHGdiagnostics:redundant-parameterdefault severity toWarningredundant-valuedefault severity toWarning
CHGinfer: more strict of calculation resultsCHG#663FIXruntime errorsFIXhint: may show param-2 asselfFIXsemantic: may fail when scrollingFIX#647FIX#660FIX#673
2.3.7
2021-8-17
CHGimprove performanceFIX#244
2.3.6
2021-8-9
FIXcompletion: can not find global fieldsFIXglobals and class may lost
2.3.5
2021-8-9
CHGimprove memory usageCHGcompletion: call snip triggers signature (VSCode only)FIXcompletion: may not find results
2.3.4
2021-8-6
CHGimprove performanceFIX#625
2.3.3
2021-7-26
2.3.2
2021-7-21
NEWLuaDoc: supports['string']as field:---@class keyboard ---@field ['!'] number ---@field ['?'] number ---@field ['#'] numberNEWadd supports oflove2dFIXgitignore pattern\broken initializationFIXruntime errors
2.3.1
2021-7-19
NEWsettingLua.workspace.userThirdParty, add private user third-parth by this settingCHGpath in config supports~/xxxxFIXautoRequireinserted incorrect codeFIXautoRequiremay provide dumplicated optionsFIX#606FIX#607
2.3.0
2021-7-16
NEWVSCode: click the status bar icon to operate:- run workspace diagnostics
NEWLuaDoc: supports[1]as field:---@class position ---@field [1] number ---@field [2] number ---@field [3] numberNEWhover: view arraylocal array = {'a', 'b', 'c'}:local array: { [1]: string = "a", [2]: string = "b", [3]: string = "c", }NEWcompletion: supports enums infun()---@type fun(x: "'aaa'"|"'bbb'") local f f(--[[show `'aaa'` and `'bbb'` here]])FIXloading workspace may hangFIXdebug.getuservalueanddebug.setuservalueshould not exist inLua 5.1FIXinfer of---@type class[][]FIXinfer of---@type {}[]FIXcompletion: displaying@fenvinLua 5.1FIXcompletion: incorrect at end of lineFIXwhen a file is renamed, the file will still be loaded even if the new file name has been set to ignoreFIX#596FIX#597FIX#598FIX#601
2.2.3
2021-7-9
CHGimproveauto requireCHGwill not sleep anymoreFIXincorrect doc:debug.getlocalFIXcompletion: incorrect callbackFIX#592
2.2.2
2021-7-9
FIXincorrect syntax colorFIXincorrect type infer
2.2.1
2021-7-8
FIXchange setting may failed
2.2.0
2021-7-8
NEWdetect and apply third-party libraries, including:- OpenResty
- Cocos4.0
- Jass
NEWLuaDoc: supports literal table:---@generic T ---@param x T ---@return { x: number, y: T, z?: boolean} local function f(x) end local t = f('str') -- hovering "t" shows: local t: { x: number, y: string, z?: boolean, }CHGimprove changing config from server sideCHGimprove hover colorCHGimprove performanceCHGtelemetry: sends version of this extensionFIXsupports for file with LFFIXmay infer a custom class as a string
2.1.0
2021-7-2
NEWsupports local config file, using--configpath="config.json", learn more hereNEWgototype definitionNEWinfer type by callback param:---@param callback fun(value: string) local function work(callback) end work(function (value) -- value is string here end)NEWoptional field---@field name? typeCHG#549CHGdiagnostics: always ignore the ignored files even if they are openedFIXcompletion:type() ==may does not work
2.0.5
2021-7-1
NEWhoverandcompletionreports initialization progressCHGclass fieldconsider implicit definition---@class Class local mt = {} function mt:init() self.xxx = 1 end function mt:func() print(self.xxx) -- self.xxx is defined endCHGimprove performanceFIX#580
2.0.4
2021-6-25
2.0.3
2021-6-24
CHGimprove memory usageFIXsome dialog boxes block the initialization processFIXdiagnosticsundefined-field: blocks main threadFIX#565
2.0.2
2021-6-23
NEWsupports literal table inpairslocal t = { a = 1, b = 2, c = 3 } for k, v in pairs(t) do -- `k` is string and `v` is integer here endCHGviewlocal f ---@type fun(x:number):boolean---before function f(x: number) -> boolean ---after local f: fun(x: number): booleanFIX#558FIX#567FIX#568FIX#570FIX#571
2.0.1
2021-6-21
FIX#566
2.0.0
2021-6-21
NEWimplementCHGdiagnosticsundefined-field,deprecated: default byOpenedinstead ofNoneCHGsettingLua.runtime.plugin: default by""instead of".vscode/lua/plugin.lua"(for security)CHGsettingLua.intelliSense.searchDepth: removedCHGsettingLua.misc.parameters:string arrayinstead ofstringCHGsettingLua.develop.enable,Lua.develop.debuggerPort,Lua.develop.debuggerWait: removed, useLua.misc.parametersinsteadFIX#441FIX#493FIX#531FIX#542FIX#543FIX#553FIX#562FIX#563
1.21.3
2021-6-17
NEWsupportsuntrusted workspacesFIXperformance issues, thanks to folke
1.21.2
2021-5-18
1.21.1
2021-5-8
FIX#529
1.21.0
2021-5-7
NEWsetting:completion.showParamsNEWLuaDoc: supports multiline commentsNEWLuaDoc: tail comments support lua string
1.20.5
2021-4-30
NEWsetting:completion.autoRequireNEWsetting:hover.enumsLimitCHGfolding: supports-- #regionFIXcompletion: details may be suspendedFIX#522FIX#523
1.20.4
2021-4-13
1.20.3
2021-4-6
1.20.2
2021-4-2
CHGLuaDoc: supports---@param self TYPECHGcompletion: does not show suggests after\n,{and,, unless your settingeditor.acceptSuggestionOnEnterisoffFIX#482
1.20.1
2021-3-27
FIXtelemetry window blocks initializingFIX#468
1.20.0
2021-3-27
CHGtelemetry: change to opt-in, see #462 and Privacy-PolicyFIX#467
1.19.1
2021-3-22
1.19.0
2021-3-18
NEWVSCode: new settingLua.misc.parametersNEWnew settingLua.runtime.builtin, used to disable some built-in librariesNEWquick fix: disable diagnostic in line/fileNEWsetting:Lua.runtime.pathsupports absolute pathNEWcompletion: field in table
---@class A
---@field x number
---@field y number
---@field z number
---@type A
local t = {
-- provide `x`, `y` and `z` here
}
NEWLuaDoc: supports multi-line comment before resume
---this is
---a multi line
---comment
---@alias XXXX
---comment 1
---comment 1
---| '1'
---comment 2
---comment 2
---| '2'
---@param x XXXX
local function f(x)
end
f( -- view comments of `1` and `2` in completion
CHGintelli-scense: search from generic param to returnCHGintelli-scense: search across varargCHGtext-document-synchronization: refactoredCHGdiagnostic: improvenewline-callCHGcompletion: improvethen .. endCHGimprove initialization speedCHGimprove performanceFIXmissed syntax errorfunction m['x']() endFIX#452
1.18.1
2021-3-10
CHGsemantic-tokens: improve colors ofconstandcloseCHGtype-formating: improve execution conditionsFIX#444
1.18.0
2021-3-9
NEWLuaDoc: supports---@diagnostic disableNEWcode-action: convert JSON to LuaNEWcompletion: providethen .. endsnippetNEWtype-formating:-- press `enter` at $ local function f() $ end -- formating result: local function f() $ end -- as well as do $ end -- formating result do $ endCHGWindows: dose not provideucrtany moreCHGLua.workspace.library: usepath[]instead of<path, true>FIXmissed syntax errorlocal a <const>= 1FIXworkspace: preload blocked when hittingLua.workspace.maxPreloadFIX#443FIX#445
1.17.4
2021-3-4
1.17.3
2021-3-3
CHGintelli-scense: treatV[]astable<integer, V>inpairsFIXcompletion:detaildisappears during continuous inputFIX#435FIX#436FIX#437
1.17.2
2021-3-2
FIXrunning in Windows
1.17.1
2021-3-1
CHGintelli-scense: improve infer acrosstable<K, V>andV[].CHGintelli-scense: improve infer acrosspairsandipairsFIXhover: shows nothing when hovering unknown functionFIX#398FIX#421FIX#422
1.17.0
2021-2-24
NEWdiagnostic:duplicate-set-fieldNEWdiagnostic:no-implicit-any, disabled by defaultCHGcompletion: improve field and tableCHGimprove infer crossipairsCHGcache globals when loadingCHGcompletion: remove trigger character\nfor now, see #401FIXdiagnositc: may open file with wrong uri caseFIX#406
1.16.1
2021-2-22
FIXsignature: parameters may be misplacedFIXcompletion: interface in nested tableFIXcompletion: interface not show after,FIX#400FIX#402FIX#403FIX#404FIXruntime errors
1.16.0
2021-2-20
NEWfile encoding supportsansiNEWcompletion: supports interface, see #384NEWLuaDoc: supports multiple class inheritance:---@class Food: Burger, Pizza, Pie, PastaCHGrenametable*totablelibCHGLuaDoc: revert compatible with--@, see #392CHGimprove performanceFIXmissed syntax errorf() = 1FIXmissed globalbitinLuaJITFIXcompletion: may insert error text when continuous inputingFIXcompletion: may insert error text after resolveFIX#349FIX#396
1.15.1
2021-2-18
CHGdiagnostic:unused-localexcludesdoc.paramCHGdefinition: excludes values, see #391FIXnot works on Linux and macOS
1.15.0
2021-2-9
NEWLUNAR YEAR, BE HAPPY!CHGdiagnostic: when there are too many errors, the main errors will be displayed firstCHGmain thread no longer loop sleeps, see #329 #386CHGimprove performance
1.14.3
2021-2-8
1.14.2
2021-2-4
1.14.1
2021-2-2
FIX#372
1.14.0
2021-2-2
NEWVSCodehintNEWflush cache after 5 minNEWVSCodehelp semantic color with market themeCHGcreate/delete/rename files no longer reload workspaceCHGLuaDoc: compatible with--@FIXVSCodesettingsFIX#368FIX#371
1.13.0
2021-1-28
NEWVSCodestatus barNEWVSCodeoptions in some windowCHGperformance optimizationFIXendless loop
1.12.2
2021-1-27
CHGperformance optimizationFIXmodifying the code before loading finish makes confusionFIXsignature: not works
1.12.1
2021-1-27
FIXendless loop
1.12.0
2021-1-26
1.11.2
2021-1-7
1.11.1
2021-1-5
CHGperformance optimization
1.11.0
2021-1-5
NEWLua.runtime.pluginNEWintelli-scense: improvedm.f = function (self) endfromselftomCHGperformance optimizationCHGcompletion: improve performance of workspace wordsFIXhover: tail comments may be cuttedFIXruntime errors
1.10.0
2021-1-4
NEWworkspace: supports.dll(.so) inrequireNEWfolding:---@class,--#regionand docs of functionNEWdiagnostic:count-down-loopCHGsupports~in command lineCHGcompletion: improve workspace wordsCHGcompletion: show words in stringCHGcompletion: splitfor .. intofor .. ipairsandfor ..pairsCHGdiagnostic:unused-functionchecks recursiveFIX#339
1.9.0
2020-12-31
NEWYEAR! Peace and love!NEWspecify path oflogandmetaby--logpath=xxxand--metapath=XXXin command lineNEWcompletion: worksapce wordNEWcompletion: show words in commentNEWcompletion: generate function documentationCHGgot arg after script name:lua-language-server.exe main.lua --logpath=D:\log --metapath=D:\meta --develop=falseFIXruntime errors
1.8.2
2020-12-29
CHGperformance optimization
1.8.1
2020-12-24
FIXtelemetry: connect failed caused not working
1.8.0
2020-12-23
NEWruntime: support nonstandard symbolNEWdiagnostic:close-non-objectFIX#318
1.7.4
2020-12-20
FIXworkspace: preload may failed
1.7.3
2020-12-20
FIXluadoc: typo ofpackage.configFIX#310
1.7.2
2020-12-17
CHGcompletion: use custom tabsizeFIX#307FIXa lot of runtime errors
1.7.1
2020-12-16
NEWsetting:diagnostics.neededFileStatusFIXscan workspace may failsFIXquickfix:newline-callfailedFIXa lot of other runtime errors
1.7.0
2020-12-16
NEWdiagnostic:undefined-fieldNEWtelemetry:CHGdiagnostic:unused-functionignores function with<close>CHGsemantic: not cover local callCHGlanguage client: update to 7.0.0FIXsemantic: tokens may not be updated correctlyFIXcompletion: require path brokenFIXhover: document uriFIX#291FIX#294
1.6.0
2020-12-14
NEWcompletion: auto require local modulesNEWcompletion: support delegateNEWhover: show function by keywordfunctionNEWcode action: swap paramsCHGstandalone: unbind the relative path between binaries and scriptsCHGhover:LuaDocalso catchs--(no need---)CHGrename: support docCHGcompletion: keyword considers expressionFIX#297
1.5.0
2020-12-5
NEWsettingruntime.unicodeNameNEWfully supports---@generic TFIX#274FIX#276FIX#279FIX#280
1.4.0
2020-12-3
NEWsettinghover.previewFields: limit how many fields are shown in table hoverNEWfully supports---@type Object[]NEWsupports---@seeNEWdiagnosticunbalanced-assignmentsCHGresolves infer ofstring|tableCHGunused-localignores local with---@classCHGlocale file format changes tolua
1.3.0
2020-12-1
NEWprovides change logs, I think it's good idea for people knowing what's new(bugs)NEWmeta files of LuaJITNEWsupport completion oftype(o) == ?CHGnow I think it's a bad idea as it took me nearly an hour to complete the logs started from version1.0.0FIXclosing ignored or library file dose not clean diagnosticsFIXsearching oft.f1whent.f1 = t.f2FIXmissing signature help of global function
1.2.1
2020-11-27
FIXsyntaxes tokens: #272
1.2.0
2020-11-27
NEWhover shows comments from---@paramand---@return: #135NEWsupportLuaDocas tail commentFIX---@classinheritanceFIXmissed syntaxes token:punctuation.definition.parameters.finish.lua
1.1.4
2020-11-25
FIXwiered completion suggests for require paths inLinuxandmacOS: #269
1.1.3
2020-11-25
FIXextension not works inUbuntu: #268
1.1.2
2020-11-24
NEWauto completion finds globals fromLua.diagnostics.globalsNEWsupport tailLuaDocCHGno moreLua.intelliScense.fastGlobal, now globals always fast and accurateCHGLuaDocsupports--- @CHGfind referenceuses extraLua.intelliSense.searchDepthCHGdiagnostics are limited by100in each fileFIXlibrary files are under limit ofLua.workspace.maxPreload: #266
1.1.1
2020-11-23
NEWauto completion special marks deprecated itemsFIXdiagnostics may push wrong uri inLinuxandmacOSFIXdiagnostics not cleaned up when closing ignored lua fileFIXreload workspace remains old cachesFIXincorrect hover of local attribute
1.1.0
2020-11-20
NEWno longerBETANEWusemeta.luainstead ofmeta.lni, now you can find the definition of builtin functionCHGLua files outside of workspace no longer launch a new server
1.0.6
2020-11-20
NEWdiagnosticcode-after-breakCHGoptimize performanceCHGupdated language clientCHGunused-functionignores global functions (may used out of Lua)CHGchecks if client supportsLua.completion.enable: #259FIXsupport for single Lua fileFIX#257
1.0.5
2020-11-14
NEWLuaDocsupports moreEmmyLua
1.0.4
2020-11-12
FIXextension not works
1.0.3
2020-11-12
NEWserver kills itself when disconnectingNEWLuaDocsupports moreEmmyLuaFIXLua.diagnostics.enablenot works: #251
1.0.2
2020-11-11
NEWsupports---|afterdoc.typeCHGlowcase-globalignores globals with---@classFIXendless loopFIX#244
1.0.1
2020-11-10
FIXautocompletion not works.
1.0.0
2020-11-9
NEWimplementation, NEW start!