love studio
Posted: Sun Jan 29, 2012 7:14 pm
I have written a windows-based IDE for love called lovestudio. It's a bit rough and untested, and I'm not sure if I'm going to have the time to keep working on it at this point, but I think I've taken it far enough that it may be useful to some people.
Requirements:
A PC running Windows (Vista or 7 -- XP currently doesn't work, though I am trying to fix that)
Directions:
Creating a project:
LoveStudio is a project-based IDE, so the first thing that must be done when using it is creating a project. To do this, click on the the "Project -> New Project" menu item. Place the project file in the root directory of an existing love project.
Opening Files:
To open a file, press ctrl-O. This will generate a list of all lua files contained in the currently open project. Type in the name of the file you wish to open and press enter. A lua editor that is currently focused can be closed by pressing Ctrl-Q.
Layout:
LoveStudio uses a dual pane layout by default. To expand the left pane so that it occupies the entire window, press Ctrl-W. Pressing Ctrl-W again brings the layout back to dual-pane mode.
When a lua editor is focused (i.e. the caret is visible and flashing), it can be moved to the opposite pane by pressing Ctrl-/. This way, you can have two lua files open at the same time, which is especially useful when one of the files references another. Ctrl-. moves the caret from one pane to the other.
Folding:
LoveStudio automatically folds every file upon opening it. While this is slow, buggy, and could be considered inferior to having an eclipse-style outline view, it exists in order to give the programmer an eagle-eye view of the file before delving into it. There is no way to disable this. Fold points can be expanded and collapsed either by clicking on them, or pressing Ctrl-'.
Debugging:
LoveStudio includes a modified version of Love 0.8.0 which contains an extra module called "debugger". Before a project can be debugged using lovestudio, the debugger module must be enabled; this can be done the same way it would for any other module. In addition, the function called loved.debugger.update must be called once per game loop. I have made the aforementioned changes to a copy of the kurosuke source, which is included in the zip file.
Once the project has been set up properly, it can be run in debug mode by pressing F5. Breakpoints can be added by clicking in the margins. Once a breakpoint has been hit, it is fairly straightforward to use the debug panel to navigate the lua state. At this point F5 will resume execution, F6 will step to the next line in the file you are viewing, and F7 will step to the next statement executed.
--
I'm not going to have time to add any features to this project in the near future, but if people find this useful, I may post the source code on bitbucket. I would also appreciate suggestions and bug notifications.
Update: 1-30-12 -- bugfix
Update 2-4-12 -- fixed stepping over returns. Ctrl-'Q' now closes editors, because Ctrl-'C' is kinda already taken.
Update 2-11-12 -- The currently-viewed items now get preserved when stepping over. Keybindings, which were totally screwed up last update, have been fixed. Multiple debug sessions no longer crash love studio.
update 3-3-12 -- Pressing enter no longer chops off the end of a line. Newly created
files now save correctly. Love waits to receive breakpoints before beginning execution.
update 3-9-12 -- pressing tab now inserts spaces, which fixes the problem with using tabs and spaces inconsistently.
update 3-19-12 -- prevented rentrant debugging. added syntax error highlighting.
update 4-4-12 -- Added an awesome new error window which lists all syntax errors and prevents you from running the game when it has them.
update 5-8-12 -- 0.8.0 compatibility
Update 5-25-12 -- file system watching, lock files while debugging, breakpoint shifting fixed, semantic analysis disabled to prevent crashing, installer created
Update 5-29-12 -- fixed a bug where the debug browser would crash, turning into a red X. clicking on tail calls in the stack viewer no longer causes crashes.
update 6/1/12 -- long comments and strings no longer cause crashes when you type them out. clicking on list boxes when no item is selected no longer causes a crash.
update 6/17/12 -- fixed project open box crashes; fixed randomish reloading (and folding) of files upon saving; when a break is hit in an editor in the right pane, it gets moved to the left pane in order to leave the debug panel visible
update 7/1/12 -- made error highlighting less annoying. waaaay less annoying.
'merica day update - fixed an issue where breakpoints would sometimes get added to the wrong file. fixed error recovery. made it so that almost no performance overhead is incurred when no breakpoints have been set.
Also, this project is now on bitbucket: https://bitbucket.org/kevinclancy/love-studio
Requirements:
A PC running Windows (Vista or 7 -- XP currently doesn't work, though I am trying to fix that)
Directions:
Creating a project:
LoveStudio is a project-based IDE, so the first thing that must be done when using it is creating a project. To do this, click on the the "Project -> New Project" menu item. Place the project file in the root directory of an existing love project.
Opening Files:
To open a file, press ctrl-O. This will generate a list of all lua files contained in the currently open project. Type in the name of the file you wish to open and press enter. A lua editor that is currently focused can be closed by pressing Ctrl-Q.
Layout:
LoveStudio uses a dual pane layout by default. To expand the left pane so that it occupies the entire window, press Ctrl-W. Pressing Ctrl-W again brings the layout back to dual-pane mode.
When a lua editor is focused (i.e. the caret is visible and flashing), it can be moved to the opposite pane by pressing Ctrl-/. This way, you can have two lua files open at the same time, which is especially useful when one of the files references another. Ctrl-. moves the caret from one pane to the other.
Folding:
LoveStudio automatically folds every file upon opening it. While this is slow, buggy, and could be considered inferior to having an eclipse-style outline view, it exists in order to give the programmer an eagle-eye view of the file before delving into it. There is no way to disable this. Fold points can be expanded and collapsed either by clicking on them, or pressing Ctrl-'.
Debugging:
LoveStudio includes a modified version of Love 0.8.0 which contains an extra module called "debugger". Before a project can be debugged using lovestudio, the debugger module must be enabled; this can be done the same way it would for any other module. In addition, the function called loved.debugger.update must be called once per game loop. I have made the aforementioned changes to a copy of the kurosuke source, which is included in the zip file.
Once the project has been set up properly, it can be run in debug mode by pressing F5. Breakpoints can be added by clicking in the margins. Once a breakpoint has been hit, it is fairly straightforward to use the debug panel to navigate the lua state. At this point F5 will resume execution, F6 will step to the next line in the file you are viewing, and F7 will step to the next statement executed.
--
I'm not going to have time to add any features to this project in the near future, but if people find this useful, I may post the source code on bitbucket. I would also appreciate suggestions and bug notifications.
Update: 1-30-12 -- bugfix
Update 2-4-12 -- fixed stepping over returns. Ctrl-'Q' now closes editors, because Ctrl-'C' is kinda already taken.
Update 2-11-12 -- The currently-viewed items now get preserved when stepping over. Keybindings, which were totally screwed up last update, have been fixed. Multiple debug sessions no longer crash love studio.
update 3-3-12 -- Pressing enter no longer chops off the end of a line. Newly created
files now save correctly. Love waits to receive breakpoints before beginning execution.
update 3-9-12 -- pressing tab now inserts spaces, which fixes the problem with using tabs and spaces inconsistently.
update 3-19-12 -- prevented rentrant debugging. added syntax error highlighting.
update 4-4-12 -- Added an awesome new error window which lists all syntax errors and prevents you from running the game when it has them.
update 5-8-12 -- 0.8.0 compatibility
Update 5-25-12 -- file system watching, lock files while debugging, breakpoint shifting fixed, semantic analysis disabled to prevent crashing, installer created
Update 5-29-12 -- fixed a bug where the debug browser would crash, turning into a red X. clicking on tail calls in the stack viewer no longer causes crashes.
update 6/1/12 -- long comments and strings no longer cause crashes when you type them out. clicking on list boxes when no item is selected no longer causes a crash.
update 6/17/12 -- fixed project open box crashes; fixed randomish reloading (and folding) of files upon saving; when a break is hit in an editor in the right pane, it gets moved to the left pane in order to leave the debug panel visible
update 7/1/12 -- made error highlighting less annoying. waaaay less annoying.
'merica day update - fixed an issue where breakpoints would sometimes get added to the wrong file. fixed error recovery. made it so that almost no performance overhead is incurred when no breakpoints have been set.
Also, this project is now on bitbucket: https://bitbucket.org/kevinclancy/love-studio