Refactor: extract method which convert a jedi.api_classes.Definition.type to a QIcon