vscode integration and general comments on jsreport-cli



  • I do a lot of ionic development in visual studio code on both Windows (when at work) and Mac (when I travel) - works great on both platforms! There are a couple of vscode plugins that make it work:

    1. Cordova Tools (for debugging) - https://github.com/Microsoft/vscode-cordova

    2. ionic 2 Commands with Snippets (for adding new pages, components, providers, etc.) - https://github.com/Thavarajan/vscode-ionic2-Extension

    The ionic-cli is very similar in practice to jsreport-cli although a little simpler - you do "ionic start" which sort of combines your "jsreport init" and "jsreport configure" actions into one. When "ionic start" finishes, it has automatically setup your project for git and vscode.

    After finally wrapping my head around most of it - i really like the architecture of jsreports - but I'd love it even more if I could get intellisense, a real HTML editor, and real debugging for scripts inside vscode - it doesn't seem like it should be that hard since nodejs is a first class citizen in vscode:

    https://code.visualstudio.com/docs/nodejs/nodejs-debugging

    and then add a "generate" option to your jsreport-cli and make a plugin similar to the "ionic 2 Commands with Snippets" that can call it (i.e. as follows):

    jsreport generate template "Some Template"
    jsreport generate script "Some Script"
    etc.

    If you did that - I'd also advise you take the "Commit" stuff out of the studio gui and just rely on people using git if they need versions - would save you from maintaining a lot of complexity that is better done in a tool like vscode.



  • It is already possible to code jsreport templates in the vscode and debug it as well.
    I will prepare a blog post about it today and post here.

    In time we could also bring some new commands to the cli as you proposed.
    Thanks for your ideas.



  • Awesome - looking forward to the blog post!



  • Sorry for the delay. It took me a while to figure it out.

    https://jsreport.net/blog/debug-jsreport-in-vscode



  • Tried it out and the editing worked well - the debugging would work fine if I use the "debugger" keyword in my code but I could not get the interactive breakpoints to work no matter what I tried. It wouldn't show the script i placed the breakpoint in under loaded scripts so I could check the box. Still very useful though - thank you so much!



  • Thanks for feedback. I will add to the post also debugger keyword. Lets see what others will experience....


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.