https://bugs.kde.org/show_bug.cgi?id=495823

            Bug ID: 495823
           Summary: Ruby syntax highlighting wrong for %-string in array,
                    raise with class in module and symbol in method call
                    for instance variable
    Classification: Frameworks and Libraries
           Product: frameworks-syntax-highlighting
           Version: 6.7.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: syntax
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 175539
  --> https://bugs.kde.org/attachment.cgi?id=175539&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to