What code editor do you use ?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
paulclinger
Party member
Posts: 213
Joined: Thu Jun 28, 2012 8:46 pm

Re: What code editor do you use ?

Post by paulclinger » Mon Feb 20, 2017 7:07 pm

phobos2077 wrote:
Mon Feb 20, 2017 9:50 am
Actually I've spent some time digging into every plugin available and tweaked some settings, now it's a much better experience. I think some kind of description for every plugin in the plugin repository will be a good idea. Of course you can open the source code but it's not convenient and not everybody will be doing that.
Yes, descriptions and a plugin manager are likely coming.

> Why is it @tparam and not just @param? And is there any way I can see my custom function's description when trying to write a function call?

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

> I will evaluate more and see how it works in long term. Right now there are couple of things bugging be with ZBS:
> 1. Debugging initializes a bit slow. When I debug with BabeLua it runs almost instantly (without mobdebug), but with ZBS my LOVE seems to hang for about 12 seconds before showing the game. Normal execution works instantly.

You can check this session in the documentation for suggestions on how to speed it up: https://studio.zerobrane.com/doc-lua-de ... off-and-on

Also, you can start debugging at any time, so if there is some initialization code that you don't need to debug, you can completely skip it and call `start()` only when needed (for example, when you get to a point in the game you want to debug).

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

Annabelle
Prole
Posts: 11
Joined: Sun Feb 19, 2017 1:37 pm

Re: What code editor do you use ?

Post by Annabelle » Mon Feb 20, 2017 7:16 pm

Sublime Text 3!

phobos2077
Prole
Posts: 11
Joined: Sun Feb 12, 2017 4:50 pm

Re: What code editor do you use ?

Post by phobos2077 » Tue Feb 21, 2017 5:40 pm

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.

User avatar
airstruck
Party member
Posts: 628
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: What code editor do you use ?

Post by airstruck » Tue Feb 21, 2017 6:27 pm

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

paulclinger
Party member
Posts: 213
Joined: Thu Jun 28, 2012 8:46 pm

Re: What code editor do you use ?

Post by paulclinger » Tue Feb 21, 2017 6:39 pm

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

xsw
Prole
Posts: 5
Joined: Sat Dec 31, 2016 8:26 am

Re: What code editor do you use ?

Post by xsw » Tue Feb 21, 2017 8:22 pm

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.

pyn
Prole
Posts: 5
Joined: Mon Feb 20, 2017 10:14 pm

Re: What code editor do you use ?

Post by pyn » Thu Feb 23, 2017 4:41 am

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.

User avatar
Positive07
Party member
Posts: 998
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: What code editor do you use ?

Post by Positive07 » Sat Feb 25, 2017 5:24 pm

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.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

User avatar
yetneverdone
Party member
Posts: 139
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: What code editor do you use ?

Post by yetneverdone » Sat Mar 18, 2017 5:35 am

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?
Going Home:A Pixelated Horror Game
check out my site

Nga pala, pinoy ako.

User avatar
emanevitaerc
Prole
Posts: 13
Joined: Sun Mar 13, 2016 7:21 am

Re: What code editor do you use ?

Post by emanevitaerc » Sat Mar 18, 2017 10:49 pm

Atom, set up with a few Lua and Love packages and a customized toolbar.
https://puu.sh/uP8CF/fc5413a251.png

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests