Skip to content

Commit bac30de

Browse files
committed
Clippy, improved R project detection
1 parent c12954e commit bac30de

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

crates/plugins/python3/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

crates/plugins/r/src/plugin.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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? {

0 commit comments

Comments
 (0)