Re: What code editor do you use ?
Posted: Mon Feb 20, 2017 7:16 pm
Sublime Text 3!
Is this some kind of extended syntax? I don't see such syntax in LuaDoc manual.paulclinger wrote: ↑Mon Feb 20, 2017 7:07 pm They are both supported; it was just an example. You can do either of the following:
Code: Select all
-- @tparam[...] <type> <paramname> -- @param[type=<type>] <paramname>
Yeah but I'm INSIDE another function (not at the same level as function declaration), and so other function is available at the moment this function is being executed.paulclinger wrote: ↑Mon Feb 20, 2017 7:07 pm > Found some strange issue. When I type name of a function that is defined below the current function, it doesn't show up in auto-complete list. It does, however, if such function was already used in current block or if it was defined above...
The IDE takes the scope into account, so if the function is defined below the spot you are typing in, it won't be offered in auto-complete.
OK the tooltip was suppressed because I used the referencepanel plugin... Now the problem is that it only shows tops for built-in Lua and LOVE functions (and it mixes up different functions - if I hover over some user-defined function called "update" is shows all functions with the same name from LOVE API, but not the user function..). For example I have a function like this:paulclinger wrote: ↑Mon Feb 20, 2017 7:07 pm > 2. There is no tooltips for functions and any other symbols, or maybe I don't understand how to configure them? I installed a plugin that displays some Lua reference tips (as well as LOVE API tips) inside the docked window in the bottom. But in almost every other IDE such tips are usually displayed right next to the symbol or mouse cursor when you hover over it or press some key combination.
Both typing and mousing-over should work for all functions/methods the IDE "knows" about. For example, if you mouse over `print(123)`, you should see a tooltip with description for the "print" function. Similarly, when you type `print(` you should see the same tooltip. Try typing `love.draw(` and you should see its tooltip (assuming LOVE interpreter is set as the current one).
Code: Select all
--- Create an object
-- @param x
-- @param y
-- @return Object
function createObject(x, y, width, height)
local obj = Object:new(x, y, width, height)
world:add(obj, obj.x, obj.y, obj.width, obj.height)
objects[obj] = true
return obj
end
It's syntax from LDoc: https://stevedonovan.github.io/ldoc/man ... _Modifiersphobos2077 wrote:Is this some kind of extended syntax? I don't see such syntax in LuaDoc manual.
I got something like this working (without the LuaDoc part) in Atom.phobos2077 wrote: ↑Mon Feb 20, 2017 5:21 am 2. An actual code completion, not only for basic Lua functions and LOVE API but also for all my own functions and classes/tables I create. I want it to read LuaDoc and trace types for at least some of the variables that I use. So I can use code completion when working with some library, for example...
That looks awesome. How to setup that with love2d?evölbug wrote: ↑Mon Feb 20, 2017 7:36 am I have lately moved to a terminal oriented workflow, because I found this great editor called Micro, which is like SublimeText but for terminals.
It doesn't have autocomplete or multiple cursors yet, and it lacks high level Lua debugging capabilities (though it does have a linter).
BUT, it's extensible with Lua-based plugins and is a fast and tiny single-executable with no dependencies. It also allows to add syntax highlighting files and custom themes!
micros.jpg