mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
get_param -> get_executed_param_name
This commit is contained in:
@@ -290,7 +290,7 @@ class TreeArguments(AbstractArguments):
|
|||||||
break
|
break
|
||||||
if not isinstance(names[0], ParamName):
|
if not isinstance(names[0], ParamName):
|
||||||
break
|
break
|
||||||
param = names[0].get_param()
|
param = names[0].get_executed_param_name()
|
||||||
if isinstance(param, DynamicExecutedParamName):
|
if isinstance(param, DynamicExecutedParamName):
|
||||||
# For dynamic searches we don't even want to see errors.
|
# For dynamic searches we don't even want to see errors.
|
||||||
return []
|
return []
|
||||||
|
|||||||
@@ -207,10 +207,15 @@ class ParamNameInterface(_ParamMixin):
|
|||||||
def to_string(self):
|
def to_string(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def get_param(self):
|
def get_executed_param_name(self):
|
||||||
# TODO document better where this is used and when. Currently it has
|
"""
|
||||||
# very limited use, but is still in use. It's currently not even
|
For dealing with type inference and working around the graph, we
|
||||||
# clear what values would be allowed.
|
sometimes want to have the param name of the execution. This feels a
|
||||||
|
bit strange and we might have to refactor at some point.
|
||||||
|
|
||||||
|
For now however it exists to avoid infering params when we don't really
|
||||||
|
need them (e.g. when we can just instead use annotations.
|
||||||
|
"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -310,9 +315,9 @@ class ParamName(BaseTreeParamName):
|
|||||||
if doc_params:
|
if doc_params:
|
||||||
return doc_params
|
return doc_params
|
||||||
|
|
||||||
return self.get_param().infer()
|
return self.get_executed_param_name().infer()
|
||||||
|
|
||||||
def get_param(self):
|
def get_executed_param_name(self):
|
||||||
params_names, _ = self.parent_context.get_executed_param_names_and_issues()
|
params_names, _ = self.parent_context.get_executed_param_names_and_issues()
|
||||||
return params_names[self._get_param_node().position_index]
|
return params_names[self._get_param_node().position_index]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user