mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
added import tests
This commit is contained in:
@@ -58,8 +58,6 @@ class FileWithCursor(modules.File):
|
||||
close_brackets = [')', ']', '}']
|
||||
|
||||
gen = tokenize.generate_tokens(fetch_line)
|
||||
# TODO can happen: raise TokenError, ("EOF in multi-line statement"
|
||||
# where???
|
||||
string = ''
|
||||
level = 0
|
||||
for token_type, tok, start, end, line in gen:
|
||||
@@ -199,6 +197,9 @@ def complete(source, row, column, source_path):
|
||||
for s in scopes:
|
||||
completions += s.get_defined_names()
|
||||
|
||||
# remove duplicates
|
||||
completions = list(set(completions))
|
||||
|
||||
needs_dot = not dot and path
|
||||
completions = [Completion(c, needs_dot, len(like)) for c in completions
|
||||
if c.names[-1].lower().startswith(like.lower())]
|
||||
|
||||
Reference in New Issue
Block a user