1
0
forked from VimPlug/jedi

fix problems of the last 10 commits

This commit is contained in:
David Halter
2013-01-05 18:24:07 +01:00
parent 4b98321796
commit 6c2f8a759d
3 changed files with 5 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ search functions `get_names_for_scope` and `get_scopes_for_name`. At the end
there are the `follow_` functions, which evaluate a statement, or parts of a
statement.
TODO super()
TODO nonlocal statement, needed or can be ignored? (py3k)
"""
from _compatibility import next, property, hasattr, is_py3k, use_metaclass, \
@@ -842,7 +841,7 @@ class Array(use_metaclass(cache.CachedMetaClass, parsing.Base)):
def __getattr__(self, name):
if name not in ['type', 'start_pos', 'get_only_subelement']:
raise AttributeError('Strange access: %s.' % name)
raise AttributeError('Strange access on %s: %s.' % (self, name))
return getattr(self._array, name)
def __repr__(self):

View File

@@ -218,7 +218,7 @@ def scan_array_for_pos(arr, pos, overwrite_after=False):
call = None
for s in sub:
if isinstance(s, parsing.Array):
new = scan_array_for_pos(s, pos)
new = scan_array_for_pos(s, pos, overwrite_after)
if new[0] is not None:
call, index, stop = new
if stop:
@@ -234,7 +234,7 @@ def scan_array_for_pos(arr, pos, overwrite_after=False):
if s.execution.start_pos < pos and \
(None in end or pos < end):
c, index, stop = scan_array_for_pos(
s.execution, pos)
s.execution, pos, overwrite_after)
if stop:
return c, index, stop

View File

@@ -196,6 +196,8 @@ class ModuleWithCursor(Module):
def get_line(self, line_nr):
if not self._line_cache:
self._line_cache = self.source.splitlines()
if not self.source: # ''.splitlines() == []
self._line_cache = [self.source]
if line_nr == 0:
# This is a fix for the zeroth line. We need a newline there, for