getVisibility: modifiers text includes public/private/protected/ internal in that order; default PUBLIC. Text-includes semantics — annotation text inside modifiers can flip it (bug-for-bug).
(&self, node: Node)
| 545 | /// internal in that order; default PUBLIC. Text-includes semantics — |
| 546 | /// annotation text inside modifiers can flip it (bug-for-bug). |
| 547 | fn visibility_of(&self, node: Node) -> u8 { |
| 548 | for i in 0..node.child_count() { |
| 549 | let Some(child) = node.child(i) else { continue }; |
| 550 | if child.kind() == "modifiers" { |
| 551 | let text = self.text(child); |
| 552 | if text.contains("public") { |
| 553 | return 1; |
| 554 | } |
| 555 | if text.contains("private") { |
| 556 | return 2; |
| 557 | } |
| 558 | if text.contains("protected") { |
| 559 | return 3; |
| 560 | } |
| 561 | if text.contains("internal") { |
| 562 | return 4; |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | 1 // Kotlin defaults to public |
| 567 | } |
| 568 | |
| 569 | /// isAsync: modifiers text includes 'suspend' (text-includes false |
| 570 | /// positive on `@suspendMarker` annotations — preserve). |
no test coverage detected