Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Aug 15, 2023
1 parent b575108 commit c26a3a2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions test/requests/path_completion_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand All @@ -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 },
Expand All @@ -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
Expand Down

0 comments on commit c26a3a2

Please sign in to comment.