rubyExtractor.getVisibility — walk the previousNamedSibling chain (unbounded, through non-matching siblings); the first `call` sibling whose `method` text is private/protected/public decides; else public. Bug-for-bug: a BARE `private` line parses as identifier (invisible), and a matching call poisons every later sibling def regardless of ruby's actual arg-scoped semantics.
(&self, node: Node)
| 385 | /// and a matching call poisons every later sibling def regardless of |
| 386 | /// ruby's actual arg-scoped semantics. |
| 387 | fn visibility_of(&self, node: Node) -> u8 { |
| 388 | let mut sibling = node.prev_named_sibling(); |
| 389 | while let Some(s) = sibling { |
| 390 | if s.kind() == "call" { |
| 391 | if let Some(method) = s.child_by_field_name("method") { |
| 392 | match self.text(method) { |
| 393 | "private" => return 2, |
| 394 | "protected" => return 3, |
| 395 | "public" => return 1, |
| 396 | _ => {} |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | sibling = s.prev_named_sibling(); |
| 401 | } |
| 402 | 1 // public |
| 403 | } |
| 404 | |
| 405 | // --- the visitNode hook (languages/ruby.ts:19-76) --------------------------- |
| 406 |
no test coverage detected