Some suggestions and bugs...See original GitHub issue
Hello, Great job on this plugin, it looks very promising and already has some features that are superior to Sylvanaar’s Lua plugin that I was using until now… 😃
Here is some feedback (I’ll probably edit this message as I go):
local a = function(...)isn’t recognized as a function, contrary to
local function a(...). (screenshot)
- Blacklisting parameter hints (right click on them) doesn’t work (no function name detected ,as far as I can tell)
- When a variable (let’s say
a) is detected as being a string, for instance, autocompleting
a:gives nothing, but
a.lists all applicable string methods (with a string argument as first parameter). This should be the reverse: propose autocompletions on
a., and remove the first ‘s’ argument as it is passed implicitely with the colon call.
- Type info doesn’t fully propagate, apparently. For instance, if function
areturns a string, and
a(), then if
c = b(),
cwon’t be automatically recognized as a string.
- Typo: it’s “Tail call” not “Trail call”.
@field. Which would autocomplete inside the class, but not anywhere else
- support for multiple inheritance in
@class. Separated by commas after the
- Improve the stdlib documentation by writing the parameters etc. in the emmylua doc format (with @return, type hinting, etc.)
- Multiple return values annotation support for
@return. Separated by commas?
- Table of type support. For instance:
Vehiclewould be for a table of Vehicle instances. Useful for
pairs()where the variables would get auto-typed as Vehicle.
- Alt-Enter support on standalone function names, not only on table methods or function arguments. Right now we have to type
--- @return ...manually.
- Support backticks (
`) in comments/documentation to make it clear it’s a piece of code or code reference.
- Semantic highlighting support. See this video by JetBrains
- metamethods name autocompletion (
__tostring, etc. The standard ones)
- Propose to refactor things like
- Custom class constructor hint support (maybe
@constructor?). The class system I’m using is like:
function MyClass:new(arg1, arg2...)(not
init) called implicitely by the MyClass table
__call, so it’d be helpful if
local test = MyClass("hello", 42)would be recognized as calling the constructor, thus proposing parameters autocompletion etc.
- LuaCheck static analysis support (parsing its output to add inline annotations, for instance)
- More refactoring options like “Introduce variable” (like Sylvanaar’s in this video), methods, etc.
- More code style options (about indenting, especially)
- English documentation too 😄
- Custom postfix completions isn’t possible until Intellij supports it, see https://youtrack.jetbrains.com/issue/IDEA-122443.
Also, regarding the plugin itself, you should add support for automatically report crashes to you (bug tracker in JetBrains I think?). Sylvanaar’s plugin (and others) are able to do that, so they gather user-reported bugs automatically (they just have to click a button to send a report when something goes wrong, and you get the backtrace)
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
oh, that’s my mistake. usage should be like this
---@param a number ---@return number|string, number|string|table function foo2(a) return a-1, a+1 end
but it doesn’t work, seems like a bug, let me fix
oh okay thanks 😃