A constant, or a `scope_resolution` path of constants (`A::B::C`, a top-level `::A` / `::A::B`): what Ruby reads as a constant (isRubyConstantPath).
(node: Node)
| 1156 | /// A constant, or a `scope_resolution` path of constants (`A::B::C`, a |
| 1157 | /// top-level `::A` / `::A::B`): what Ruby reads as a constant (isRubyConstantPath). |
| 1158 | fn is_constant_path(node: Node) -> bool { |
| 1159 | match node.kind() { |
| 1160 | "constant" => true, |
| 1161 | "scope_resolution" => { |
| 1162 | node.child_by_field_name("name").map_or(false, |n| n.kind() == "constant") |
| 1163 | && node.child_by_field_name("scope").map_or(true, is_constant_path) |
| 1164 | } |
| 1165 | _ => false, |
| 1166 | } |
| 1167 | } |
| 1168 | |
| 1169 | /// isRubyClassMethod (languages/ruby.ts): `def self.x` / `def Widget.x` (a |
| 1170 | /// singleton_method), or a `def` inside `class << self`. |
no outgoing calls
no test coverage detected