Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ChallaHalla committed Nov 15, 2024
1 parent 2498021 commit dc545c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/ruby_lsp_rails/addon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def create_definition_listener(response_builder, uri, node_context, dispatcher)
end

sig do
params(
override.params(
response_builder: ResponseBuilders::CollectionResponseBuilder[Interface::CompletionItem],
node_context: NodeContext,
dispatcher: Prism::Dispatcher,
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_lsp/ruby_lsp_rails/completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ def on_call_node_enter(node)

sig { params(node: Prism::CallNode).void }
def handle_active_record_where_completions(node)
resolved_class = @client.model(@node_context.call_node.receiver&.name)
resolved_class = @client.model(T.must(@node_context.call_node).receiver&.name)
return if resolved_class.nil?

resolved_class[:columns].each do |column|
@response_builder << Interface::CompletionItem.new(
label: column[0],
filter_text: column[0],
label_details: Interface::CompletionItemLabelDetails.new(
description: "Filter #{@node_context.call_node.receiver.name} records by #{column[0]}",
description: "Filter #{T.must(@node_context.call_node).receiver.name} records by #{column[0]}",
),
text_edit: Interface::TextEdit.new(range: 0, new_text: "#{column[0]}:"),
kind: Constant::CompletionItemKind::FIELD,
Expand Down

0 comments on commit dc545c4

Please sign in to comment.