Debug Environment for Scripts?

KenM

Well-known member
How do you debug your script, just full run and then hope the error will guide you???

For small script try and error is ok but for large scripts I need to be able to set a breakpoint or something to see what is going on.
 
Console.writeln debug messages are good enough for me.  IMO, sophisticated debuggers just encourage tinkering instead of thinking about the problem :)
 
There is no JavaScript debugging environment in current versions of PixInsight. I plan on including one when I change the current JavaScript engine, but don't hold your breath.

I completely agree with Rick. I use debuggers in very rare occasions. Actually, I cannot remember the last time I used one with PixInsight, probably many years ago. If you develop good programming practices, style and skills, then a debugger cannot tell you anything you don't know, except in very special cases. The key is having full control on your code, not the opposite.
 
Sure it's easy when you know the libraries very well.
It's not always your own script you try to understand, many times you are just going to edit an existing one instead of starting from scratch.

Would it be possible to add IntelliSense in the PI Editor?
This would help a lot in knowing what is possible/correct and what not.

Maybe you can make some plug-in for Eclipse when you think about adding debugging features.
 
I agree with Mr. OldSkyEyes. I'm trying to write a small script, and am neither familiar with the PI library, nor with JavaScript. (I' bought 2 books on the latter.) Other than copying code from other scripts and hoping they are compatible, I'm at a loss for how to efficiently get to the end game. A rich-featured debugger would be a real head start.

Alex
 
I just found the PJSR Object Explorer after I read you referring to it. :)
The existence of it should be made obvious in the script editor window and tab to auto complete?

Would be nice if extra info and example code was linked with the methods.
A bit like MS does on their website.  https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image?view=netframework-4.7.2
 
Back
Top