jedi error fix

This commit is contained in:
Anthony Scopatz 2019-10-01 20:59:47 -04:00
parent 657858f5cd
commit 556db6d124
2 changed files with 30 additions and 3 deletions

24
news/jedierr.rst Normal file
View file

@ -0,0 +1,24 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Fixed issue with Jedi xontrib incorrectly raising errors
during tab completion.
**Security:**
* <news item>

View file

@ -31,10 +31,13 @@ def complete_jedi(prefix, line, start, end, ctx):
src = builtins.__xonsh__.shell.shell.accumulated_inputs + line
script = jedi.api.Interpreter(src, [ctx], column=end)
if builtins.__xonsh__.env.get('CASE_SENSITIVE_COMPLETIONS'):
rtn = {x.name_with_symbols for x in script.completions()
if x.name_with_symbols.startswith(prefix)}
rtn = {x.name_with_symbols for x in script.completions()
if x.name_with_symbols.startswith(prefix)}
else:
rtn = {x.name_with_symbols for x in script.completions()}
try:
rtn = {x.name_with_symbols for x in script.completions()}
except Exception:
rtn = set()
return rtn