question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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):

Bugs:

  • 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 not 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 a returns a string, and b returns a(), then if c = b(), c won’t be automatically recognized as a string.
  • Typo: it’s “Tail call” not “Trail call”.

Modifications:

  • private support in @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: Vehicle[] would 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.

New:

  • Semantic highlighting support. See this video by JetBrains
  • metamethods name autocompletion (__index, __tostring, etc. The standard ones)
  • Propose to refactor things like string.find(str, pattern) into str:find(pattern)
  • 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 😄

Edit :

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)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tangzxcommented, Apr 24, 2018

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

0reactions
adriwebcommented, Jul 10, 2017

oh okay thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write A Good Bug Report? Tips and Tricks
Good Bug report should be clear and concise without any missing key points. Any lack of clarity leads to misunderstanding and slows down...
Read more >
Bugs and Suggestions
An option to notify all group members or admins using a special mention (e.g. @all and @admins). Use cases Important news and major...
Read more >
How to Help Prevent Bugs – Insect Prevention Tips - Raid
HOW TO HELP PREVENT BUGS. Bugs invade homes looking for food, water, or shelter. By eliminating the things that attract insects, you can...
Read more >
Bugs and Suggestions - CodeProject
Bugs and Suggestions - Free source code and tutorials for Software ... General discussions, site bug reports and suggestions about the site.
Read more >
Tips for Effectively Reporting Bugs and Issues - Sifter
Some easily shareable guidelines for writing good bug reports.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found