From 814d617d348c23507fd444e58515c9bff6b73105 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 9 Mar 2021 16:33:41 +0100 Subject: Show whether a binding is mutable or not on hover --- crates/ide/src/syntax_highlighting/highlight.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ide/src/syntax_highlighting') diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 24fcbb584..b0cfdd8b7 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -330,10 +330,11 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight { HlTag::Symbol(SymbolKind::Local) }; let mut h = Highlight::new(tag); - if local.is_mut(db) || local.ty(db).is_mutable_reference() { + let ty = local.ty(db); + if local.is_mut(db) || ty.is_mutable_reference() { h |= HlMod::Mutable; } - if local.ty(db).as_callable(db).is_some() || local.ty(db).impls_fnonce(db) { + if ty.as_callable(db).is_some() || ty.impls_fnonce(db) { h |= HlMod::Callable; } return h; -- cgit v1.2.3