ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Explore adding meta-programming previews

Open vinistock opened this issue 3 years ago • 0 comments

It would help developers to better visualize meta-programming, if we could somehow provide a preview of what the result is going to be. Something like

class Foo
  ["bar", "baz", "bat"]. each do |name|
    # Meta-programming preview
    # def name
    #  process(name).to_sym
    # end
    define_method(name) { process(name).to_sym }
  end

  def process(string)
    # ...
  end
end

This could either be a part of inlay hints or a custom request, depending on how the visualization happens.

vinistock avatar Jul 15 '22 19:07 vinistock