mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Highlight foreign modules as such
This commit is contained in:
parent
c32428571c
commit
b4cddc0705
1 changed files with 9 additions and 1 deletions
|
@ -303,7 +303,15 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
|
|||
return h;
|
||||
}
|
||||
Definition::ModuleDef(def) => match def {
|
||||
hir::ModuleDef::Module(_) => HlTag::Symbol(SymbolKind::Module),
|
||||
hir::ModuleDef::Module(module) => {
|
||||
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Module));
|
||||
|
||||
if Some(module.krate()) != krate {
|
||||
h |= HlMod::Foreign;
|
||||
}
|
||||
|
||||
return h;
|
||||
}
|
||||
hir::ModuleDef::Function(func) => {
|
||||
let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Function));
|
||||
if let Some(item) = func.as_assoc_item(db) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue