What code editor do you use ?
Re: What code editor do you use ?
Sublime Text 3!
-
- Prole
- Posts: 11
- Joined: Sun Feb 12, 2017 4:50 pm
Re: What code editor do you use ?
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
Re: What code editor do you use ?
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.
-
- Party member
- Posts: 227
- Joined: Thu Jun 28, 2012 8:46 pm
Re: What code editor do you use ?
>> -- @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.
>> -- @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 ?
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.
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 ?
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.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: What code editor do you use ?
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...
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/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: What code editor do you use ?
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
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- emanevitaerc
- Prole
- Posts: 17
- Joined: Sun Mar 13, 2016 7:21 am
Re: What code editor do you use ?
Atom, set up with a few Lua and Love packages and a customized toolbar.
https://puu.sh/uP8CF/fc5413a251.png
https://puu.sh/uP8CF/fc5413a251.png
Re: What code editor do you use ?
I use Atom with atom-autocomplete and love-ide packages. Sometimes I use ZeroBrane Studio too.
print("Olá Mundo!")
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests