lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.14.5 vs lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.14.6
- old
+ new
@@ -145,9 +145,18 @@
def constant_name(node)
node.full_name
rescue Prism::ConstantPathNode::DynamicPartsInConstantPathError
nil
end
+
+ sig { params(node: T.any(Prism::ModuleNode, Prism::ClassNode)).returns(T.nilable(String)) }
+ def namespace_constant_name(node)
+ path = node.constant_path
+ case path
+ when Prism::ConstantPathNode, Prism::ConstantReadNode, Prism::ConstantPathTargetNode
+ constant_name(path)
+ end
+ end
end
end
end
end