File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ impl LanguagePlugin for Python3Plugin {
384384 {
385385 // check if the parent is src and return src's parent dir if so
386386 if let Some ( parent) = file_path. parent ( ) {
387- if let Some ( parent) = path_util:: get_parent_of_named ( & parent, "src" ) {
387+ if let Some ( parent) = path_util:: get_parent_of_named ( parent, "src" ) {
388388 return Ok ( Break ( Some ( parent) ) ) ;
389389 }
390390 }
Original file line number Diff line number Diff line change @@ -129,6 +129,15 @@ impl LanguagePlugin for RPlugin {
129129 if let Some ( parent) = path_util:: get_parent_of_component_in_path ( & file_path, "R" ) {
130130 return Ok ( Break ( Some ( parent) ) ) ;
131131 }
132+ if let Some ( parent) =
133+ path_util:: get_parent_of_component_in_path ( & file_path, "testthat" )
134+ {
135+ if let Some ( parent) = parent. parent ( ) {
136+ if parent. ends_with ( "tests" ) {
137+ return Ok ( Break ( Some ( parent. to_path_buf ( ) ) ) ) ;
138+ }
139+ }
140+ }
132141 Ok ( Continue ( ( ) ) )
133142 } ) ;
134143 match next? {
You can’t perform that action at this time.
0 commit comments