Bug 459825

Summary: syntax-highlighting 5.98.0 breaks kate/ktexteditor from 2018
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: nfxjfg
Component: frameworkAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 5.98.0   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description nfxjfg 2022-09-29 16:17:23 UTC
SUMMARY

I'm using kate/ktexteditor from 2018 (ktexteditor f06e83281268701 / kate 2641fc835e5fecb5, version 18.03.70). When upgrading from syntax-highlighting framework release 5.97.0 to 5.98.0, highlighting of C source files broke in a stranger way: after the first number token (like 123), the rest of the line is rendered in red, and braces matching stops working for that line. This happens with source code text that parses as number in C. (Numeric digits embedded in string literals don't cause it.) It seems to affect any and all tokens that follow the number.

I've built 5.97.0 locally for kate (so only the ancient kate accesses it), and it works again.

There is no such problem with kate 22.04.3.

While using ancient kate may seem absurd to you, syntax-highlighting probably accidentally broke compatibility in a subtle way, that might affect other users of this framework.

STEPS TO REPRODUCE
1. Build old kate/ktexteditor (git hashes see above) with syntax-highlighting 5.98.0. I can't find the instructions how to do this properly, though.
2. Open any .c source file, using the standard C syntax highlighter. (I have no local syntax .xml files from what I can tell, in fact I wonder where these files are located at all.)

OBSERVED RESULT

Renders like with 5.97.0, nothing strange visible.

EXPECTED RESULT

Text following a number token is rendered red, until the line ends.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: no KDE running
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
Comment 1 nfxjfg 2022-09-29 16:18:29 UTC
> syntax-highlighting probably accidentally broke compatibility in a subtle way, that might affect other users of this framework.

Correction: or ancient kate used the API incorrectly, or a breaking API change occurred.
Comment 2 Christoph Cullmann 2022-10-02 09:50:36 UTC
Mixing frameworks versions is not supported, if you update syntax-highlighting, please update ktexteditor, too.
We will not spend work on making different mixed versions working.
And even for the application, using a 4 year old version with more or less the latest frameworks is no supported use case we will debug.