forked from VimPlug/jedi
best patch in a long time, deleted all the part_parser stuff which was necessary for fast function_definitions, but with the new parser Jedi's fast enough -> fixes #136
This commit is contained in:
@@ -23,11 +23,9 @@ from ast import literal_eval
|
||||
|
||||
from jedi._compatibility import exec_function, unicode
|
||||
from jedi import cache
|
||||
from jedi import parsing
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi import fast_parser
|
||||
from jedi import debug
|
||||
from jedi import settings
|
||||
from jedi import common
|
||||
|
||||
|
||||
@@ -103,7 +101,6 @@ class ModuleWithCursor(Module):
|
||||
self._relevant_temp = None
|
||||
|
||||
self.source = source
|
||||
self._part_parser = None
|
||||
|
||||
@property
|
||||
def parser(self):
|
||||
@@ -251,21 +248,6 @@ class ModuleWithCursor(Module):
|
||||
except IndexError:
|
||||
raise StopIteration()
|
||||
|
||||
def get_part_parser(self):
|
||||
""" Returns a parser that contains only part of the source code. This
|
||||
exists only because of performance reasons.
|
||||
"""
|
||||
if self._part_parser:
|
||||
return self._part_parser
|
||||
|
||||
# TODO check for docstrings
|
||||
length = settings.part_line_length
|
||||
offset = max(self.position[0] - length, 0)
|
||||
s = '\n'.join(self.source.splitlines()[offset:offset + length])
|
||||
self._part_parser = parsing.Parser(s, self.path, self.position,
|
||||
offset=(offset, 0))
|
||||
return self._part_parser
|
||||
|
||||
|
||||
def get_sys_path():
|
||||
def check_virtual_env(sys_path):
|
||||
|
||||
Reference in New Issue
Block a user