Skip to content

Commit 108c504

Browse files
committed
Avoid mutating nodes in full_constant_name
1 parent 558a598 commit 108c504

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ruby_lsp/requests/support/common.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def range_from_syntax_tree_node(node)
2626
params(node: T.any(SyntaxTree::ConstPathRef, SyntaxTree::ConstRef, SyntaxTree::TopConstRef)).returns(String)
2727
end
2828
def full_constant_name(node)
29-
name = +node.constant.value
29+
name = node.constant.value.dup
3030
constant = T.let(node, SyntaxTree::Node)
3131

3232
while constant.is_a?(SyntaxTree::ConstPathRef)

0 commit comments

Comments
 (0)