Skip to content

Commit e2f56e3

Browse files
committed
wip
1 parent 9fc24a9 commit e2f56e3

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

_pydev_bundle/pydev_ipython_console_011.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,20 @@ def __init__(self, *args, **kwargs):
9696
def matchers(self):
9797
"""All active matcher routines for completion"""
9898
# To remove python_matches we now have to override it as it's now a property in the superclass.
99+
100+
# Newer versions of IPython have file_matcher and magic_matcher.
101+
try:
102+
file_matches = self.file_matches
103+
except AttributeError:
104+
file_matches = self.file_matcher
105+
106+
try:
107+
magic_matches = self.magic_matches
108+
except AttributeError:
109+
magic_matches = self.magic_matcher
99110
return [
100-
self.file_matches,
101-
self.magic_matches,
111+
file_matches,
112+
magic_matches,
102113
self.python_func_kw_matches,
103114
self.dict_key_matches,
104115
]
@@ -137,6 +148,7 @@ class PyDevTerminalInteractiveShell(TerminalInteractiveShell):
137148
# Since IPython 5 the terminal interface is not compatible with Emacs `inferior-shell` and
138149
# the `simple_prompt` flag is needed
139150
simple_prompt = CBool(True)
151+
use_jedy = CBool(False)
140152

141153
# In the PyDev Console, GUI control is done via hookable XML-RPC server
142154
@staticmethod
@@ -366,12 +378,17 @@ def update(self, globals, locals):
366378
def complete(self, string):
367379
try:
368380
if string:
369-
return self.ipython.complete(None, line=string, cursor_pos=string.__len__())
381+
ret = self.ipython.complete(None, line=string, cursor_pos=string.__len__())
370382
else:
371-
return self.ipython.complete(string, string, 0)
383+
ret = self.ipython.complete(string, string, 0)
384+
385+
return ret
372386
except:
387+
import traceback
388+
389+
traceback.print_exc()
373390
# Silence completer exceptions
374-
pass
391+
return None, []
375392

376393
def is_complete(self, string):
377394
# Based on IPython 0.10.1
@@ -435,8 +452,6 @@ def getCompletions(self, text, act_tok):
435452
append((ipython_completion, pydev_doc, "", pydev_type))
436453
return ret
437454
except:
438-
import traceback
439-
440455
traceback.print_exc()
441456
return []
442457

0 commit comments

Comments
 (0)