Bug 469873 - Comments within context blocks aren't rendered / don't work like comments
Summary: Comments within context blocks aren't rendered / don't work like comments
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.106.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 483329 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-16 22:17 UTC by arawat
Modified: 2024-03-12 10:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***