Skip to content

Commit

Permalink
Update argument order for CodeLens
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Sep 19, 2023
1 parent 0677c87 commit e377bcf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run(request)
folding_range = Requests::FoldingRanges.new(document.parse_result.comments, emitter, @message_queue)
document_symbol = Requests::DocumentSymbol.new(emitter, @message_queue)
document_link = Requests::DocumentLink.new(uri, document.comments, emitter, @message_queue)
code_lens = Requests::CodeLens.new(uri, emitter, @message_queue, @test_library)
code_lens = Requests::CodeLens.new(uri, @test_library, emitter, @message_queue)

semantic_highlighting = Requests::SemanticHighlighting.new(emitter, @message_queue)
emitter.visit(document.tree)
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_lsp/requests/code_lens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class CodeLens < ExtensibleListener
sig { override.returns(ResponseType) }
attr_reader :_response

sig { params(uri: URI::Generic, emitter: EventEmitter, message_queue: Thread::Queue, test_library: String).void }
def initialize(uri, emitter, message_queue, test_library)
sig { params(uri: URI::Generic, test_library: String, emitter: EventEmitter, message_queue: Thread::Queue).void }
def initialize(uri, test_library, emitter, message_queue)
@uri = T.let(uri, URI::Generic)
@test_library = T.let(test_library, String)
@_response = T.let([], ResponseType)
Expand Down
10 changes: 5 additions & 5 deletions test/requests/code_lens_expectations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def run_expectations(source)
document = RubyLsp::Document.new(source: source, version: 1, uri: uri)

emitter = RubyLsp::EventEmitter.new
listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "minitest")
listener = RubyLsp::Requests::CodeLens.new(uri, "minitest", emitter, @message_queue)
emitter.visit(document.tree)
listener.response
end
Expand All @@ -28,7 +28,7 @@ def test_bar; end
document = RubyLsp::Document.new(source: source, version: 1, uri: uri)

emitter = RubyLsp::EventEmitter.new
listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "test-unit")
listener = RubyLsp::Requests::CodeLens.new(uri, "test-unit", emitter, @message_queue)
emitter.visit(document.tree)
response = listener.response

Expand All @@ -54,7 +54,7 @@ def test_bar; end
document = RubyLsp::Document.new(source: source, version: 1, uri: uri)

emitter = RubyLsp::EventEmitter.new
listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "unknown")
listener = RubyLsp::Requests::CodeLens.new(uri, "unknown", emitter, @message_queue)
emitter.visit(document.tree)
response = listener.response

Expand All @@ -72,7 +72,7 @@ def test_bar; end
document = RubyLsp::Document.new(source: source, version: 1, uri: uri)

emitter = RubyLsp::EventEmitter.new
listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "rspec")
listener = RubyLsp::Requests::CodeLens.new(uri, "rspec", emitter, @message_queue)
emitter.visit(document.tree)
response = listener.response

Expand All @@ -90,7 +90,7 @@ def test_bar; end
document = RubyLsp::Document.new(source: source, version: 1, uri: uri)

emitter = RubyLsp::EventEmitter.new
listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "minitest")
listener = RubyLsp::Requests::CodeLens.new(uri, "minitest", emitter, @message_queue)
emitter.visit(document.tree)
response = listener.response

Expand Down

0 comments on commit e377bcf

Please sign in to comment.