Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby files theming is unclear #155

Open
donquxiote opened this issue Aug 6, 2024 · 0 comments
Open

Ruby files theming is unclear #155

donquxiote opened this issue Aug 6, 2024 · 0 comments

Comments

@donquxiote
Copy link
Contributor

donquxiote commented Aug 6, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant