From 9cb92af986b2149a7a61142a3612f1dba926b001 Mon Sep 17 00:00:00 2001 From: Andy Waite <13400+andyw8@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:53:16 -0400 Subject: [PATCH] Update argument order for CodeLens initializer (#1024) Update argument order for CodeLens Co-authored-by: Andy Waite --- lib/ruby_lsp/executor.rb | 2 +- lib/ruby_lsp/requests/code_lens.rb | 4 ++-- test/requests/code_lens_expectations_test.rb | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ruby_lsp/executor.rb b/lib/ruby_lsp/executor.rb index 2e2d9a9c7..69961094e 100644 --- a/lib/ruby_lsp/executor.rb +++ b/lib/ruby_lsp/executor.rb @@ -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) diff --git a/lib/ruby_lsp/requests/code_lens.rb b/lib/ruby_lsp/requests/code_lens.rb index 7c3a3f21d..b60c7b2db 100644 --- a/lib/ruby_lsp/requests/code_lens.rb +++ b/lib/ruby_lsp/requests/code_lens.rb @@ -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) diff --git a/test/requests/code_lens_expectations_test.rb b/test/requests/code_lens_expectations_test.rb index 539b16a80..04094515a 100644 --- a/test/requests/code_lens_expectations_test.rb +++ b/test/requests/code_lens_expectations_test.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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