Page 12 of 20

Re: What code editor do you use ?

Posted: Mon Feb 20, 2017 7:16 pm
by Annabelle
Sublime Text 3!

Re: What code editor do you use ?

Posted: Tue Feb 21, 2017 5:40 pm
by phobos2077
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>
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 > 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.
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 > 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).
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:

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
And an invocation for this function below. It doesn't get recognized, no tooltips, nothing. Even "Go to Definition" doesn't work. Yet the code works fine.

Re: What code editor do you use ?

Posted: Tue Feb 21, 2017 6:27 pm
by airstruck
phobos2077 wrote:Is this some kind of extended syntax? I don't see such syntax in LuaDoc manual.
It's syntax from LDoc: https://stevedonovan.github.io/ldoc/man ... _Modifiers

Re: What code editor do you use ?

Posted: Tue Feb 21, 2017 6:39 pm
by paulclinger
>> -- @tparam[...] <type> <paramname>
>> -- @param[type=<type>] <paramname>
> Is this some kind of extended syntax? I don't see such syntax in LuaDoc manual.

@phobos2077, It's covered in the LDoc manual (in the Tag modifiers section): https://stevedonovan.github.io/ldoc/man ... _Modifiers

>> 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.
> 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.

True, but there is no guarantee that the function is going to be available and to support that requires a different level of analysis; right now the logic just looks if that symbol is available at the point in the code by scanning the tree generated by the parser. It's probably a small price to pay for it being correct most of the time ;).

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

Right, it's not available for user functions.

> function createObject(x, y, width, height)
> And an invocation for this function below. It doesn't get recognized, no tooltips, nothing. Even "Go to Definition" doesn't work. Yet the code works fine.

Correct; as I mentioned, tooltips are not generated for user functions based on LDoc syntax. "Go to Definition" doesn't work because it's a global function (and those don't have "definitions"). If you change the scope to "local", "Go to Definition" should work.

Re: What code editor do you use ?

Posted: Tue Feb 21, 2017 8:22 pm
by xsw
Atom

I used to use intellij, but it feels too heavyweight to me now. I do more and more of my coding in atom.

Rigorous logging + atom is enough to make me feel productive.

Re: What code editor do you use ?

Posted: Thu Feb 23, 2017 4:41 am
by pyn
I've really been liking Light Table! It's completely free and open source, so you can literally customize everything about it. It's also surprisingly easy to customize. I think it even has Vim and Emacs commands.

Re: What code editor do you use ?

Posted: Sat Feb 25, 2017 5:24 pm
by Positive07
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...
I got something like this working (without the LuaDoc part) in Atom.

Using ctags (you don't actually need ctags installed because one of the packages installs it) and a combination of three packages, you basically install symbols-tree-view (not necessary 'cause you can use the bundled symbols-view), symbol-gen and autocomplete-ctags.

Note that I have made an issue in symbol-gen because currently it uses exuberant-ctags which is outdated, universal-ctags has better support for Lua.

You only get functions defined above the code you are currently writing and doesn't follow requires so it's pretty much what ZeroBrane provides which is good enough for 90% of the cases. It must be noted that it doesn't perform a static analysis and is pretty much many regexes bundled together so it's actually dumb.

Re: What code editor do you use ?

Posted: Sat Mar 18, 2017 5:35 am
by yetneverdone
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
That looks awesome. How to setup that with love2d?

Re: What code editor do you use ?

Posted: Sat Mar 18, 2017 10:49 pm
by emanevitaerc
Atom, set up with a few Lua and Love packages and a customized toolbar.
https://puu.sh/uP8CF/fc5413a251.png

Re: What code editor do you use ?

Posted: Sun Mar 19, 2017 3:25 am
by Andre-LA
I use Atom with atom-autocomplete and love-ide packages. Sometimes I use ZeroBrane Studio too.