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

Investigate merging requests

Open vinistock opened this issue 3 years ago • 0 comments

After #238 is in place, it is possible to execute more than one request at the same time if we know they are in the queue. That is, if we have a foldingRange and a documentSymbol request sitting in the queue, we could collect the information about both in a single tree visit.

Investigate the possibility of combining visitors to return multiple responses from the server at once.

One idea: could we have a mechanism for combining visitors?

class CombinedVisitor
  def initialize(*visitors)
    @visitors = visitors
  end

  def visit_class(node)
    @visitors.each { |v| v.visit_class(node) }
  end

  ...
end

vinistock avatar Aug 11 '22 20:08 vinistock