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)
| 359 | /// and a matching call poisons every later sibling def regardless of |
| 360 | /// ruby's actual arg-scoped semantics. |
| 361 | fn visibility_of(&self, node: Node) -> u8 { |
| 362 | let mut sibling = node.prev_named_sibling(); |
| 363 | while let Some(s) = sibling { |
| 364 | if s.kind() == "call" { |
| 365 | if let Some(method) = s.child_by_field_name("method") { |
| 366 | match self.text(method) { |
| 367 | "private" => return 2, |
| 368 | "protected" => return 3, |
| 369 | "public" => return 1, |
| 370 | _ => {} |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | sibling = s.prev_named_sibling(); |
| 375 | } |
| 376 | 1 // public |
| 377 | } |
| 378 | |
| 379 | // --- the visitNode hook (languages/ruby.ts:19-76) --------------------------- |
| 380 |
no test coverage detected