Notepad++ Syntax Highlighting for PeopleCode, SQR and DMS

Notepad++ has been my favourite text editor for a long time.
Being a PeopleSoft Consultant I’ve been using it to work on SQRs, Data Mover Scripts, trace files and sometimes large PeopleCode programs among other things.

But Notepad++ shipped with neither syntax highlighting nor function lists for any of these.
So I was using the ones provided by Iouri Chadour for SQRs and PeopleCode.

The one for PeopleCode was later enhanced by Cache Staheli so I started using it.

However, over time, Notepad++ has evolved and how it handles function lists have changed.
In this post, we will see how we can get syntax highlighting and function lists for both PeopleCode and SQR working again.
As a bonus, I’ll also include syntax highlighting for Data Mover Scripts.

The version used for this post is Notepad++ v8.3.3 64-bit.

Setting up Syntax Highlighting

Download the following language files

npp-sqr-language.xml
npp-peoplecode-language.xml
npp-dms-language.xml

Launch Notepad++ and open the User Defined Language folder.
Language > User Defined Language > Open User Defined Language folder

Open User Defined Language Folder

Place the downloaded language files in this folder.
While it’s possible to use the User Defined Language dialog box to Import these files, this places them in the combined UDL file, which makes it difficult to maintain later.

Notepad++ SQR Language file

Setting up Function List

The Function List Panel is a zone to display all the functions (or methods) found in the current file.
You can double-click the function name in the Function List Panel to move to that function in the editor.

Download the following Function List parser rule files for PeopleCode and SQR.

peoplecode.xml
sqr.xml

Place these into the functionList folder.
functionList folder can be found either here %APPDATA%\notepad++\functionList or in the Notepad++ installation directory.
This folder will already have XML files for other languages.

Notepad++ PeopleCode Language file

Add mappings for parser rule files

The functionList contains a file named overrideMap.xml
Open this file and place the following entries in the User Defined Languages section

<association id= "peoplecode.xml"       userDefinedLangName="PeopleCode" />
<association id= "sqr.xml"              userDefinedLangName="SQR" />

Notepad++ FunctionList Mapping

If you would like to know more about functionList, head over to the Notepad++ user manual.

Testing Syntax Highlighting and Function Lists

Restart Notepad++ for the changes we made to take effect.

If you do not have Function List displayed, enable it from View > Function List.

Enable FunctionList in Notepad++

Syntax highlighting is automatically enabled based on file extensions.

PeopleCode syntax is shown for for files with .tracesql and .pc extensions.
SQR syntax is shown for for files with .sqr and .sqc extensions.
DMS syntax is shown for files with the .dms extension.

When filenames do not have the above extensions, Languages can also be selected from the Language menu.
It would now have the following new entries.

Syntax Highlighting - DMS, PeopleCode and SQR

PeopleCode

Notepad++ PeopleCode Syntax Highlighting

 Notepad++ PeopleCode Function List

SQR

Notepad++ SQR Syntax Highlighting

Notepad++ SQR Function List

DMS

DMS Syntax Highlighting

Tags: , , ,
Subscribe to Comments RSS Feed in this post
2 Responses
  1. Very useful. Thanks Rakesh!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*