* 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)
| 332 | * a value (`obj::Thing`, `self.class::LIMIT`) is not one. |
| 333 | */ |
| 334 | function isRubyConstantPath(node: SyntaxNode): boolean { |
| 335 | if (node.type === 'constant') return true; |
| 336 | if (node.type !== 'scope_resolution') return false; |
| 337 | const scope = getChildByField(node, 'scope'); |
| 338 | return getChildByField(node, 'name')?.type === 'constant' && (!scope || isRubyConstantPath(scope)); |
| 339 | } |
| 340 | |
| 341 | /** |
| 342 | * The class a Ruby call receiver constructs, as written: `Foo` for |
no test coverage detected