diff --git a/test/requests/path_completion_test.rb b/test/requests/path_completion_test.rb index efc6fb3ab..2ee5807d8 100644 --- a/test/requests/path_completion_test.rb +++ b/test/requests/path_completion_test.rb @@ -33,7 +33,6 @@ def test_completion_command result = with_file_structure do @store = RubyLsp::Store.new @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -70,7 +69,6 @@ def test_completion_call result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -107,7 +105,6 @@ def test_completion_command_call result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -144,7 +141,6 @@ def test_completion_with_partial_path result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -173,7 +169,6 @@ def foo } @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -191,7 +186,6 @@ def test_completion_is_not_triggered_if_argument_is_not_a_string } @store.set(uri: @uri, source: document.source, version: 1) - @executor = RubyLsp::Executor.new(@store, @message_queue) result = run_request( method: "textDocument/completion", params: { textDocument: { uri: @uri.to_s }, position: end_position }, @@ -202,6 +196,7 @@ def test_completion_is_not_triggered_if_argument_is_not_a_string private def run_request(method:, params: {}) + @executor = RubyLsp::Executor.new(@store, @message_queue) result = @executor.execute({ method: method, params: params }) error = result.error raise error if error