Skip to content

Commit 3c39668

Browse files
committed
Remove extra parameter, access Db through semantics
1 parent 3732d15 commit 3c39668

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/ide-completion/src/completions/env_vars.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const CARGO_DEFINED_VARS: &[(&str, &str)] = &[
1818
("CARGO_PKG_NAME","The name of your package"),
1919
("CARGO_PKG_DESCRIPTION","The description from the manifest of your package"),
2020
("CARGO_PKG_HOMEPAGE","The home page from the manifest of your package"),
21-
("CARGO_PKG_REPOSITORY","The repository from the manifest of your package"),
21+
("CARGO_PKG_REPOSITORY",
22+
"The repository from the manifest of your package"),
2223
("CARGO_PKG_LICENSE","The license from the manifest of your package"),
2324
("CARGO_PKG_LICENSE_FILE","The license file from the manifest of your package"),
2425
("CARGO_PKG_RUST_VERSION","The Rust version from the manifest of your package. Note that this is the minimum Rust version supported by the package, not the current Rust version"),
@@ -33,7 +34,7 @@ pub(crate) fn complete_cargo_env_vars(
3334
ctx: &CompletionContext<'_>,
3435
expanded: &ast::String,
3536
) -> Option<()> {
36-
guard_env_macro(expanded, &ctx.sema, &ctx.db)?;
37+
guard_env_macro(expanded, &ctx.sema)?;
3738
let range = expanded.text_range_between_quotes()?;
3839

3940
CARGO_DEFINED_VARS.iter().for_each(|(var, detail)| {
@@ -48,11 +49,11 @@ pub(crate) fn complete_cargo_env_vars(
4849
fn guard_env_macro(
4950
string: &ast::String,
5051
semantics: &Semantics<'_, RootDatabase>,
51-
db: &RootDatabase,
5252
) -> Option<()> {
5353
let call = get_outer_macro(string)?;
5454
let name = call.path()?.segment()?.name_ref()?;
5555
let makro = semantics.resolve_macro_call(&call)?;
56+
let db = semantics.db;
5657

5758
match name.text().as_str() {
5859
"env" | "option_env" if makro.kind(db) == hir::MacroKind::BuiltIn => Some(()),

0 commit comments

Comments
 (0)