rubyConstructedClass (tree-sitter.ts): the class a call receiver constructs, as written — `Foo` for `Foo.new(key)`, `Billing::Card` for `Billing::Card.new`, `::Foo` for `::Foo.new`; None for any other receiver, a `new` on a value (`klass.new`) among them.
(&self, receiver: Node)
| 217 | /// `Billing::Card.new`, `::Foo` for `::Foo.new`; None for any other |
| 218 | /// receiver, a `new` on a value (`klass.new`) among them. |
| 219 | fn constructed_class(&self, receiver: Node) -> Option<&'t str> { |
| 220 | if receiver.kind() != "call" { |
| 221 | return None; |
| 222 | } |
| 223 | let method = receiver.child_by_field_name("method")?; |
| 224 | let made = receiver.child_by_field_name("receiver")?; |
| 225 | if self.text(method) != "new" || !is_constant_path(made) { |
| 226 | return None; |
| 227 | } |
| 228 | Some(self.text(made)) |
| 229 | } |
| 230 | fn line_of(&self, node: Node) -> u32 { |
| 231 | node.start_position().row as u32 + 1 |
| 232 | } |
no test coverage detected