forked from VimPlug/jedi
Remove FakeName since it's not actually used anymore.
This commit is contained in:
@@ -10,8 +10,6 @@ from functools import partial
|
||||
from jedi._compatibility import builtins as _builtins, unicode
|
||||
from jedi import debug
|
||||
from jedi.cache import underscore_memoization, memoize_method
|
||||
from jedi.parser.python.tree import Param, Operator
|
||||
from jedi.evaluate.helpers import FakeName
|
||||
from jedi.evaluate.filters import AbstractFilter, AbstractNameDefinition, \
|
||||
ContextNameMixin
|
||||
from jedi.evaluate.context import Context, LazyKnownContext
|
||||
@@ -97,21 +95,6 @@ class CompiledObject(Context):
|
||||
def py__doc__(self, include_call_signature=False):
|
||||
return inspect.getdoc(self.obj) or ''
|
||||
|
||||
@property
|
||||
def get_params(self):
|
||||
return [] # TODO Fix me.
|
||||
params_str, ret = self._parse_function_doc()
|
||||
tokens = params_str.split(',')
|
||||
if inspect.ismethoddescriptor(self.obj):
|
||||
tokens.insert(0, 'self')
|
||||
params = []
|
||||
for p in tokens:
|
||||
parts = [FakeName(part) for part in p.strip().split('=')]
|
||||
if len(parts) > 1:
|
||||
parts.insert(1, Operator('=', (0, 0)))
|
||||
params.append(Param(parts, self))
|
||||
return params
|
||||
|
||||
def get_param_names(self):
|
||||
params_str, ret = self._parse_function_doc()
|
||||
tokens = params_str.split(',')
|
||||
@@ -119,8 +102,6 @@ class CompiledObject(Context):
|
||||
tokens.insert(0, 'self')
|
||||
for p in tokens:
|
||||
parts = p.strip().split('=')
|
||||
if len(parts) > 1:
|
||||
parts.insert(1, Operator('=', (0, 0)))
|
||||
yield UnresolvableParamName(self, parts[0])
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -147,26 +147,6 @@ def get_module_names(module, all_scopes):
|
||||
return names
|
||||
|
||||
|
||||
class FakeName(tree.Name):
|
||||
def __init__(self, name_str, parent=None, start_pos=(0, 0), is_definition=None):
|
||||
"""
|
||||
In case is_definition is defined (not None), that bool value will be
|
||||
returned.
|
||||
"""
|
||||
super(FakeName, self).__init__(name_str, start_pos)
|
||||
self.parent = parent
|
||||
self._is_definition = is_definition
|
||||
|
||||
def get_definition(self):
|
||||
return self.parent
|
||||
|
||||
def is_definition(self):
|
||||
if self._is_definition is None:
|
||||
return super(FakeName, self).is_definition()
|
||||
else:
|
||||
return self._is_definition
|
||||
|
||||
|
||||
@contextmanager
|
||||
def predefine_names(context, flow_scope, dct):
|
||||
predefined = context.predefined_names
|
||||
|
||||
Reference in New Issue
Block a user