PeopleCode Syntax Highlighting in Ace Editor

Ace is an embeddable code editor written in JavaScript.  My first exposure to the Ace Editor was when I started to use the Cloud9 IDE for non-PeopleSoft development.  I like using web-based tools because they prevent me from being tied to a particular machine to do work.  With tools like Cloud9, I can develop software from any one of my internet-connected devices.  PeopleSoft development is a bit different than developing software in other languages as App Designer is needed to edit PeopleCode programs. I would rather not have to always rely on a client-based application to edit PeopleCode.  This is the reason that I embarked on writing a JavaScript-based PeopleCode editor powered by Ace.  The Ace Editor provides many desirable features that can be found in most modern editors and it also allows for language-specific syntax highlighting. Today I would like to share the PeopleCode syntax mode that I created for the Ace Editor.

Usage of the PeopleCode syntax highlighter in the Ace Editor is really simple.  Below is an example that demonstrates the functionality.

The syntax highlighter is not perfect, but it is definitely a step up from no highlighting at all.  I hope to provide updates to the highlighting rules as I have time to the GitHub repository here.  I certainly welcome any community contributed enhancements to this repository as well.

While PeopleCode syntax highlighting with the Ace Editor is helpful for displaying read-only PeopleCode snippets online, this functionality really becomes useful when used in an online PeopleCode editor that is capable of making real time code updates to the application.  I did a post last year discussion the idea of exposing the %metadata Application Package as an API of sorts to support the backend of an online PeopleCode editor.  While this was a solid proof of concept, the demonstrated editor in that post was undoubtedly hideous.  Since then I have added a slew of changes with the most important one being the incorporation of the Ace Editor.  Here is a screen shot of the progress that has been made to the online PeopleCode editor project:

Online PeopleCode Editor

As you can probably tell, the Ace Editor with PeopleCode syntax highlighting makes the online PeopleCode editor much more usable.   I am excited to share and document the new features and functionality of the online PeopleCode editor project in a future post.

One thought on “PeopleCode Syntax Highlighting in Ace Editor

Leave a Reply

Your email address will not be published.