mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-11 00:01:54 +08:00
pep8
This commit is contained in:
@@ -426,7 +426,8 @@ class Script(object):
|
|||||||
This would return `None`.
|
This would return `None`.
|
||||||
"""
|
"""
|
||||||
def check_user_stmt(user_stmt):
|
def check_user_stmt(user_stmt):
|
||||||
if user_stmt is None or not isinstance(user_stmt, parsing.Statement):
|
if user_stmt is None \
|
||||||
|
or not isinstance(user_stmt, parsing.Statement):
|
||||||
return None, 0
|
return None, 0
|
||||||
ass = helpers.fast_parent_copy(user_stmt.get_assignment_calls())
|
ass = helpers.fast_parent_copy(user_stmt.get_assignment_calls())
|
||||||
|
|
||||||
@@ -460,7 +461,6 @@ class Script(object):
|
|||||||
else:
|
else:
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
call, index = check_cache()
|
call, index = check_cache()
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
|
|||||||
@@ -246,4 +246,3 @@ def scan_array_for_pos(arr, pos):
|
|||||||
# The third return is just necessary for recursion inside, because
|
# The third return is just necessary for recursion inside, because
|
||||||
# it needs to know when to stop iterating.
|
# it needs to know when to stop iterating.
|
||||||
return call, index, stop
|
return call, index, stop
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ class ModuleWithCursor(Module):
|
|||||||
self._parser = parsing.PyFuzzyParser(self.source, self.path,
|
self._parser = parsing.PyFuzzyParser(self.source, self.path,
|
||||||
self.position)
|
self.position)
|
||||||
if self.path is not None:
|
if self.path is not None:
|
||||||
builtin.CachedModule.cache[self.path] = time.time(), self._parser
|
builtin.CachedModule.cache[self.path] = time.time(), \
|
||||||
|
self._parser
|
||||||
return self._parser
|
return self._parser
|
||||||
|
|
||||||
def get_path_until_cursor(self):
|
def get_path_until_cursor(self):
|
||||||
|
|||||||
@@ -192,6 +192,13 @@ class TestRegression(unittest.TestCase):
|
|||||||
assert len(api.Script(s, 1, 15, '/').get_definition()) == 1
|
assert len(api.Script(s, 1, 15, '/').get_definition()) == 1
|
||||||
assert len(api.Script(s, 1, 10, '/').get_definition()) == 1
|
assert len(api.Script(s, 1, 10, '/').get_definition()) == 1
|
||||||
|
|
||||||
|
class TestSpeed(unittest.TestCase):
|
||||||
|
def test_os_path_join(self):
|
||||||
|
""" named import - jedi-vim issue #8 """
|
||||||
|
s = "join"
|
||||||
|
assert len(api.Script(s, 1, 15, '/').get_definition()) == 1
|
||||||
|
assert len(api.Script(s, 1, 10, '/').get_definition()) == 1
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user