| Summary: |
syntax highlighting for QML is broken when file starts with shebang |
| Product: |
[Frameworks and Libraries] frameworks-syntax-highlighting
|
Reporter: |
kdebugs |
| Component: |
syntax | Assignee: |
KWrite Developers <kwrite-bugs-null> |
| Status: |
RESOLVED
FIXED
|
|
|
| Severity: |
normal
|
CC: |
walter.von.entferndt
|
| Priority: |
NOR
|
|
|
| Version First Reported In: |
5.98.0 | |
|
| Target Milestone: |
--- | |
|
| Platform: |
Other | |
|
| OS: |
Other | |
|
|
Latest Commit:
|
https://invent.kde.org/frameworks/syntax-highlighting/commit/8514122344088507ff18639ffbed2a947202a5b9
|
Version Fixed/Implemented In:
|
|
|
Sentry Crash Report:
|
|
| |
SUMMARY Syntax highlighting for QML files is broken when the file includes shebang line. STEPS TO REPRODUCE 1. Open kate. 2. Make and save a QML file, e.g. "hello.qml": import QtQuick 2 Rectangle { width: 200 height: 100 Text { text: "Hello, World!" } } 3. Add a shebang line at the beginning of the file, e.g. #!/usr/bin/env qml OBSERVED RESULT When you add the shebang, everything but the first two characters (or until a /* multi-line comment */) turns orange (or green, in eariler versions.) EXPECTED RESULT Shebang should not break highlighting. SOFTWARE/OS VERSIONS Kubuntu 22.10 KDE Plasma Version: 5.25.5 KDE Frameworks Version: 5.98.0 Qt Version: 5.15.6 Kate 22.08.2 ADDITIONAL INFORMATION A commit related to Bug 325805 apparently fixed this for JavaScript in 2014. That commit also involved a minor change to qml.xml, however I don't think it ever worked in QML. Copying the lines related to shebang from javascript.xml into qml.xml seems to make it correctly recognize the shebang line, except that it doesn't color it like a comment, and I don't know enough about this syntax highlighting system to know how to fix that.