Bug 483329

Summary: QML: syntax-highlighting does not allow comments during property definitions
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Jack Hill <jackhill3103>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: walter.von.entferndt
Priority: NOR    
Version First Reported In: 5.115.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jack Hill 2024-03-12 10:45:25 UTC
SUMMARY
It is common to document a type like

    property var /*ComplexDataType*/ myData
    property int /*MyEnum*/ enumValue

but the syntax-highlighting engine does not seem to detect the comments here. This happens when putting a comment anywhere between the word "property" and either the matching colon or a new line (whichever comes first).

STEPS TO REPRODUCE
1. Open a new qml file in Kate
2. Enter the following code:

    property /*Comment1*/ var myData: xyz
    property var /*Comment2*/ myData: xyz
    property var myData /*Comment3*/: xyz
    property var myData: /*Comment4*/ xyz
    property var myData /*Comment5*/

OBSERVED RESULT
Only Comment4 is displayed as a comment

EXPECTED RESULT
All comments should be displayed as a comment

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240306
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.7.7-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Jack Hill 2024-03-12 10:48:05 UTC

*** This bug has been marked as a duplicate of bug 469873 ***