forked from VimPlug/jedi
moved more functions from api to helpers
This commit is contained in:
@@ -10,6 +10,8 @@ import os
|
||||
import sys
|
||||
|
||||
from jedi import Interpreter
|
||||
from jedi.api.helpers import completion_parts
|
||||
from jedi.parser.user_context import UserContext
|
||||
|
||||
|
||||
def setup_readline(namespace_module=__main__):
|
||||
@@ -53,7 +55,7 @@ def setup_readline(namespace_module=__main__):
|
||||
bash).
|
||||
|
||||
"""
|
||||
class JediRL():
|
||||
class JediRL(object):
|
||||
def complete(self, text, state):
|
||||
"""
|
||||
This complete stuff is pretty weird, a generator would make
|
||||
@@ -70,7 +72,8 @@ def setup_readline(namespace_module=__main__):
|
||||
try:
|
||||
interpreter = Interpreter(text, [namespace_module.__dict__])
|
||||
|
||||
path, dot, like = interpreter._get_completion_parts()
|
||||
path = UserContext(text, (1, len(text))).get_path_until_cursor()
|
||||
path, dot, like = completion_parts(path)
|
||||
before = text[:len(text) - len(like)]
|
||||
completions = interpreter.completions()
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user