Created attachment 175539 [details] Ruby broken highlight cases SUMMARY After this commit: https://invent.kde.org/frameworks/syntax-highlighting/-/commit/994c8cc92598a9dac20aa99a89a75b50e21ae3f0 I've found several cases of wrongly highlighted elements. It was one commit, so I've made them one bug report (I could split them if needed). Rolling back to previous commit `91f60020045733ca55f4ea9290f0862874f3cd16` fixes these problems. STEPS TO REPRODUCE 1. Open Ruby file, e.g. test.rb 2. Add following code: ``` # Error 1. wrong %-string in array highlighting string_in_array = [%(#{x} test)] # Error 2. wrong 1st symbol highlighting in method call for instance variable data = @hash.slice :key_one, :key_two # Error 3. wrong class in module highlighting after raise raise Module::Class ``` Interpolation in first case is not needed, just to emphasize the problem, that its content is highlighted as code, not string, and # interpreted as comment start. Also I've added attachment (same code, just as separate file). OBSERVED RESULT Error 1. %-string is not interpreted as string literal. Error 2. :key_one is not highlighted as symbol Error 3. Class is highlighted as symbol :Class EXPECTED RESULT Correct highlighting :), similar to previous beviour. SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20241103 KDE Plasma Version: 6.2.2 KDE Frameworks Version: 6.7.0 Qt Version: 6.8.0 Kernel Version: 6.11.5-2-default (64-bit) Graphics Platform: Wayland Processors: 24 × Intel® Core™ i7-14650HX Memory: 31.1 ГіБ of RAM Graphics Processor: Mesa Intel® Graphics
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/703
Git commit 82049fcfebdcc9e560149ff2cbe54448b3b284ea by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 24/05/2025 at 16:19. Pushed by cullmann into branch 'master'. Ruby: fix %-string and regex in array ```rb a = [/regex/] a = [%(str)] # ^ not an operator ``` Related: bug 495349 M +2 -0 autotests/folding/highlight.rb.fold M +2 -0 autotests/html/highlight.rb.dark.html M +2 -0 autotests/html/highlight.rb.html M +2 -0 autotests/input/highlight.rb M +2 -0 autotests/reference/highlight.rb.ref M +3 -2 data/syntax/ruby.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/82049fcfebdcc9e560149ff2cbe54448b3b284ea
Git commit 841bfb53e2f8356da5ebd73b71bbb51fe12a0e98 by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 24/05/2025 at 16:19. Pushed by cullmann into branch 'master'. Ruby: fix operator after method call (expected unary operator or expression) ```rb foo.bar /regex/ "abc".match /regex/ # ^ not an operator foo.bar/10 "abc".length/10 # ^ operator (not preceded by space) ``` M +6 -1 autotests/folding/highlight.rb.fold M +6 -1 autotests/html/highlight.rb.dark.html M +6 -1 autotests/html/highlight.rb.html M +6 -1 autotests/input/highlight.rb M +6 -1 autotests/reference/highlight.rb.ref M +26 -2 data/syntax/ruby.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/841bfb53e2f8356da5ebd73b71bbb51fe12a0e98
Git commit 59a2eb1082a62f00c0b3898c6d28c464a16efbe3 by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 24/05/2025 at 16:19. Pushed by cullmann into branch 'master'. Ruby: fix sub class after keyword / function ```rb raise Module::Class # ^ not a symbol, but # ~~ Operator # ~~~~~ Constant ``` M +2 -0 autotests/folding/highlight.rb.fold M +2 -0 autotests/html/highlight.rb.dark.html M +2 -0 autotests/html/highlight.rb.html M +2 -0 autotests/input/highlight.rb M +2 -0 autotests/reference/highlight.rb.ref M +18 -8 data/syntax/ruby.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/59a2eb1082a62f00c0b3898c6d28c464a16efbe3