1
0
forked from VimPlug/jedi

Merge branch 'master' into refactor

This commit is contained in:
Dave Halter
2020-03-13 23:53:09 +01:00
29 changed files with 331 additions and 54 deletions

View File

@@ -484,6 +484,11 @@ class DirectObjectAccess(object):
def needs_type_completions(self):
return inspect.isclass(self._obj) and self._obj != type
def _annotation_to_str(self, annotation):
if isinstance(annotation, type):
return str(annotation.__name__)
return str(annotation)
def get_signature_params(self):
return [
SignatureParam(
@@ -493,7 +498,7 @@ class DirectObjectAccess(object):
default_string=repr(p.default),
has_annotation=p.annotation is not p.empty,
annotation=self._create_access_path(p.annotation),
annotation_string=str(p.annotation),
annotation_string=self._annotation_to_str(p.annotation),
kind_name=str(p.kind)
) for p in self._get_signature().parameters.values()
]