KSyntaxHighlighting meta data

Alexander Semke alexander.semke at web.de
Sat Aug 4 08:16:15 BST 2018


Hi Dominik,
 
> @Alexander: In fact, you could do that already now as well: Open the
> xml file and read which keyword lists exist. Not the most performant
> solution, but it would work.
This is actually how it was done in the past :-) Cantor had the xml file for 
Maxima for example which was parsed at start. If I remember the explanations 
of the original author of Cantor correctly, this xml file was taken from 
kwrite/kate. Last year we removed the handling of this file and moved to static 
definition in the c++ code
https://cgit.kde.org/cantor.git/tree/src/backends/maxima/maximakeywords.cpp

This is faster compared to parsing of the xml file and we don't need to deal 
with additional files in cmake. 

For other systems like Octave, R, etc. we don't have any static definitions and 
we always fetch the keywords during the runtime from the corresponding system. 
This we need/want to change now. Even if we go here via potentially slower xml 
parsing done in KSyntaxHighlighting, I'd still prefer this solution since we 
can remove all this code in Cantor around keyword handling (different 
implementations for different systems) and can stick to a central KDE 
component.


Thanks and Regards,
Alexander




More information about the KWrite-Devel mailing list