aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-01-08 11:28:02 +0000
committerLukas Wirth <[email protected]>2021-01-10 11:33:47 +0000
commitb795128dde24cd3c4ec45879b354ec8c60fc751b (patch)
treee2898ec9ce50089f1ce269bc1ed34ad1a92fea51 /crates/ide/src/syntax_highlighting
parent6a0a47dd1492975959f6719202c3fb175df0349c (diff)
Use hir::GenericParam in ide_db::Definition instead of relisting all 3
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 1a88975d2..20eccf3c6 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -328,8 +328,11 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
328 } 328 }
329 }, 329 },
330 Definition::SelfType(_) => HlTag::Symbol(SymbolKind::Impl), 330 Definition::SelfType(_) => HlTag::Symbol(SymbolKind::Impl),
331 Definition::TypeParam(_) => HlTag::Symbol(SymbolKind::TypeParam), 331 Definition::GenericParam(it) => match it {
332 Definition::ConstParam(_) => HlTag::Symbol(SymbolKind::ConstParam), 332 hir::GenericParam::TypeParam(_) => HlTag::Symbol(SymbolKind::TypeParam),
333 hir::GenericParam::ConstParam(_) => HlTag::Symbol(SymbolKind::ConstParam),
334 hir::GenericParam::LifetimeParam(_) => HlTag::Symbol(SymbolKind::LifetimeParam),
335 },
333 Definition::Local(local) => { 336 Definition::Local(local) => {
334 let tag = if local.is_param(db) { 337 let tag = if local.is_param(db) {
335 HlTag::Symbol(SymbolKind::ValueParam) 338 HlTag::Symbol(SymbolKind::ValueParam)
@@ -345,7 +348,6 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
345 } 348 }
346 return h; 349 return h;
347 } 350 }
348 Definition::LifetimeParam(_) => HlTag::Symbol(SymbolKind::LifetimeParam),
349 Definition::Label(_) => HlTag::Symbol(SymbolKind::Label), 351 Definition::Label(_) => HlTag::Symbol(SymbolKind::Label),
350 } 352 }
351 .into() 353 .into()