From 76c61044158ad8dc6c4c50c477e3bc12a86f5501 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 5 Jul 2019 14:35:48 -0700 Subject: [PATCH] small name refactoring --- jedi/api/__init__.py | 10 +++++----- jedi/api/helpers.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 3f9f9542..20315a0d 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -365,19 +365,19 @@ class Script(object): :rtype: list of :class:`classes.CallSignature` """ - call_signature_details = \ + call_details = \ helpers.get_call_signature_details(self._module_node, self._pos) - if call_signature_details is None: + if call_details is None: return [] context = self._evaluator.create_context( self._get_module(), - call_signature_details.bracket_leaf + call_details.bracket_leaf ) definitions = helpers.cache_call_signatures( self._evaluator, context, - call_signature_details.bracket_leaf, + call_details.bracket_leaf, self._code_lines, self._pos ) @@ -385,7 +385,7 @@ class Script(object): # TODO here we use stubs instead of the actual contexts. We should use # the signatures from stubs, but the actual contexts, probably?! - return [classes.CallSignature(self._evaluator, signature, call_signature_details) + return [classes.CallSignature(self._evaluator, signature, call_details) for signature in definitions.get_signatures()] def _analysis(self): diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index db90b72b..aa1358d2 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -159,8 +159,8 @@ def evaluate_goto_definition(evaluator, context, leaf): return definitions -CallSignatureDetails = namedtuple( - 'CallSignatureDetails', +CallDetails = namedtuple( + 'CallDetails', ['bracket_leaf', 'call_index', 'keyword_name_str'] ) @@ -198,7 +198,7 @@ def _get_call_signature_details_from_error_node(node, position): if name is None: continue if name.type == 'name' or name.parent.type in ('trailer', 'atom'): - return CallSignatureDetails( + return CallDetails( element, *_get_index_and_key(children, position) ) @@ -235,7 +235,7 @@ def get_call_signature_details(module, position): leaf = node.get_previous_leaf() if leaf is None: return None - return CallSignatureDetails( + return CallDetails( node.children[0], *_get_index_and_key(node.children, position)) node = node.parent