roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

Python3 support #141

Closed zackhsi closed 6 years ago

zackhsi commented 6 years ago

Hello! Python3 support via jedi does not currently work.

I have dug into this a little bit, and through the troubleshooting wiki I got this stack.

It may be related to Jedi 0.11.0, which introduced significant changes.

2017-09-26 17:36:38,517 [INFO @ cm_jedi.py:cm_refresh:68] 47510 - context [{'scope_match': 'python', 'lnum': 1, 'bufnr': 1, 'changedtick': 9, 'typed': 'impo', 'base': 'impo', 'filetype': 'python', 'curpos': [0, 1, 5, 0, 5], 'col': 5, 'early_cache': False, 'filepath': '/Users/zhsi/Desktop/PERF-781-beyond-CAC/script.py', 'scope': 'python', 'force': 0, 'startcol': 1, 'match_end': 0}]
2017-09-26 17:36:38,517 [ERROR @ cm.py:on_notification:267] 47510 - Failed processing method: cm_refresh, args: [{'scopes': ['python'], 'cm_refresh_patterns': ['^(import|from).*\\s', '\\.', '\\(\\s?', ',\\s?'], 'early_cache': 0, 'name': 'cm-jedi', 'priority': 9, 'enable': True, 'auto_popup': 1, 'scoping': True, 'sort': 1, 'channel': {'id': 15, 'module': 'cm_sources.cm_jedi', 'events': [], 'type': 'python3', 'multi_thread': 0}, 'abbreviation': 'Py', 'cm_refresh_length': 3}, {'scope_match': 'python', 'lnum': 1, 'bufnr': 1, 'changedtick': 9, 'typed': 'impo', 'base': 'impo', 'filetype': 'python', 'curpos': [0, 1, 5, 0, 5], 'col': 5, 'early_cache': False, 'filepath': '/Users/zhsi/Desktop/PERF-781-beyond-CAC/script.py', 'scope': 'python', 'force': 0, 'startcol': 1, 'match_end': 0}]
Traceback (most recent call last):
  File "/Users/zhsi/.vim/plugged/nvim-completion-manager/pythonx/cm.py", line 264, in on_notification
    func(*args)
  File "/Users/zhsi/.vim/plugged/nvim-completion-manager/pythonx/cm_sources/cm_jedi.py", line 71, in cm_refresh
    script = jedi.Script(src, ctx['lnum'], len(ctx['typed']), path)
AttributeError: module 'jedi' has no attribute 'Script'

Thanks!

roxma commented 6 years ago

I have updated to Jedi 0.11.0, but I cannot reproduce the error.

zackhsi commented 6 years ago

🤦‍♂️ thanks.

roxma commented 6 years ago

Maybe there's something wrong with your jedi installation.

Try run some demo manually from jedi's official documentation.

zackhsi commented 6 years ago

The issue was that I didn't have jedi installed, but I did have jedi-vim installed, which ended up getting imported. Python...