shades-of-purple-vscode icon indicating copy to clipboard operation
shades-of-purple-vscode copied to clipboard

Ruby files theming is unclear

Open donquxiote opened this issue 6 months ago • 0 comments

On Ruby files with the latest updates to the recommended Ruby extensions, the theme's coloring becomes unclear. Here's an example snippet, and screenshots running the theme with the Ruby extension enabled and without. I'm posting this here because it seems like this is an issue with the theme not recognizing a new classification of the code, rather than the the Ruby extension misclassifying code.

Without Ruby extension

Screenshot 2024-08-06 at 10 05 37 AM

With Ruby extension

Here are the differences that make the code less clear:

  • class names, specifically on lines 1 and 20, have the same color as method names now
  • the module name on line 2 has the same issue
  • Keyword arguments (foo: "bar" on line 4) lose their unique color and use the same color as variables.
  • Within the initialize method, references to the arguments (arg1, arg2, foo, and options) use the same color as variables, not white.
Screenshot 2024-08-06 at 10 06 16 AM

Snippet of code

class Foo < InheritingClass
  include ModuleName

  def initialize(arg1, arg2, foo: "bar", **options)
    @arg1 = arg1
    @arg2 = arg2
    @foo = foo
    @options = options
  end

  def self.example_class_method
    puts "This is a class method"
  end

  def example_instance_method
    puts "This is an instance method"
  end

  def reference_to_another_class
    AnotherClass::SubClass::CONSTANT
  end

  def method_with_conditional_logic(fizz, buzz)
    if fizz == "fizz"
      puts true
    else
      puts false
    end

    case buzz
    when "buzz"
      puts true
    else
      puts false
    end

    fizz.map do |f|
      "#{f} !"
    end
  end
end

donquxiote avatar Aug 06 '24 15:08 donquxiote