For the syntax highlighting you will also need to be able to distinguish different scopes etc. and you probably need to know a bit about lexers.
The Lua-Plugin for IntelliJ is the only IDE I found (for Mac OSX) that has auto-formatting and extensive syntax highlighting (different colors for upvalues, local variables, global variables, parameters etc.). You could take a look at its source code too, but it is pretty complex.
creating an ide
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: creating an ide
I wouldn't go that far though... Just normal syntax highlighting is enough in most cases
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)
Re: creating an ide
I agree. I guess I'm just very spoiled when it comes to syntax highlightingPositive07 wrote:I wouldn't go that far though... Just normal syntax highlighting is enough in most cases
Re: creating an ide
so creating an ide is mission impossible, how hard would it be to make a very simple text editor which could load/save files and display them as tabs? just a simple notepad with tabs
Re: creating an ide
Who said that? Isn't zerobrane even written in lua? Well okay, their actual text field is a native extension (right?) but if LightTable can work in Clojure then there definitely is a way to build a lua IDE on lua.Doctory wrote:so creating an ide is mission impossible
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: creating an ide
I could work on the text area... but is a big project... a couple of months maybe, syntax highlighting is easy as pie... Mouse and cursor are hard (not that hard either, I already have the algorithm done)
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)
- seeker14491
- Prole
- Posts: 9
- Joined: Thu Nov 29, 2012 10:47 pm
Re: creating an ide
You could try using IUPLua, a GUI toolkit. It has the Scintilla library built in, which provides text editing functionality.
Here is the example from the manual showing a basic source code editor:
http://webserver2.tecgraf.puc-rio.br/iup/
Here is the example from the manual showing a basic source code editor:
http://webserver2.tecgraf.puc-rio.br/iup/
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: creating an ide
I guess the purpose is a completely Lua/LÖVE IDE, so that any Lover could modify it to their liking! But yeah totally possible with many libraries and toolkits made around Lua that exist out there
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)
-
- Party member
- Posts: 227
- Joined: Thu Jun 28, 2012 8:46 pm
Re: creating an ide
For ZBS, the percentage of Lua code is close to 100%. ZBS is using wxlua, which is a wrapper around wxwidgets (which includes Scintilla editing component); I have couple of patches in C++ for those components, but the rest of ZBS code is all Lua.kikito wrote:For full-fledged IDEs, Zerobrane Studio is worth a look. I don't know the exact percentage of Lua code vs native code on these projects, but I've heard it's significant.
Back to the topic, doing IDE/editor in Love is an interesting idea, but I think the OP may be underestimating the amount of work involved. ZBS itself is fairly small at about 14k total Lua lines in the code files (not including plugins and API/spec files), but this doesn't include any functionality provided by Scintilla or wxwidgets, which is not all available in love2d and the libraries that ship with it. For example, you can start a process from Lua using os.execute, but it doesn't provide a method to kill a process, so one would need to use something like posix or winapi modules to achieve that. One would need to write everything related to the editing and syntax-highlighting and it's not a trivial task. It's an interesting project for sure and I learned a lot while working on it (and making things to work on different platforms), so I don't want to deter anyone taking up on that.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: creating an ide
I have decided to work on this... right now I have 80% of the text area done... next steps: up and down keys actually moving the cursor to an expected position, supr working at all (backspace already works, so this wont be that hard), selecting text (I could already have implemented this, but as with up and down keys... I'm too lazy) and syntax highlighting (I already have some ideas on how to go with this)
I'll start cleaning the code a little because there are too many ugly things
I haven't found any performance hickups right now, everything is working fine... The worst part will be when working with different fonts, since getting the width of a piece of text wont be as easy as font:getWidth
I'll start cleaning the code a little because there are too many ugly things
I haven't found any performance hickups right now, everything is working fine... The worst part will be when working with different fonts, since getting the width of a piece of text wont be as easy as font:getWidth
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)
Who is online
Users browsing this forum: Bing [Bot] and 4 guests