Adding a Language to official Notepad++
-
Is it at all possible to add a language to Notepad++ officially?
-
@Dawg1104 said in Adding a Language to official Notepad++:
Is it at all possible to add a language to Notepad++ officially?
At all? Definitely.
Practically? It depends on the language.
Notepad++ uses a library called Lexilla for handling the syntax highlighting of “official” languages. Lexilla actually provides some languages that Notepad++ has not yet exposed to its users. I have actually done a couple PR where I submitted the Notepad++ code update to enable those “hidden languages”.
But if it doesn’t already exist in Lexilla, then someone would have to write the lexer per Lexilla standards, then submit it to Lexilla. One, in theory, could just submit a request that Lexilla add the language, but unless it happens to be a language that one of the Lexilla team is interested in, there’s very little chance they will implement it – for example,
awk
was requested to be added to Lexilla in 2009, but since the developer isn’t interested in it, it’s never been implemented. So practically, to add a new language to Lexilla, you have to write it.Those are the two paths to being “officially” added. But there are more paths to unofficial:
- There might already be a UDL (User Defined Language) available in the UDL Collection, If so, anyone can easily download the UDL definition from there and install it into their copy of Notepad++ per the UDL Collection instructions
- or, if you already have a UDL defined, but there isn’t one for that language in the Collection, you can submit it to the collection as described in the Collection instructions
- if it’s a simple list of keywords and operators and maybe a folding symbol (like the
{ ... }
of C-style languages), it’s pretty easy to make your own UDL (and then submit it to the collection) - my CollectionInterface plugin makes it really easy to download and install a language from the UDL Collection. wink wink nudge nudge
- If the logic is more complicated than simple keyword matching, then it’s possible to write a lexer plugin (overview found in the User Manual) – and such a plugin can be submitted to the Plugins Admin. (One of the most famous lexer plugins is the GEDCOM lexer, but there are actually quite a few of the plugins that have lexing capability among their features.)
So, what language are you looking for, that you cannot yet find?
- There might already be a UDL (User Defined Language) available in the UDL Collection, If so, anyone can easily download the UDL definition from there and install it into their copy of Notepad++ per the UDL Collection instructions