Search code examples
javascripteditorxpages

format indentation in XPages JS Editor


The XML editor has the function to properly format the source XML by indention. Very useful in finding unmatched etc. I have search but can not find a similar function in the JavaScript editor to indent using the { } which would be really handy and make the code much easier to follow and catch improper placement of the { }'s. Is there a built in function to do this, or is there an add on of some sort that can be installed?


Solution

  • CSJS code can be formatted automatically with

    • Ctrl+Shift+F or
    • mouse click right + menu Source/Format

    enter image description here

    Unfortunately, this is not available for SSJS code.
    Workaround: copy SSJS code into CSJS code window, format it and copy it back to SSJS code window.