mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
psycopg2 fix for github issue 4
This commit is contained in:
@@ -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)
|
||||
|
||||
9
test/completion/thirdparty/psycopg.py
vendored
Normal file
9
test/completion/thirdparty/psycopg.py
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
conn = psycopg2.connect('dbname=test')
|
||||
|
||||
#? ['cursor']
|
||||
conn.cursor
|
||||
|
||||
cur = conn.cursor()
|
||||
|
||||
#? ['fetchall']
|
||||
cur.fetchall
|
||||
Reference in New Issue
Block a user