diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-10 00:16:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-10 00:16:58 +0100 |
commit | 7a03f05eac4ff1e9ca4ceeced54ce06892bd30b8 (patch) | |
tree | 2a8074952398d7d72d8a83ddda35785c4821e20b /crates/ra_ide/src/syntax_highlighting.rs | |
parent | b1cb4ac13d5b625dd497692b6396287a30ff12e2 (diff) | |
parent | bf9b4578bbe038501ef7c337e22b448de477f61c (diff) |
Merge #5692
5692: Add support for extern crate r=jonas-schievink a=Nashenas88
This adds syntax highlighting, hover and goto def functionality for extern crate.
Fixes #5690
Co-authored-by: Paul Daniel Faria <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index f71b804fe..6b7874460 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -495,6 +495,7 @@ fn highlight_element( | |||
495 | }; | 495 | }; |
496 | 496 | ||
497 | match name_kind { | 497 | match name_kind { |
498 | Some(NameClass::ExternCrate(_)) => HighlightTag::Module.into(), | ||
498 | Some(NameClass::Definition(def)) => { | 499 | Some(NameClass::Definition(def)) => { |
499 | highlight_name(db, def, false) | HighlightModifier::Definition | 500 | highlight_name(db, def, false) | HighlightModifier::Definition |
500 | } | 501 | } |
@@ -522,6 +523,7 @@ fn highlight_element( | |||
522 | let possibly_unsafe = is_possibly_unsafe(&name_ref); | 523 | let possibly_unsafe = is_possibly_unsafe(&name_ref); |
523 | match classify_name_ref(sema, &name_ref) { | 524 | match classify_name_ref(sema, &name_ref) { |
524 | Some(name_kind) => match name_kind { | 525 | Some(name_kind) => match name_kind { |
526 | NameRefClass::ExternCrate(_) => HighlightTag::Module.into(), | ||
525 | NameRefClass::Definition(def) => { | 527 | NameRefClass::Definition(def) => { |
526 | if let Definition::Local(local) = &def { | 528 | if let Definition::Local(local) = &def { |
527 | if let Some(name) = local.name(db) { | 529 | if let Some(name) = local.name(db) { |