phobos2077 wrote: ↑Mon Feb 20, 2017 5:21 am
5. ZeroBrane Studio. The best solution so far, because auto complete and debugging works nice. Still it doesn't understand my code (ignores LuaDocs for functions, variables, etc.) and generally it looks like an IDE from the past. I can't ctrl+click on symbol to quickly move to it's definition, I can't see a list of usages for a symbol, poor code editing in general (no wonder, because professional editors have thousands of hours put into them).
@phobos2077, thank you for the feedback. Let me go over it:
> Still it doesn't understand my code (ignores LuaDocs for functions, variables, etc.)
It does have limited support for LuaDocs for functions, but it's mostly used for providing hints about parameter types for auto-complete. For example, you can specify:
Code: Select all
-- @tparam string item
function myFunc(item)
item:
and after typing `item:` you should get auto-complete for "string" type.
The auto-complete doesn't currently take into consideration user classes, although there are couple of tickets for this work.
> generally it looks like an IDE from the past.
I'm curious, what UI elements or functionality make it look "old"?
> I can't ctrl+click on symbol to quickly move to it's definition
You can use Ctrl+Alt+click. Ctrl+click is not available as Ctrl+DblClick is used for selection all instances of the same symbol (scope-aware). The same functionality is also available from the context menu in the editor (Right click and `Go To Definition`). Note that this works for local functions/variables (not global ones as those don't have "definitions").
> I can't see a list of usages for a symbol
Do you have examples of how it's done in other cases? For local symbols you can select them with Ctrl+DblClick and navigate using F3/Shift-F3, but for non-local symbols it requires static analysis with type inference, which is not currently used for this functionality (it's only used for validating the code in the current file).
> poor code editing in general (no wonder, because professional editors have thousands of hours put into them)
Any specific details? Some of the features that seem to be missing may already be available as plugins (for example, CloneView, DocumentMap, and many others) and for others I will at least know what would be worthwhile to add.
@Positive07> Yes, someone should create a good static-analyzer for Lua and provide some cool tool with it, go to definition, basic error checking, suggestions based on table keys (metatable aware), and whatnot.
I think the one that comes with ZBS (based on lua-inspect and metalua) is fairly good. It supports two modes: one is faster and less verbose and the other one is more comprehensive, slower and more verbose (as it also checks field values and does deeper type inference:
https://studio.zerobrane.com/doc-genera ... c-analyzer). There is also
https://github.com/mpeterv/luacheck.
Paul.