Skip to content

Commit 9016fb5

Browse files
committed
Rename bulk_imports to package_imports
1 parent d5ea6a9 commit 9016fb5

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/ark/src/lsp/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ foo
16001600
let namespace = Namespace {
16011601
exports: vec!["foo".to_string(), "bar".to_string()],
16021602
imports: vec![],
1603-
bulk_imports: vec![],
1603+
package_imports: vec![],
16041604
};
16051605
let description = Description {
16061606
name: "mockpkg".to_string(),
@@ -1700,7 +1700,7 @@ foo
17001700
let namespace1 = Namespace {
17011701
exports: vec!["foo".to_string(), "bar".to_string()],
17021702
imports: vec![],
1703-
bulk_imports: vec![],
1703+
package_imports: vec![],
17041704
};
17051705
let description1 = Description {
17061706
name: "pkg1".to_string(),
@@ -1718,7 +1718,7 @@ foo
17181718
let namespace2 = Namespace {
17191719
exports: vec!["bar".to_string(), "baz".to_string()],
17201720
imports: vec![],
1721-
bulk_imports: vec![],
1721+
package_imports: vec![],
17221722
};
17231723
let description2 = Description {
17241724
name: "pkg2".to_string(),
@@ -1778,7 +1778,7 @@ foo
17781778
let namespace = Namespace {
17791779
exports: vec!["foo".to_string(), "bar".to_string()],
17801780
imports: vec![],
1781-
bulk_imports: vec![],
1781+
package_imports: vec![],
17821782
};
17831783
let description = Description {
17841784
name: "pkg".to_string(),

crates/ark/src/lsp/inputs/package_namespace.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct Namespace {
1616
/// Names of objects imported with `importFrom()`
1717
pub imports: Vec<String>,
1818
/// Names of packages bulk-imported with `import()`
19-
pub bulk_imports: Vec<String>,
19+
pub package_imports: Vec<String>,
2020
}
2121

2222
impl Namespace {
@@ -69,13 +69,13 @@ impl Namespace {
6969
imports.push(symbol);
7070
}
7171

72-
let mut bulk_imports = Vec::new();
72+
let mut package_imports = Vec::new();
7373
for capture in ts_query.captures_for(root_node, "bulk_imported", contents.as_bytes()) {
7474
let symbol = capture
7575
.utf8_text(contents.as_bytes())
7676
.unwrap_or("")
7777
.to_string();
78-
bulk_imports.push(symbol);
78+
package_imports.push(symbol);
7979
}
8080

8181
// Take unique values of imports and exports. In the future we'll lint
@@ -84,13 +84,13 @@ impl Namespace {
8484
exports.dedup();
8585
imports.sort();
8686
imports.dedup();
87-
bulk_imports.sort();
88-
bulk_imports.dedup();
87+
package_imports.sort();
88+
package_imports.dedup();
8989

9090
Ok(Namespace {
9191
imports,
9292
exports,
93-
bulk_imports,
93+
package_imports,
9494
})
9595
}
9696

@@ -152,7 +152,7 @@ mod tests {
152152
importFrom(stats, median)
153153
"#;
154154
let parsed = Namespace::parse(ns).unwrap();
155-
assert_eq!(parsed.bulk_imports, vec!["rlang", "utils"]);
155+
assert_eq!(parsed.package_imports, vec!["rlang", "utils"]);
156156
assert_eq!(parsed.exports, vec!["foo"]);
157157
assert_eq!(parsed.imports, vec!["median"]);
158158
}

0 commit comments

Comments
 (0)