diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-09 16:23:51 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-09 16:23:51 +0000 |
commit | c45ac6effe37562daa97e6675c54963252f65664 (patch) | |
tree | 9f00979cde7fa508ab0b583fa0deeaa79236b7db /crates/ide/src/syntax_highlighting | |
parent | c2359608c926d4828f2b112e7069978449851d58 (diff) | |
parent | 814d617d348c23507fd444e58515c9bff6b73105 (diff) |
Merge #7942
7942: Show whether a binding is mutable or not on hover r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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 { | |||
330 | HlTag::Symbol(SymbolKind::Local) | 330 | HlTag::Symbol(SymbolKind::Local) |
331 | }; | 331 | }; |
332 | let mut h = Highlight::new(tag); | 332 | let mut h = Highlight::new(tag); |
333 | if local.is_mut(db) || local.ty(db).is_mutable_reference() { | 333 | let ty = local.ty(db); |
334 | if local.is_mut(db) || ty.is_mutable_reference() { | ||
334 | h |= HlMod::Mutable; | 335 | h |= HlMod::Mutable; |
335 | } | 336 | } |
336 | if local.ty(db).as_callable(db).is_some() || local.ty(db).impls_fnonce(db) { | 337 | if ty.as_callable(db).is_some() || ty.impls_fnonce(db) { |
337 | h |= HlMod::Callable; | 338 | h |= HlMod::Callable; |
338 | } | 339 | } |
339 | return h; | 340 | return h; |