love studio

Showcase your libraries, tools and other projects that help your fellow love users.
kclanc
Citizen
Posts: 89
Joined: Sun Jan 29, 2012 6:39 pm

love studio

Post by kclanc » 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
Last edited by kclanc on Sat Nov 10, 2012 11:07 pm, edited 30 times in total.

User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: love studio

Post by MarekkPie » Sun Jan 29, 2012 7:36 pm

Any SS for us heathens, I mean, non-Windows users?

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: love studio

Post by coffee » Sun Jan 29, 2012 7:45 pm

Nice effort, but there is so much good stable code editors around. Since your project don't offer nothing very unique to LOVE probably your project will fast fade in obscurity (at least in our community).

EDITED Tested in virtual environment. Tried open the project file, nothing happened. Also got error when tried to open a simple lua. Had also other errors and crashes besides this one.

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at System.String.Substring(Int32 startIndex)
   at LoveEdit.Project.fileNameToProj(String filePath)
   at LoveEdit.Studio.newFileToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
LoveEdit
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/LoveStudio.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ScintillaNet
    Assembly Version: 2.2.4405.20907
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/ScintillaNet.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
WinControls.ListView
    Assembly Version: 1.5.1.0
    Win32 Version: 1.5.1.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/WinControls.ListView.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.7.0.0
    Win32 Version: 1.7.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Nuno%20Barros/Desktop/love_studio_demo/Aga.Controls.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
LuaAnalyzer
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/LuaAnalyzer.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

kclanc
Citizen
Posts: 89
Joined: Sun Jan 29, 2012 6:39 pm

Re: love studio

Post by kclanc » Sun Jan 29, 2012 8:22 pm

MarekkPie: Assuming SS stands for screen shot, absolutely.

coffee: Thanks for the feedback. Opening a project doesn't give any sort of visual feedback (which is bad, I know). Sorry about the bug; looking at the error message, it's hard to figure out what went wrong. Did you open the lua file using ctrl-o?

As for whether or not it offers anything unique to love, I think the debugger may be competitive with the debugging methods currently available. It lets the user browse the entire callstack and breaks are triggered upon errors. Do other debuggers have these features? Maybe next time I find myself with ample free time I will be able to take this project from its current state to something with useful, original features.

Update: I was able to reproduce your error. I think it happened because you did not use ctrl-o. Thanks again.
Attachments
lovestudio.png
lovestudio.png (79.06 KiB) Viewed 6084 times

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: love studio

Post by coffee » Sun Jan 29, 2012 9:04 pm

kclanc wrote:Did you open the lua file using ctrl-o?
You resolved the problem but yes, I didn't used ctrl-o. I tried to open with ctrl-o, selected a file and didn't understood how to open it. I double click several times and nothing. Also got errors when creating a new file. Also if clicked in debugger buttons.

For the new file crash.

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Parser.ParseText(String text)
   at LoveEdit.Studio.errorCheckTimer_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
LoveEdit
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/LoveStudio.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ScintillaNet
    Assembly Version: 2.2.4405.20907
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/ScintillaNet.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
WinControls.ListView
    Assembly Version: 1.5.1.0
    Win32 Version: 1.5.1.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/WinControls.ListView.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.7.0.0
    Win32 Version: 1.7.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/Aga.Controls.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
LuaAnalyzer
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/LuaAnalyzer.DLL
----------------------------------------
FParsec
    Assembly Version: 0.9.0.0
    Win32 Version: 0.9.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/.../Desktop/love_studio_demo/FParsec.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



Sorry but probably I will not give much more feedback because my working OS is OSX. Have a happy dev! Yes, the debugging feature is something that could make the difference. Unfortunately (at least I) get a lot of errors.

kclanc
Citizen
Posts: 89
Joined: Sun Jan 29, 2012 6:39 pm

Re: love studio

Post by kclanc » Sun Jan 29, 2012 10:46 pm

I believe this message means that you do not have the F# 2.0 runtime. Oh well. Thanks for putting up with so many errors.

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: love studio

Post by coffee » Mon Jan 30, 2012 12:08 am

kclanc wrote:I believe this message means that you do not have the F# 2.0 runtime. Oh well. Thanks for putting up with so many errors.
So it would be wise you add the usual check at the start if the component is properly installed. I or any "normal" user can't remember all or what libraries or which version our OS's have installed, right? I least I don't, I just wait usually that my pc do that boring stuff and warns me instead. Sorry posting so many errors, at least I didn't post or warn you about all of them. :D

kclanc
Citizen
Posts: 89
Joined: Sun Jan 29, 2012 6:39 pm

Re: love studio

Post by kclanc » Tue Jan 31, 2012 1:33 am

I just submitted a new version which fixes all of the bugs that have been posted. I also included the installer for the F# runtime. Sorry if you have found this overly buggy. I am just trying to get an idea if there is any demand for a love IDE before I take the time create an installer, etc.

So if anyone else wants to test this out and report any bugs they may find, I would be grateful.

User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: love studio

Post by josefnpat » Tue Jan 31, 2012 4:39 am

Any chance you can push the code to a repository or recompile a version that runs on mono (msdn for linux)?
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push

User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: love studio

Post by MarekkPie » Tue Jan 31, 2012 6:29 pm

josefnpat wrote:Any chance you can push the code to a repository or recompile a version that runs on mono (msdn for linux)?
DO ET! (if possible).

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests