diff --git a/builtin.py b/builtin.py index 056b015f..ce467c20 100644 --- a/builtin.py +++ b/builtin.py @@ -386,6 +386,9 @@ def parse_function_doc(func): # get result type, which can contain newlines pattern = re.compile(r'(,\n|[^\n-])+') ret_str = pattern.match(doc, index + 3).group(0).strip() + # New object -> object() + ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str) + ret = Parser.map_types.get(ret_str, ret_str) if ret == ret_str and ret not in ['None', 'object', 'tuple', 'set']: debug.dbg('not working', ret_str) diff --git a/test/completion/thirdparty/psycopg.py b/test/completion/thirdparty/psycopg.py new file mode 100644 index 00000000..89e6f050 --- /dev/null +++ b/test/completion/thirdparty/psycopg.py @@ -0,0 +1,9 @@ +conn = psycopg2.connect('dbname=test') + +#? ['cursor'] +conn.cursor + +cur = conn.cursor() + +#? ['fetchall'] +cur.fetchall