diff --git a/lib/ruby_lsp/ruby_lsp_rails/code_lens.rb b/lib/ruby_lsp/ruby_lsp_rails/code_lens.rb index 0995353a..d71639d9 100644 --- a/lib/ruby_lsp/ruby_lsp_rails/code_lens.rb +++ b/lib/ruby_lsp/ruby_lsp_rails/code_lens.rb @@ -40,11 +40,11 @@ class CodeLens < ::RubyLsp::Listener BASE_COMMAND = "bin/rails test" sig { override.returns(ResponseType) } - attr_reader :response + attr_reader :_response sig { params(uri: URI::Generic, emitter: EventEmitter, message_queue: Thread::Queue).void } def initialize(uri, emitter, message_queue) - @response = T.let([], ResponseType) + @_response = T.let([], ResponseType) @path = T.let(uri.to_standardized_path, T.nilable(String)) emitter.register(self, :on_command, :on_class, :on_def) @@ -121,7 +121,7 @@ def add_test_code_lens(node, name:, command:, kind:) }, ] - @response << create_code_lens( + @_response << create_code_lens( node, title: "Run", command_name: "rubyLsp.runTest", @@ -129,7 +129,7 @@ def add_test_code_lens(node, name:, command:, kind:) data: { type: "test", kind: kind }, ) - @response << create_code_lens( + @_response << create_code_lens( node, title: "Run In Terminal", command_name: "rubyLsp.runTestInTerminal", @@ -137,7 +137,7 @@ def add_test_code_lens(node, name:, command:, kind:) data: { type: "test_in_terminal", kind: kind }, ) - @response << create_code_lens( + @_response << create_code_lens( node, title: "Debug", command_name: "rubyLsp.debugTest", diff --git a/lib/ruby_lsp/ruby_lsp_rails/hover.rb b/lib/ruby_lsp/ruby_lsp_rails/hover.rb index b4f7f95b..41a609eb 100644 --- a/lib/ruby_lsp/ruby_lsp_rails/hover.rb +++ b/lib/ruby_lsp/ruby_lsp_rails/hover.rb @@ -23,13 +23,13 @@ class Hover < ::RubyLsp::Listener ResponseType = type_member { { fixed: T.nilable(::RubyLsp::Interface::Hover) } } sig { override.returns(ResponseType) } - attr_reader :response + attr_reader :_response sig { params(client: RailsClient, emitter: RubyLsp::EventEmitter, message_queue: Thread::Queue).void } def initialize(client, emitter, message_queue) super(emitter, message_queue) - @response = T.let(nil, ResponseType) + @_response = T.let(nil, ResponseType) @client = client emitter.register(self, :on_const, :on_command, :on_const_path_ref, :on_call) end @@ -46,18 +46,18 @@ def on_const(node) end content << model[:columns].map { |name, type| "**#{name}**: #{type}\n" }.join("\n") contents = RubyLsp::Interface::MarkupContent.new(kind: "markdown", value: content) - @response = RubyLsp::Interface::Hover.new(range: range_from_syntax_tree_node(node), contents: contents) + @_response = RubyLsp::Interface::Hover.new(range: range_from_syntax_tree_node(node), contents: contents) end sig { params(node: SyntaxTree::Command).void } def on_command(node) message = node.message - @response = generate_rails_document_link_hover(message.value, message) + @_response = generate_rails_document_link_hover(message.value, message) end sig { params(node: SyntaxTree::ConstPathRef).void } def on_const_path_ref(node) - @response = generate_rails_document_link_hover(full_constant_name(node), node) + @_response = generate_rails_document_link_hover(full_constant_name(node), node) end sig { params(node: SyntaxTree::CallNode).void } @@ -65,7 +65,7 @@ def on_call(node) message = node.message return if message.is_a?(Symbol) - @response = generate_rails_document_link_hover(message.value, message) + @_response = generate_rails_document_link_hover(message.value, message) end private