File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ fn locate_help_node(tree: &Tree, point: Point) -> Option<Node> {
89
89
// Even if they are at `p<>kg::fun`, we assume they really want docs for `fun`.
90
90
let node = match node. parent ( ) {
91
91
Some ( parent) if matches ! ( parent. node_type( ) , NodeType :: NamespaceOperator ( _) ) => parent,
92
+ Some ( parent) if matches ! ( parent. node_type( ) , NodeType :: ExtractOperator ( _) ) => parent,
92
93
Some ( _) => node,
93
94
None => node,
94
95
} ;
@@ -138,5 +139,12 @@ mod tests {
138
139
let node = locate_help_node ( & tree, point) . unwrap ( ) ;
139
140
let text = node. utf8_text ( text. as_bytes ( ) ) . unwrap ( ) ;
140
141
assert_eq ! ( text, "dplyr:::across" ) ;
142
+
143
+ // R6 methods, or reticulate accessors
144
+ let ( text, point) = point_from_cursor ( "tf$a@bs(x)" ) ;
145
+ let tree = parser. parse ( text. as_str ( ) , None ) . unwrap ( ) ;
146
+ let node = locate_help_node ( & tree, point) . unwrap ( ) ;
147
+ let text = node. utf8_text ( text. as_bytes ( ) ) . unwrap ( ) ;
148
+ assert_eq ! ( text, "tf$abs" ) ;
141
149
}
142
150
}
You can’t perform that action at this time.
0 commit comments