* A Ruby constant, or a `scope_resolution` path of constants (`A::B::C`, a * top-level `::A` / `::A::B`): what Ruby reads as a constant. A path through * a value (`obj::Thing`, `self.class::LIMIT`) is not one.
(node: SyntaxNode)
| 327 | * a value (`obj::Thing`, `self.class::LIMIT`) is not one. |
| 328 | */ |
| 329 | function isRubyConstantPath(node: SyntaxNode): boolean { |
| 330 | if (node.type === 'constant') return true; |
| 331 | if (node.type !== 'scope_resolution') return false; |
| 332 | const scope = getChildByField(node, 'scope'); |
| 333 | return getChildByField(node, 'name')?.type === 'constant' && (!scope || isRubyConstantPath(scope)); |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * The class a Ruby call receiver constructs, as written: `Foo` for |
no test coverage detected