During Akademy there was finally enough time to finalize the porting of KTextEditor to KSyntaxHighlighting.
Thanks to the help of Dominik and Volker, the needed extensions to the KSyntaxHighlighting framework were done in no time ;=)
Thanks for that!
The branch for the integration was merged to master yesterday, unit tests look OK and I am using that state now for my normal coding work. Beside minor glitches that should now be corrected, no issues came up until now.
But as with all changes, for sure some regressions slipped in.
If you notice strange behavior of the highlighting in master, please report the issues on bugs.kde.org or on our mailing list (or even better: provide a fix on phabricator).
For sure there are potential further cleanups and now that we have only one implementation of the highlighting infrastructure, we will be able to move forward with extensions of it much easier.
We contacted the QtCreator people, to see if we might be able to share a common implementation, as they have an own one at the moment. Hopefully that works out in a nice way and our KDE syntax-highlighting framework gets an even broader user base!
After fixing some first porting bugs to KSyntaxHighlighting, code folding (non-indentation based) is back working, too.
There is a still a lot to do (and e.g. the syntax colors are still kind of randomized), but already all KTextEditor original highlighting code is gone without ending up in an unusable state.
After several years, the time has come that KTextEditor finally starts to use more of KSyntaxHighlighting than just the syntax definitions resources.
At the moment, we still do everything on our own (parsing the xml, doing the highlighting, …) and only use the XML files bundled inside the KSyntaxHighlighting library as “code sharing”.
I started a “syntax-highlighting” branch in ktexteditor.git to change that. Dominik helped out by starting to add missing API to KSyntaxHighlighting that will ease the porting.
The first step will be: Having full working highlighting without color scheme or configuration support inside the branch.
If that is done, we will take a look at the scheme/configuration stuff.
The current state only handles the highlighting, folding is ATM out of order. It speaks for the quality of Volker’s KSyntaxHighlighting implementation that with minimal additions only 1-2 hours of work did lead to a “usable” result.
=> obligatory screenshot
Beside the missing folding markers, it doesn’t look that bad, or?
I hope we can work on that during Akademy, too, to finally move on and not keep all things duplicated just because we got no time to work on it.
Btw., thanks again to Volker for the work on the framework!
Like Dominik, I will be around the whole Akademy, too.
Looking forward to see new and old friends, lets have a productive week there!