Add static semantic token modifier for associated functions with no &self

refactor logic into code_model.rs

address comments
This commit is contained in:
Anatol Liu 2020-11-04 20:08:46 -08:00 committed by Anatol Liu
parent 14b38e198c
commit 3aa0e40726

View File

@ -802,11 +802,7 @@ pub fn is_associated(self, db: &dyn HirDatabase) -> bool {
.and_then(|s| s.parent())
.and_then(|s| Some(s.kind()));
match fn_parent_kind {
Some(SyntaxKind::IMPL) => true,
Some(SyntaxKind::TRAIT) => true,
_ => false,
}
matches!(fn_parent_kind, Some(SyntaxKind::IMPL) | Some(SyntaxKind::TRAIT))
}
}