Skip to content

Conversation

@artofhuman
Copy link
Contributor

image

Added ruby syntax, but there are some issues:

  • could not find solution, how to highlight compact style definitions (line 9)
  • only @ symbol in instance variables like @abc should be highlighted

@p00f
Copy link
Owner

p00f commented Sep 30, 2025

Hi! I'll help you with this. Can you paste the snippet?

@artofhuman
Copy link
Contributor Author

Sure

# frozen_string_literal: true

class Foo
end

module Bar
end

class Bar::Foo
end

# example
module REDIS
  class Bar
    module Foo
      # example 2
      class Bar < Bar::Foo
        def initialize
          @abc = 1
          super
        end
      end
    end
  end

  def func
    { bar: Bar, foo: 'foo' }
  end

  STR_CONST = 'abc'
  INT_CONST = 1
end

@donotnoot
Copy link

donotnoot commented Oct 3, 2025

Hey, this would be great. I just had to start writing Ruby at work ( 😭 ). Just a pointer, it'd be good to add singleton_method to the methods section. At least the codebase at work has loads of those.

Thank you!

@p00f
Copy link
Owner

p00f commented Oct 17, 2025

@donotnoot what's a singleton_method, can you give me an example?

@donotnoot
Copy link

@donotnoot what's a singleton_method, can you give me an example?

They're the ones that start with self., so something like this:

class Example
    def self.method
    end
end

I think. I hate dynamic typing so I don't know Ruby well, but TS marks that as a singleton_method.

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

Successfully merging this pull request may close these issues.

3 participants