Show More
@@ -3,6 +3,7 b' from wcwidth import wcwidth' | |||
|
3 | 3 | |
|
4 | 4 | from IPython.utils.py3compat import PY3 |
|
5 | 5 | |
|
6 | from IPython.core.completer import IPCompleter | |
|
6 | 7 | from prompt_toolkit.completion import Completer, Completion |
|
7 | 8 | from prompt_toolkit.layout.lexers import Lexer |
|
8 | 9 | from prompt_toolkit.layout.lexers import PygmentsLexer |
@@ -13,8 +14,11 b' import pygments.lexers as pygments_lexers' | |||
|
13 | 14 | class IPythonPTCompleter(Completer): |
|
14 | 15 | """Adaptor to provide IPython completions to prompt_toolkit""" |
|
15 | 16 | def __init__(self, shell): |
|
17 | if isinstance(shell, IPCompleter): | |
|
18 | raise TypeError("IPythonPTCompleter expects an InteractiveShell" | |
|
19 | " instance in IPython 5.1, not a Completer") | |
|
16 | 20 | self.shell = shell |
|
17 | ||
|
21 | ||
|
18 | 22 | @property |
|
19 | 23 | def ipy_completer(self): |
|
20 | 24 | return self.shell.Completer |
General Comments 0
You need to be logged in to leave comments.
Login now