Skip to content

Releases: Benjamin-Dobell/IntelliJ-Luanalysis

v1.4.0

16 Jan 19:54
Compare
Choose a tag to compare

Install from within your IDE's preferences or from the Jetbrains Marketplace.

v1.3.0

26 Jul 22:14
Compare
Choose a tag to compare

Install from within your IDE's preferences or from the Jetbrains Marketplace.

v1.2.3

04 Apr 17:00
Compare
Choose a tag to compare
  • @class/@shape can now inherit from aliased types.
  • Made doc tables behave more like shapes.
    As a result also improved doc table tuple support. Main outstanding differences:
    • Doc tables cannot inherit from shapes.
    • Doc tables cannot be callable types.
  • Added support for doc strings trailing @alias definitions, displayed in IDE mouse-over popup.
  • Added support for multiple @alias appearing in the same doc comment i.e. blank lines are no longer required between @alias.
  • Improved indexing performance.
  • Improved inference performance (IDE responsiveness), particularly in the presense of deeply nested scopes.
  • Improved illegal inheritance inspection.
  • Improved handling of table fields whose index type is unable to be inferred during indexing.
  • Corrected/refined os.date() stdlib definition.
  • Worked around JBR/Kotlin initializer deadlock..
  • Fixed generic inference when param is returned in multiple results.
  • Fixed incorrect "Illegal override" of fun with multiple results.
  • Fixed @vararg not accepting complex types (fun etc.)
  • Fixed occasional incorrect "Generic parameters cannot be shadowed".
  • Fixed variance detection of fields being assigned to a generic shape where the index of the source field is covariant of the
    index of the target field, and the target field's type contains a generic parameter.
  • Fixed auto-completion of aliases and unions.
  • Fixed incorrect type-checking of arguments passed to fun (without a parameter list).
  • Fixed inference of closures containing nested closures (containing return statements).
  • Fixed lexing of aliases with constrained generics.

1.2.2

14 Jan 17:56
Compare
Choose a tag to compare
  • New "Illegal Overrides" inspection. Reports illegal member overrides when declaring a field/method on an inherited type.
    If you're overriding a method with an incompatible type (e.g. subclass init function with different parameters) then you should annotate the parent init (and child) as @private.
  • Improved support for progressively adding type annotations to an existing Lua codebase. Essentially, local variables (without a declaration site assignment) and function parameters are now assumed to be of type any.
  • Mouse-over documentation now supports indexed fields e.g. docs are now displayed when hovering over the [1] in arr[1].
  • Inspections now traverse expressions (function calls, binary operators etc.) so you'll see more specific errors within table literals in more circumstances.
  • Many stdlib improvements/fixes (setmetatable, load* functions, getfenv, tostring, pcall, xpcall, assert & collectgarbage).
  • Migrated stdlib to the .def.lua extension. If you're writing API types (i.e. files that are never executed) it's suggested you adopt this file extension too.
  • Formalised type widening behaviour for overridden fields.
  • Best effort type inference for the return type of invalid function calls i.e. more chance of just seeing errors at the call site, rather than all through-out a function.
  • Special case handling for resolution of the self type when writing classes as closures i.e. expressions that look like setmetatable(someTable, {__call=function() end}). In such cases self type will be resolved based on the return type of __call.
  • Various type inference and variance detection performance improvements.
  • Improved handling of return types that are a union of multiple results. Rather than being flattened into a multiple result list where each component is a union during type checking, the initial structure is preserved.
  • Ensured method override auto-completion works in more circumstances.
  • Ensured primitives are never covariant of shapes.
  • Made an attempt to ensure the plugin is considered "dynamic" by IDEA.
  • Fixed clashes between anonymous types declared at the same offer in files with the same name (in different directories or virtual file systems).
  • Fixed several complex type rendering issues (missing brackets etc.) in the UI.
  • Fixed a boolean operator type inference bug in the presence of variadic return types.
  • Fixed some incorrect inspections when "Unknown type (any) is indexable" is enabled".
  • Fixed type inference/inspections involving assignment of nil to a member of table<K, nil | V>
  • Fixed "Compute constant value" intention. However, many of the cases supported seem excessive and quite impractical. As such, this intention may be simplified in a future release.
  • Fixed type inference & inspections for shapes that recursively reference themselves in their fields.
  • Fixed auto-complete and type resolution for fields that are written to self typed variables.
  • Fixed several bugs where generic parameters declared in multiple scopes are involved in type inference.
  • Fixed support for generic parameters referring to other generic parameters in their type constraints.
  • Fixed occasional misreported generic parameter shadowed errors.

1.2.1

27 Dec 17:27
Compare
Choose a tag to compare
  • Improved return inspection handling for unions of multiple results
  • Improved stdlib string module definitions

1.2.0

24 Dec 08:11
Compare
Choose a tag to compare
  • Requires IntelliJ IDEA 203 (2020.3)
  • Breaking: Removed unsafe assumed constructor functionality (#12)
  • Lua 5.4 support: <const> and <close> local variables and corresponding immutability inspections.
  • Removed 'Recognize global name as type' plugin option as its use encourages unsafe development practices.
  • Added new setting "Unknown type (any) is callable" which is enabled by default. For stricter type safety it's suggested you disable this option.
  • Added an "Illegal inheritance" inspection which will report inheritance cycles and inheritance from primitives.
  • Substantially improved (more refined) problem annotations on deeply nested table literals (#11 and more.)
  • Ensured inspections are re-run in more situations when variable types or type definitions are modified.
  • Improved lookup performance for locally scoped types, currently just generic types.
  • Performance improvements when dealing with types defined in the non-working file.
  • Jump to definition behavior for fields that are members of a table, table<K, V> or V[].
  • Added proper descriptions for every Luanalysis inspection.
  • Improved mouse-over pop-up docs for table literals that will be interpreted as a shape.
  • Only a subset of inspections are now run against files with the extension .def.lua e.g. return statement inspections are not run against functions
  • Improved inspections for missing arguments and colon/period function calls e.g. "Missing self argument. Did you mean to call the method with a colon?"
  • Corrected stdlib definitions for string.find()
  • Corrected stdlib definitions for next, ipairs and pairs.
  • Improved type safety of stdlib io module methods.
  • Improved stdlib math.random() definition. Contributed by Omniraptor
  • Improved stdlib string.gsub() definition. Contributed by Omniraptor
  • Fixed several related bugs that could cause Luanalysis to get into a state where it was unable to recognise both user and in-built types.
  • Fixed issue where shape inspections were appearing on table literals subject to a type cast (#14)
  • Static analysis now correctly handles use of parentheses to restrict multiple return values to just the first value.
  • Fixed handling of iterators.
  • Improved formatting/consistency of complex types displayed in the UI.
  • function type is now treated as returning any...
  • Fixed use of @overload in @class definitions that do not proceed a variable declaration/assignment.
  • Smarter union behavior that eliminates duplicate/covariant types from the union. This tends to result in much simple error message.
  • Fixed handling of some situations where table literals ought to be interpreted as arrays, but were not.

1.1.0

31 Jul 19:35
Compare
Choose a tag to compare
  • Ctrl/Cmd + Click ("Go To") on a string literal argument of a require("file") now takes you to the return value of the referenced file, rather than simply opening the file.
  • Fixed type resolution of require("file") expressions, where the referenced file has no return statements.
  • Added/fixed support for negative number literal types.
  • Type inference will now handle unary minus (negate) expressions, where the operand is a number literal. String literals representing values that Lua will silently coerce to a number are also handled.

1.0.3

31 Jul 13:23
Compare
Choose a tag to compare

Ensured "Return type 'void' specified but no return values found" annotation is no longer raised for functions annotated as ---@return void.

1.0.2

29 Jul 19:23
Compare
Choose a tag to compare

Same as 1.0.1, but not tied to IntelliJ 201 (2020.1).

1.0.1

14 Jul 19:52
Compare
Choose a tag to compare
  • Replaced duplicate class inspection with duplicate type inspection. Class/alias name collisions are now reported.
  • Despite the Lua manual indicating otherwise, bit32 is present in Lua 5.3, added it.
  • Ensured arrays are not covariant of shapes representing tuples.