Skip to content

Commit

Permalink
Keep #visit_ methods consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmaples committed Mar 30, 2022
1 parent 36dc9c7 commit 73d376f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/ruby_lsp/requests/semantic_highlighting.rb
Expand Up @@ -31,12 +31,7 @@ def run
private

def visit_assign(node)
case node.target
when SyntaxTree::ARefField
add_token(node.target.collection.value.location, :local_variable)
else
add_token(node.target.value.location, :local_variable)
end
super
end

def visit_m_assign(node)
Expand All @@ -53,6 +48,10 @@ def visit_var_ref(node)
add_token(node.value.location, :local_variable)
end

def visit_a_ref_field(node)
add_token(node.target.collection.value.location, :local_variable)
end

def visit_call(node)
super
add_token(node.message.location, :method_call)
Expand Down

0 comments on commit 73d376f

Please sign in to comment.