diff --git a/evaluate.py b/evaluate.py index 19a054d5..77e223ef 100644 --- a/evaluate.py +++ b/evaluate.py @@ -661,7 +661,7 @@ class Generator(object): return self.func.parent #self.execution.get_return_types() - def get_index_types(self, index): + def get_index_types(self, index=None): # TODO check if this method is right here, this means that Generators # can be indexed, which is not the Python way. return Execution(self.func).get_return_types(True) diff --git a/ftest.py b/ftest.py index 842b8d07..9d1405f3 100755 --- a/ftest.py +++ b/ftest.py @@ -7,7 +7,7 @@ functions.debug.ignored_modules = ['parsing', 'builtin'] #functions.debug.ignored_modules = ['parsing', 'builtin', 'evaluate', 'modules'] functions.modules.builtin.module_find_path.insert(0, '.') -f_name = 'parsetest.py' +f_name = 'functions.py' #f_name = 'test/completion/classes.py' import os path = os.path.join(os.getcwd(), f_name) @@ -15,7 +15,7 @@ path = os.path.join(os.getcwd(), f_name) f = open(path) code = f.read() for i in range(1): - completions = functions.complete(code, 180, 200, path) + completions = functions.complete(code, 163, 200, path) #completions = functions.get_definitions(code, 181, 2, path) #completions = functions.complete(code, 42, 200, path) diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 348f5746..e1ff93d2 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -41,7 +41,7 @@ if 1: out.append(d) strout = str(out) - except Exception: + except (Exception, evaluate.MultiLevelAttributeError): # print to stdout, will be in :messages print(traceback.format_exc()) strout = '' @@ -67,7 +67,7 @@ if 1: definitions = functions.get_definitions(source, row, column, buf_path) except functions.NotFoundError: msg = 'There is no useful expression under the cursor' - except Exception: + except (Exception, evaluate.MultiLevelAttributeError): # print to stdout, will be in :messages print(traceback.format_exc()) msg = "Some different eror, this shouldn't happen" @@ -99,6 +99,7 @@ sys.path.insert(0, dirname(dirname(vim.eval('s:current_file')))) import traceback # for exception output import functions +import evaluate PYTHONEOF " vim: set et ts=4: