Bonescript and Cloud9: how to debug something other than blinkled.js?

Hi,

I like the Angstrom Beaglebone's idea of providing an out-of-the box
IDE and sample code with bonescript and Cloud9.

I know the bonescript project is still in early development, but I ran
into a basic problem that hopefully has an easy workaround.

If I create a new .js file in Cloud9, select it and click Debug (or
Run), the IDE launches blinkled.js instead of the new file.

Since I'm not sure how the project settings are configured in this
default project, I tried starting Cloud9 with a new workspace:

i.e.
/usr/bin/node /usr/share/cloud9/bin/cloud9.js -l 0.0.0.0 -w /home/root/
mystuff -p 3001

Cloud9 then lets me edit the files in /home/root/mystuff. Strangely,
though, the debugger still wanted to run blinkled.js, even though the
file didn't exist in /home/root/mystuff. I don't know where Cloud9
gets its settings from, but it looks like the .xmlsettings file is
somehow picking up the settings from the default workspace folder (/
var/lib/cloud9).

Has anyone been able to debug files other than blinkled.js using the
Angstrom image's Cloud9 package?

Thanks,

Dan.

Hi,

I like the Angstrom Beaglebone’s idea of providing an out-of-the box
IDE and sample code with bonescript and Cloud9.

I know the bonescript project is still in early development, but I ran
into a basic problem that hopefully has an easy workaround.

If I create a new .js file in Cloud9, select it and click Debug (or
Run), the IDE launches blinkled.js instead of the new file.

Since I’m not sure how the project settings are configured in this
default project, I tried starting Cloud9 with a new workspace:

i.e.
/usr/bin/node /usr/share/cloud9/bin/cloud9.js -l 0.0.0.0 -w /home/root/
mystuff -p 3001

Cloud9 then lets me edit the files in /home/root/mystuff. Strangely,
though, the debugger still wanted to run blinkled.js, even though the
file didn’t exist in /home/root/mystuff. I don’t know where Cloud9
gets its settings from, but it looks like the .xmlsettings file is
somehow picking up the settings from the default workspace folder (/
var/lib/cloud9).

Has anyone been able to debug files other than blinkled.js using the
Angstrom image’s Cloud9 package?

The socket.io connection used for debugging is probably connecting up to the wrong port. I’m not sure if Cloud9 handles multiple running instances. I think the easiest work-around for you is to edit /lib/systemd/system/cloud9.service to point to where your files will be. Of course, is there a reason you don’t want to leave it in the default directory and just make your project there? Perhaps I could do more to give you a clean working directory?

I might also be able to move bonescript itself as it gets more mature into the default node_modules directory as part of node itself such that it is transparent, leaving just examples you can delete in the working directory. I have it in the working directory for now because I’m looking for patches from people working with the software.

Jason,

Yes, I tried that as well: just edited the "-w" parm in /lib/systemd/
system/cloud9.service and restarted the service. The debugger still
wanted to launch blinkled.js.

The only reason I wanted to change the default directory was that I
couldn't figure out how to run the Cloud9 debugger for a file other
than blinkled.js. I don't know Cloud9 at all, but I thought that some
config file in /var/lib/cloud9 might be pointing to blinkled.js.

Maybe the problem I'm having is just due to something I've done to my
configuration? Should debugging another file in Cloud9 on the
Angstrom image be as simple as selecting the file and clicking the
Cloud9 debug toolbar button?

Thanks,

Dan.

Run/Debug seems to run whichever is last in the run configuration when
you push the button. Use the dropdown arrow next to Run or Debug to
add a new run configuration. Then select the new run config in the
dropdown to run/debug it.

I haven’t explored, but it might be possible that the dropdown values are stored in your browser cookies, since if you change the starting directory, there is no way for Cloud9 to find /var/lib/cloud9/.settings.xml.

Yes, that's what I missed: the dropdown menu with the Run
Configuration option. Changing the Run Configuration allowed me to
debug another .js file without any problems.

Thanks,

Dan.