Minimal changes to standard C++ Notepad++ plugin template to figure out how to implement an external lexer.
Neither Scintilla or NPP provide much documentation on how to create a lexer - let alone an external one!
For the actual lexing part I suggest looking at the built in NPP lexers source.
My C++ is... crusty.
LexerTemplate.vcxproj
file sets <PlatformToolset>
= v142 for Visual Studio 2019.
Interface functions required for NPP to use the lexer are declared with...
extern "C" __declspec(dllexport) ... __stdcall
but still needed an exports.def file to work (I assume something to do with name mangling).
src\scintilla
is unmodified header files copied from NPP\Scintilla\include
src\lexlib
contains required files copied from NPP\Scintilla\lexlib - unchanged other than commenting out some headers that were not required.
src\Lexer\Config\LexerTemplate.xml
defines the language keywords & styles. See NPPs lang.xml and stylers.xml for inspiration.
Copy the plugin dll to plugins\LexerTemplate\LexerTemplate.dll
and the xml file to plugins\Config\LexerTemplate.xml
"LexerTemplate" should appear:
In Language menu...