From 6cde0b1aa0f6b8623c6b81b2396f4a0345891233 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Sat, 8 Aug 2020 14:14:18 -0400 Subject: Add support for extern crate This adds syntax highlighting, hover and goto def functionality for extern crate --- crates/ra_assists/src/handlers/add_turbo_fish.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src/handlers') diff --git a/crates/ra_assists/src/handlers/add_turbo_fish.rs b/crates/ra_assists/src/handlers/add_turbo_fish.rs index 0c565e89a..537322a72 100644 --- a/crates/ra_assists/src/handlers/add_turbo_fish.rs +++ b/crates/ra_assists/src/handlers/add_turbo_fish.rs @@ -41,7 +41,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<( let name_ref = ast::NameRef::cast(ident.parent())?; let def = match classify_name_ref(&ctx.sema, &name_ref)? { NameRefClass::Definition(def) => def, - NameRefClass::FieldShorthand { .. } => return None, + NameRefClass::ExternCrate(_) | NameRefClass::FieldShorthand { .. } => return None, }; let fun = match def { Definition::ModuleDef(hir::ModuleDef::Function(it)) => it, -- cgit v1.2.3