Bug 469873

Summary: Comments within context blocks aren't rendered / don't work like comments
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: arawat <rawat.arnav>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jackhill3103, walter.von.entferndt
Priority: NOR    
Version First Reported In: 5.106.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description arawat 2023-05-16 22:17:21 UTC
Example:
Try the following in QML:

property string example: "ex"
property string /* a  comment */ example2: "ex"

OBSERVED RESULT
The comment delimiters aren't followed, and the comment is not treated as a comment, causing the syntax highlighting to break for the line.

The syntax highlighting file has the following context block:
 <context attribute="Normal Text" lineEndContext="#pop" name="Property">
        <WordDetect attribute="Property Type" context="#stay" String="alias" />
        <keyword attribute="Property Type" context="#stay" String="types" />
        <DetectSpaces />
        <DetectIdentifier />
        <DetectChar char=":" context="#pop" />
      </context>

EXPECTED RESULT
The comment is ignored by the syntax-highlighting engine in matching parts of the context.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.106
Comment 1 Bug Janitor Service 2023-07-12 20:19:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/502
Comment 2 Christoph Cullmann 2023-07-12 21:22:46 UTC
Git commit 7df42d60f8ab997da0ce4caa29cf4497e33c2299 by Christoph Cullmann, on behalf of Jonathan Poelen.
Committed on 12/07/2023 at 21:20.
Pushed by cullmann into branch 'master'.

QML: fix comments in property

M  +9    -0    autotests/folding/highlight.qml.fold
M  +9    -0    autotests/html/highlight.qml.dark.html
M  +9    -0    autotests/html/highlight.qml.html
M  +9    -0    autotests/input/highlight.qml
M  +9    -0    autotests/reference/highlight.qml.ref
M  +4    -2    data/syntax/qml.xml

https://invent.kde.org/frameworks/syntax-highlighting/-/commit/7df42d60f8ab997da0ce4caa29cf4497e33c2299
Comment 3 Jack Hill 2024-03-12 10:48:05 UTC
*** Bug 483329 has been marked as a duplicate of this bug. ***